Basic configuration of a switch in
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
Allow you to connect with
remote devices, perform
Default mode after booting. Login Use exit
User EXEC basic tests, temporary Switch > with password, if configured. command
change terminal setting, list
system information
Allow you to set operating
parameters. It also includes
Privileged high level testing and list Switch # Use enable command from user Use exit
EXEC commands like show, copy,
exec mode command
debug.
Global Contain commands those
Switch (config)# Use configure terminal command Use exit
Configuration affect the entire system from privileged exec mode command
Switch Modes
Switch > Default mode after booting
Switch > enable
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 #
Switch # configure terminal
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: This command to exit from current mode
Changing Hostname
Switch > enable
Switch # configure terminal
Switch (config ) # hostname GIFT
GIFT ( config ) # exit
GIFT #
Setting a Banner
When someone connects to the Switch , the MOTD ( Message of the Day ) banner appears before the login prompt.
GIFT > enable
GIFT # configure terminal
GIFT ( config ) # banner motd # WELCOME TO GIFT #
GIFT ( config ) # exit
GIFT >
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
Switch Commands Description Command
? Use to show commands in any mode Switch > ?
Enable Use to enter into privileged mode Switch > enable
Configure Terminal Use to enter into Global confi. Mode Switch # Configure Terminal
Tab Use to complete the command Switch # confi term
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 Internetwork Operating System Software
IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA4, RELEASE SOFTWARE(fc1)
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Wed 18-May-05 22:31 by jharirba
Image text-base: 0x80010000, data-base: 0x80562000
ROM: Bootstrap program is is C2950 boot loader
Switch uptime is 17 seconds
System returned to ROM by power-on
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)
63488K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address: 0050.0F55.9580
Motherboard assembly number: 73-5781-09
Power supply part number: 34-0965-01
Motherboard serial number: FOC061004SZ
Power supply serial number: DAB0609127D
Model revision number: C0
Motherboard revision number: A0
Model number: WS-C2950T-24
System serial number: FHK0610Z0WC
Configuration register is 0xF
Mac Address Table
GIFT > enable
GIFT # show mac-address-table
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 0006.2a17.7038 DYNAMIC Fa0/1
1 000b.beea.5c31 DYNAMIC Fa0/2
1 00e0.f978.213d DYNAMIC Fa0/3
1 0006.2ac6.3928 DYNAMIC Fa0/4
1 00e0.8f9e.2622 DYNAMIC Fa0/5
Total 5 PCs are attach with this switch:
By default all ports are enable and members of Vlan-1
Switch IP / Interface Status
Switch > enable
GIFT # show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 unassigned YES manual down down
FastEthernet0/2 unassigned YES manual down down
FastEthernet0/3 unassigned YES manual down down
FastEthernet0/4 unassigned YES manual down down
FastEthernet0/5 unassigned YES manual down down
FastEthernet0/6 unassigned YES manual down down
FastEthernet0/7 unassigned YES manual down down
FastEthernet0/8 unassigned YES manual down down
FastEthernet0/9 unassigned YES manual down down
FastEthernet0/19 unassigned YES manual down down
FastEthernet0/10 unassigned YES manual down down
FastEthernet0/20 unassigned YES manual down down
FastEthernet0/11 unassigned YES manual down down
FastEthernet0/21 unassigned YES manual down down
FastEthernet0/12 unassigned YES manual down down
FastEthernet0/22 unassigned YES manual down down
FastEthernet0/13 unassigned YES manual down down
FastEthernet0/23 unassigned YES manual down down
FastEthernet0/14 unassigned YES manual down down
FastEthernet0/24 unassigned YES manual down down
FastEthernet0/15 unassigned YES manual down down
GigabitEthernet1/1 unassigned YES manual down down
FastEthernet0/16 unassigned YES manual down down
GigabitEthernet1/2 unassigned YES manual down down
FastEthernet0/17 unassigned YES manual down down
Vlan1 unassigned YES manual administratively down down
FastEthernet0/18 unassigned YES manual down down
Line Console Password
GIFT > enable
GIFT # configure terminal
GIFT (config) # line console 0
GIFT (config-line) # password TEST123
GIFT (config-line) # login
Note: Login command is used for checking enable password.
GIFT (config-line) # exit
GIFT (config ) # exit
GIFT # exit
GIFT > enable
VERIFICATION
GIFT # exit
GIFT con0 is now available
Press RETURN to get started
WELCOME TO GIFT
User Access Verification
Password: TEST123
GIFT > enable
Note: if you type a wrong password, IOS of the device does not allow you to enter into
user exec mode
Password for Privileged Mode
GIFT > enable
GIFT # configure terminal
GIFT (config) # enable password TEST123
GIFT (config ) # exit
GIFT #
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
Switch1 > enablePc # 2 176.16.2.52 255.255.0.0
Switch1 # configure terminal
Pc # 3 176.16.2.53 255.255.0.0
Switch1(config) # interface vlan1
Pc # 4 176.16.2.54 255.255.0.0
Switch1(config-if) # ip address 176.16.2.50 255.255.0.0
Switch1(config-if)
Pc ##5 no shutdown
176.16.2.55 255.255.0.0
Switch1(config-if)# exit
Switch1(config)#Pc # 1 176.16.2.61 255.255.0.0
Switch2 > enable
Pc # 2 176.16.2.62 255.255.0.0
Switch 2# configure terminal
Switch2(config) #Pc interface
#3 vlan1
176.16.2.63 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
2. Define Vlan Number & Its Name GIFT(config)#vlan 5
In this example define 3 Vlan with no and name GIFT(config-vlan)#name IT
GIFT(config-vlan)#exit
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
3. Add Interfaces in each Vlan GIFT(config)#interface range f0/1-10
GIFT(config-if-range)#switchport mode access
GIFT(config-if-range)#switchport access vlan 5
GIFT(config-if-range)#exit
GIFT(config)#interface range f0/11-20
GIFT(config-if-range)#switchport mode access
GIFT(config-if-range)#switchport access vlan 10
GIFT(config-if-range)#exit
GIFT(config)#interface range f0/21-24
GIFT(config-if-range)#switchport mode access
GIFT(config-if-range)#switchport access vlan 20
GIFT(config-if-range)#exit
VLAN Verification Command: show vlan
Multi-Switching VLAN Topology / Trunk Port
Switch> Switch>enable
Switch>enable Switch#configure terminal
Switch#configure terminal Switch(config)#hostname SW-2
Switch(config)#hostname SW-1
Multi-VLAN Configuration SW-2(config)#vlan 5
SW-1(config)#vlan 5 SW-2(config-vlan)#name IT
SW-1(config-vlan)#name IT SW-2(config-vlan)#exit
SW-1(config-vlan)#exit
SW-2(config)#vlan 10
SW-1(config)#vlan 10 SW-2(config-vlan)#name HR
SW-1(config-vlan)#name HR SW-2(config-vlan)#exit
SW-1(config-vlan)#exit
SW-2(config)#vlan 20
SW-1(config)#vlan 20 SW-2(config-vlan)#name AC
SW-1(config-vlan)#name AC SW-2(config-vlan)#exit
SW-1(config-vlan)#exit
SW-2(config)#interface range fastEthernet 0/1-10
SW-1(config)#interface range fastEthernet 0/1-10 SW-2(config-if-range)#switchport mode access
SW-1(config-if-range)#switchport mode access SW-2(config-if-range)#switchport access vlan 5
SW-1(config-if-range)#switchport access vlan 5 SW-2(config-if-range)#exit
SW-1(config-if-range)#exit
SW-1(config)#interface range fastEthernet 0/11-20 SW-2(config)#interface range fastEthernet 0/11-20
SW-1(config-if-range)#switchport mode access SW-2(config-if-range)#switchport mode access
SW-1(config-if-range)#switchport access vlan 10 SW-2(config-if-range)#switchport access vlan 10
SW-1(config-if-range)#exit SW-2(config-if-range)#exit
SW-1(config)#interface range fastEthernet 0/21-24 SW-2(config)#interface range fastEthernet 0/21-24
SW-1(config-if-range)#switchport mode access SW-2(config-if-range)#switchport mode access
SW-1(config-if-range)#switchport access vlan 20 SW-2(config-if-range)#switchport access vlan 20
SW-1(config-if-range)#exit SW-2(config-if-range)#exit
SW-1(config)#exit SW-2(config)#exit
SW-1#exit SW-2#exit
SW-1> SW-2>
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
Port Mode Encapsulation Status Native vlan
Gig1/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig1/1 1-1005
Port Vlans allowed and active in management domain
Gig1/1 1,5,10,20
Port Vlans in spanning tree forwarding state and not pruned
Gig1/1 none
SW-2#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gig1/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig1/1 1-1005
Port Vlans allowed and active in management domain
Gig1/1 1,5,10,20
Port Vlans in spanning tree forwarding state and not pruned
Gig1/1 1,5,10,20
SW-2#
How To Place A Server In Your Packet Tracer Network
Check Connectivity
PC>ping 12.2.0.100
Pinging 12.2.0.100 with 32 bytes of data:
Reply from 12.2.0.100: bytes=32 time=1ms TTL=128
Reply from 12.2.0.100: bytes=32 time=0ms TTL=128
Reply from 12.2.0.100: bytes=32 time=0ms TTL=128
Reply from 12.2.0.100: bytes=32 time=12ms TTL=128
Access Web Interface
Ping statistics for 12.2.0.100:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 12ms, Average = 3ms
Add Facebook Server In Your Network
Access Your Facebook Server