14 Cisco Router and Switch Basics
- Answer Key
In this lab you will complete a basic configuration on a switch, verify Cisco
Discovery Protocol CDP and analyse the effects of interface speed and duplex
configuration.
Cisco Router and Switch Initial Configuration
1) Configure Router 1 with the hostname ‘R1’
Router(config)#hostname R1
R1(config)#
2) Configure Router 2 with the hostname ‘R2’
Router(config)#hostname R2
R2(config)#
3) Configure Switch 1 with the hostname ‘SW1’
Switch(config)#hostname SW1
SW1(config)#
4) Configure the IP address on R1 according to the topology diagram
R1(config)#interface FastEthernet0/0
R1(config-if)#ip address [Link] [Link]
R1(config-if)#no shutdown
5) Configure the IP address on R2 according to the topology diagram
R2(config)#interface FastEthernet0/0
R2(config-if)#ip address [Link] [Link]
R1(config-if)#no shutdown
6) Give SW1 the management IP address [Link]/24
SW1(config)#interface vlan1
SW1(config-if)#ip address [Link] [Link]
SW1(config-if)#no shutdown
7) The switch should have connectivity to other IP subnets via R2
SW1(config)#ip default-gateway [Link]
8) Verify the switch can ping its default gateway
SW1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
1/2/8 ms
9) Enter suitable descriptions on the interfaces connecting the devices
R1(config)#interface FastEthernet 0/0
R1(config-if)#description Link to SW1
R2(config-if)#interface FastEthernet 0/0
R2(config-if)#description Link to SW1
SW1(config)#interface FastEthernet 0/1
SW1(config-if)#description Link to R1
SW1(config-if)#interface FastEthernet 0/2
SW1(config-if)#description Link to R2
10) On SW1, verify that speed and duplex are automatically negotiated to 100
Mbps full duplex on the link to R1
SW1#show interface f0/1
FastEthernet0/1 is up, line protocol is up (connected)
Hardware is Lance, address is 00e0.8fd6.8901 (bia
00e0.8fd6.8901)
Description: Link to R1
BW 100000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s
11) Manually configure full duplex and FastEthernet speed on the link to R2
SW1(config)#interface FastEthernet 0/2
SW1(config-if)#speed 100
SW1(config-if)#duplex full
Don’t forget to configure matching settings on R2!
R2(config)#interface FastEthernet 0/0
R2(config-if)#speed 100
R2(config-if)#duplex full
12) What version of IOS is the switch running?
SW1#show version
Cisco IOS Software, C2960 Software (C2960-LANBASE-M),
Version 12.2(25)FX, RELEASE SOFTWARE (fc1)
CDP Configuration
13) Verify the directly attached Cisco neighbors using Cisco Discovery
Protocol
SW1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
R1 Fas 0/1 170 R C2800 Fas 0/0
R2 Fas 0/2 134 R C2800 Fas 0/0
14) Prevent R1 from discovering information about Switch 1 via CDP
SW1(config)#interface FastEthernet 0/1
SW1(config-if)#no cdp enable
15) Flush the CDP cache on R1 by entering the ‘no cdp run’ then ‘cdp run’
commands in global configuration mode
R1(config)#no cdp run
R1(config)#cdp run
16) Verify that R1 cannot see SW1 via CDP
R1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
R1#
Switch Troubleshooting
17) Verify the status of the switch port connected to R2 with the show ip
interface brief command. It should show status and protocol up/up.
SW1#show ip interface brief
Interface IP-Address OK? Method Status
Protocol
Vlan1 [Link] YES manual up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset up up
18) Shut down the interface connected to R2 and issue a show ip
interface brief command again. The status and protocol should
show administratively down/down.
SW1(config)#interface FastEthernet 0/2
SW1(config-if)#shutdown
*Mar 1 00:44:34.212: %LINK-5-CHANGED: Interface
FastEthernet0/2, changed state to administratively down
*Mar 1 00:44:35.219: %LINEPROTO-5-UPDOWN: Line protocol on
Interface FastEthernet0/2, changed state to down
SW1(config-if)#do show ip interface brief
Interface IP-Address OK? Method Status
Protocol
Vlan1 [Link] YES manual up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset administratively down down
19) Bring the interface up again. Verify the speed and duplex setting.
SW1(config)#interface FastEthernet 0/2
SW1(config-if)#no shutdown
SW1(config-if)#
*Mar 1 00:45:52.637: %LINK-3-UPDOWN: Interface
FastEthernet0/2, changed state to up
*Mar 1 00:45:53.644: %LINEPROTO-5-UPDOWN: Line protocol on
Interface FastEthernet0/2, changed state to up
SW1#sh interface f0/2
FastEthernet0/2 is up, line protocol is up (connected)
Hardware is Lance, address is 00e0.8fd6.8902 (bia
00e0.8fd6.8902)
BW 100000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s
20) Set the duplex to half on Switch 1. Leave the settings as they are on R2.
SW1(config-if)#duplex half
SW1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/2, changed state
to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface
FastEthernet0/2, changed state to down
21) Verify the state of the interface.
The interface is down/down. It will not forward traffic.
SW1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 unassigned YES manual up up
FastEthernet0/2 unassigned YES manual down down
22) Set the duplex back to full duplex.
SW1(config)#int f0/2
SW1(config-if)#duplex full
SW1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/2, changed state
to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface
FastEthernet0/2, changed state to up
23) Set the speed to 10 Mbps.
SW1(config)#int f0/2
SW1(config-if)#speed 10
SW1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/2, changed state
to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface
FastEthernet0/2, changed state to down
24) Check if the interface is still operational.
SW1#show ip interface brief
Interface IP-Address OK? Method Status
Protocol
Vlan1 [Link] YES manual up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset down down
The interface status is down/down.
25) Check if the interface is operational on R2. What is the status of the
interface?
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 [Link] YES manual up down
The interface status is up/down on R2.