Switch Configuration
Switch Configuration
packet tracer
LAB – 02
Basic Switch Configuration
❑ Switch Modes
❑ Some Basic Commands
❑ Changing Hostname
❑ Setting a Banner
❑ Display Running-Configuration
❑ Line Console Password
❑ Password for Privileged Mode
❑ Removing Line Console Password
❑ Removing Password for Privileged Mode
❑ How to Assign IP To Switch / How to Remove IP
❑ How to Connect Two or More Than Two Switches By Assigning IP
❑ VLAN / Multi-Switching VLAN – Trunk Port
Switch Modes
Command to
Mode Purpose Prompt Command to enter
exit
debug.
Note: This command allows you to enter into privileged exec mode / enable mode, where you can configure a range of commands.
This prompt for this command looks like this
Switch #
Note: This command allows you tio enter into Global Configuration Mode, where you configure a wide range of commands which effect the
entire system. This prompt for ths command looks like this
Switch (config) #
Note: # is a special character which is uses before starting and ending of a message.
VERFICATION
GIFT # exit
GIFT con0 is now available
Press RETURN to get started (Press ENTER key from keyboard)
WELCOME TO GIFT
GIFT >
Some Basic Switch Commands
Configure Terminal Use to enter into Global confi. Mode Switch # Configure Terminal
Show Version Use to show the Hardware Information Switch # show version
Show-Mac-Table Use to show the MAC Address Table Switch # show mac-address-table
Show IP Interfaces Brief Use to show the information about IP interfaces Switch # show ip interface brief
Show Vlan Use to show information about VLANs Switch # show vlan
Show running configuration Use to show information about running configuration Switch # show running-config
Display Running-Configuration
GIFT > enable GIFT > enable
GIFT # show running-config GIFT # Write
face FastEthernet0/15
Building configuration...
!
Current configuration : 1070 bytes interface FastEthernet0/16
! !
version 12.1 interface FastEthernet0/17
no service timestamps log datetime msec !
no service timestamps debug datetime msec interface FastEthernet0/18 Write Command is use to
no service password-encryption
!
!
interface FastEthernet0/19
save current configuration
hostname GIFT
! ! into NVRAM - Non-volatile
! interface FastEthernet0/20
spanning-tree mode pvst !
! interface FastEthernet0/21
interface FastEthernet0/1 !
! interface FastEthernet0/22
interface FastEthernet0/2
!
!
interface FastEthernet0/3 interface FastEthernet0/23
! !
interface FastEthernet0/4 interface FastEthernet0/24
! !
interface FastEthernet0/5 interface GigabitEthernet1/1
! !
interface FastEthernet0/6
!
interface GigabitEthernet1/2
interface FastEthernet0/7 !
! interface Vlan1
interface FastEthernet0/8 no ip address
! shutdown
interface FastEthernet0/9 !
! banner motd ^C WELCOME TO GIFT SWITCH ^C
interface FastEthernet0/10
!
!
interface FastEthernet0/11 line con 0
! !
interface FastEthernet0/12 line vty 0 4
! login
interface FastEthernet0/13 line vty 5 15
! login
interface FastEthernet0/14
!
!
inter !
end
Switch Hardware Information
Switch > enable
GIFT # show version
Cisco WS-C2950T-24 (RC32300) processor (revision C0) with 21039K bytes of memory.
Processor board ID FHK0610Z0WC
Last reset from system-reset
Running Standard Image
24 FastEthernet/IEEE 802.3 interface(s)
2 Gigabit Ethernet/IEEE 802.3 interface(s)
VERIFICATION
GIFT # exit
GIFT con0 is now available
Press RETURN to get started
WELCOME TO GIFT
User Access Verification
Password: TEST123
GIFT >
GIFT > enable
Password: TEST123
GIFT #
Removing Line Console Password
GIFT > enable
GIFT # configure terminal
GIFT (config) # line console 0
GIFT (config-line) # no login
GIFT (config-line) # no password
GIFT (config-line) # end
GIFT #
Removing Password for Privileged Exec Mode
GIFT > enable
GIFT # configure terminal
GIFT (config) # no enable password
GIFT (config-line) # end
GIFT #
How To Assign An IP To Switch
IP address is the address of device in network. Switch allows us to set IP address on interface level. IP address assigned on interface
is used to manage that particular interface. To manage entire switch we have to assign IP address to VLAN1( Default VLAN of
switch). Also set default gateway IP address from global configuration mode. In following example I would assign IP :176.16.2.50
255.255.0.0 to VLAN1
Switch>enable
Switch# configure terminal
Switch(config)# interface vlan1
Switch(config-if)# ip address 172.16.2.50 255.255.0.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Create Topology & Assign IP
SWITCH CONFIGURATION To Assign An IP
Pc # 1 176.16.2.51 255.255.0.0
Switch2(config-if)
Pc ##4 ip address
176.16.2.64176.16.2.60
255.255.0.0255.255.0.0
Switch2(config-if) # no shutdown
Switch2(config-if)# exit
Switch2(config)#
VLAN Topology
VLAN Configuration
Task Command
Switch> enable
1. Set Hostname Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname GIFT
GIFT(config)#vlan 10
GIFT(config-vlan)#name HR
GIFT(config-vlan)#exit
GIFT(config)#vlan 20
GIFT(config-vlan)#name AC
GIFT(config-vlan)#exit
SW-1>enable SW-2>enable
SW-1#configure terminal SW-2#configure terminal
SW-1(config)#interface gigabitEthernet 1/1 SW-2(config)#interface gigabitEthernet 1/1
SW-1(config-if)#switchport mode trunk SW-2(config-if)#switchport mode trunk
SW-1(config-if)#exit SW-2(config-if)#exit
SW-1(config)#exit SW-2(config)#exit
SW-1# SW-2#
Trunk Port Configuration
SW-1>enable
SW-1#configure terminal
SW-1(config)#interface gigabitEthernet 1/1
SW-1(config-if)#switchport mode trunk
SW-1(config-if)#exit
SW-1(config)#exit
SW-1#
SW-2>enable
SW-2#configure terminal
SW-2(config)#interface gigabitEthernet 1/1
SW-2(config-if)#switchport mode trunk
SW-2(config-if)#exit
SW-2(config)#exit
SW-2#
VLAN Verification Command: show vlan
How to check trunk port : show interfaces trunk
SW-1#show interfaces trunk
Check Connectivity
PC>ping 12.2.0.100