10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP (Instructor Version)
Instructor Note: Red font color or gray highlights indicate text that appears in the instructor copy only.

10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP
Addressing Table
| Device | Interface | IP Address |
|---|---|---|
| HQ | G0/0/0 | 192.168.1.1/24 |
| G0/0/1 | 192.168.2.1/24 | |
| S0/1/0 | 192.168.3.1/30 | |
| Branch | G0/0/0 | 192.168.4.1/24 |
| S0/1/0 | 192.168.3.2/30 | |
| HQ-SW-1 | VLAN 1 | Not configured |
| HQ-SW-2 | VLAN 1 | Not configured |
| BR-SW-1 | VLAN 10 | 192.168.4.250 |
| BR-SW-2 | VLAN 10 | 192.168.4.253 |
| BR-SW-3 | VLAN 10 | 192.168.4.254 |
| NTP Server | NIC | 192.168.1.254 |
| PC1 | NIC | 192.168.2.10 |
| PC2 | NIC | 192.168.4.10 |
| PC3 | NIC | 192.168.4.20 |
Objectives
In this activity, you will configure a router to receive time information over NTP and configure devices with CDP and LLDP.
- Configure CDP to run globally on a device.
- Disable CDP on device interfaces where necessary.
- Configure LLDP to run globally on a device.
- Configure LLDP to send and receive messages according to requirements.
- Configure a router to use an NTP server.
Background / Scenario
A network administrator has been asked to investigate a new client’s network. Documentation is incomplete for the network, so some information needs to be discovered. In addition, the NTP server needs to be configured on a router. Discovery protocols must also be adjusted to control traffic discovery protocol traffic and prevent information about the network from being received by potentially unauthorized hosts.
Some of the device IP addresses are unknown to you. You must determine what the IP addresses are so that you can connect to the devices over SSH in order to configure them. You can enter them into the Addressing Table as you discover them.
Instructions
Use the table below to logon to the Branch switches when you need to do so.
| Device | Username | User Password | Enable Secret |
|---|---|---|---|
| BR-SW-1 | admin | SW1admin# | SW1EnaAccess# |
| BR-SW-2 | admin | SW2admin# | SW2EnaAccess# |
| BR-SW-3 | admin | SW3admin# | SW3EnaAccess# |
Note: Click the Fast Forward Time button in the blue bar below the topology to speed up STP convergence. You can also click it several times to speed up the CDP update process.
Configure LLDP as follows:
-
- Disable CDP on the HQ router.
HQ(config)#no cdp run
-
- Enable LLDP globally on HQ.
HQ(config)#lldp run
-
- On HQ, configure the links to the switches to only receive LLDP messages.
HQ(config)#interface GigabitEthernet0/0/0 HQ(config-if)#no lldp transmit HQ(config-if)#lldp receive HQ(config-if)#interface GigabitEthernet0/0/1 HQ(config-if)#no lldp transmit HQ(config-if)#lldp receive
-
- Disable CDP on the HQ-SW-1 and HQ-SW-2 switches.
-
- Enable LLDP on the HQ-SW-1 and HQ-SW-2 switches.
-
- On the HQ-SW-1 and HQ-SW-2 switches, configure the links to the HQ router to only send, not receive, LLDP messages.
-
- Disable LLDP completely on the HQ-SW-1 and HQ-SW-2 access ports that are in use.
Configure CDP as follows:
-
- Activate CDP on the Branch router.
Branch(config)#cdp run
On the Branch router, issue the command show cdp neighbors detail to identify the IP address of BR-SW-1 and populate this address in the address table.
Branch#show cdp neighbors detail Device ID: BR-SW-1 Entry address(es): IP address : 192.168.4.250 Platform: cisco 2960, Capabilities: Switch Interface: GigabitEthernet0/0/0.10, Port ID (outgoing port): GigabitEthernet0/1 Holdtime: 170
-
- Connect to switch BR-SW-1 over SSH. You will not be able to open a CLI window by clicking the Branch switches.
Branch#ssh -l admin 192.168.4.250
Password: SW1admin#
BR-SW-1>On the BR-SW-1, issue the command show cdp neighbors detail to identify the IP address of BR-SW-2/BR-SW-3 and populate this address in the address table.
BR-SW-1>enable Password: SW1EnaAccess# BR-SW-1#show cdp neighbors detail Device ID: BR-SW-2 Entry address(es): IP address : 192.168.4.253 Platform: cisco 2960, Capabilities: Switch Interface: GigabitEthernet0/2, Port ID (outgoing port): GigabitEthernet0/2 Holdtime: 124 --------------------------- Device ID: BR-SW-3 Entry address(es): IP address : 192.168.4.254 Platform: cisco 2960, Capabilities: Switch Interface: FastEthernet0/24, Port ID (outgoing port): GigabitEthernet0/1 Holdtime: 124
-
- Connect to switches BR-SW2 and BR-SW3 over SSH. Configure the access ports that are in use to not send CDP messages out of the ports.
BR-SW-1#ssh -l admin 192.168.4.253 Password: BR-SW-2>enable Password: BR-SW-2#configure terminal BR-SW-2(config)#interface fa0/1 BR-SW-2(config-if)#no cdp enable BR-SW-2(config-if)#end BR-SW-2#ssh -l admin 192.168.4.254 Password: BR-SW-3>enable Password: BR-SW-3#configure terminal BR-SW-3(config)#interface fa0/1 BR-SW-3(config-if)#no cdp enable BR-SW-3(config-if)#end
Configure NTP:
-
- Configure HQ to use the device at 192.168.1.254 as an NTP server.
HQ(config)#ntp server 192.168.1.254
Device Configs - Final
ROUTER HQ
! ============================================================== !--- 10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP !--- ANSWER SCRIPT FOR ROUTER HQ !--- Usage: from the console (or CLI tab) on HQ, enter privileged EXEC mode with "enable", !--- then paste this whole file. Every line beginning with "!" is a comment; IOS ignores it. !--- HQ switches entirely from CDP to LLDP, configured to only RECEIVE from its two !--- switches (never transmit back to them) - a one-way flow of discovery info toward HQ. ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- Enable LLDP globally, then set both switch-facing links to receive-only. !--- "lldp receive" is included explicitly even though it's on by default once LLDP itself !--- is running - harmless, just makes the intent explicit in the saved config. ! -------------------------------------------------------------- lldp run interface GigabitEthernet0/0/0 no lldp transmit lldp receive exit interface GigabitEthernet0/0/1 no lldp transmit lldp receive exit ! -------------------------------------------------------------- !--- Disable CDP entirely on HQ - this network standardizes on LLDP instead. ! -------------------------------------------------------------- no cdp run ! -------------------------------------------------------------- !--- Point HQ at the NTP server on its own LAN. ! -------------------------------------------------------------- ntp server 192.168.1.254 end ! ============================================================== !--- Verification: !--- HQ# show lldp neighbors -> HQ-SW-1 and HQ-SW-2 both appear (HQ is receiving from !--- both); neither switch would see HQ if you checked their own "show lldp neighbors" !--- HQ# show cdp -> "% CDP is not enabled" !--- HQ# show ntp status -> synchronizes to 192.168.1.254 after a few minutes (or Fast !--- Forward Time) ! ==============================================================
ROUTER Branch
! ============================================================== !--- 10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP !--- ANSWER SCRIPT FOR ROUTER Branch !--- Usage: from the console (or CLI tab) on Branch, enter privileged EXEC mode with !--- "enable", then paste this whole file. Every line beginning with "!" is a comment; IOS !--- ignores it. !--- Unlike HQ, Branch's site standardizes on CDP instead of LLDP - simply turning it on is !--- the entire task here. ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- CDP is off by default in this scenario - turn it on globally. ! -------------------------------------------------------------- cdp run end ! ============================================================== !--- Verification: !--- Branch# show cdp -> now shows CDP globally enabled !--- Branch# show cdp neighbors -> BR-SW-1 should appear on G0/0/0 ! ==============================================================
Switch HQ-SW-1
! ============================================================== !--- 10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP !--- ANSWER SCRIPT FOR SWITCH HQ-SW-1 !--- Usage: from the console (or CLI tab) on HQ-SW-1, enter privileged EXEC mode with !--- "enable", then paste this whole file. Every line beginning with "!" is a comment; IOS !--- ignores it. !--- HQ-SW-1 sends LLDP toward HQ but never receives from it (the mirror image of HQ's own !--- receive-only configuration), and has LLDP fully disabled on its access port (to the NTP !--- Server) since that's an end host with nothing useful to discover. ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- Switch this site's discovery protocol from CDP to LLDP. ! -------------------------------------------------------------- lldp run no cdp run ! -------------------------------------------------------------- !--- Access port to the NTP Server - no CDP/LLDP neighbor will ever exist here, so !--- disable LLDP completely (both directions) to avoid leaking any info to that host. ! -------------------------------------------------------------- interface FastEthernet0/24 no lldp receive no lldp transmit exit ! -------------------------------------------------------------- !--- Uplink to HQ - send LLDP info toward HQ, but don't receive anything back (matches HQ's !--- own "transmit disabled, receive enabled" configuration on its side of this same link). ! -------------------------------------------------------------- interface GigabitEthernet0/1 no lldp receive end ! ============================================================== !--- Verification: !--- HQ-SW-1# show lldp neighbors -> nothing appears for HQ (HQ never transmits, and this !--- switch never receives on G0/1 anyway) !--- HQ-SW-1# show cdp -> "% CDP is not enabled" ! ==============================================================
Switch HQ-SW-2
! ============================================================== !--- 10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP !--- ANSWER SCRIPT FOR SWITCH HQ-SW-2 !--- Usage: from the console (or CLI tab) on HQ-SW-2, enter privileged EXEC mode with !--- "enable", then paste this whole file. Every line beginning with "!" is a comment; IOS !--- ignores it. !--- Same pattern as HQ-SW-1: send-only toward HQ, and LLDP fully disabled on the access !--- port in use (here, PC1's port instead of a server port). ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- Switch this site's discovery protocol from CDP to LLDP. ! -------------------------------------------------------------- lldp run no cdp run ! -------------------------------------------------------------- !--- Access port to PC1 - disable LLDP completely (both directions). ! -------------------------------------------------------------- interface FastEthernet0/1 no lldp receive no lldp transmit exit ! -------------------------------------------------------------- !--- Uplink to HQ - send only, matching HQ's receive-only side of this link. ! -------------------------------------------------------------- interface GigabitEthernet0/1 no lldp receive end ! ============================================================== !--- Verification: !--- HQ-SW-2# show lldp neighbors -> nothing appears for HQ !--- HQ-SW-2# show cdp -> "% CDP is not enabled" ! ==============================================================
Switch BR-SW-2
! ============================================================== !--- 10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP !--- ANSWER SCRIPT FOR SWITCH BR-SW-2 !--- Usage: BR-SW-2 can't be reached by clicking it directly - connect via SSH first !--- (username admin, password SW2admin#, enable secret SW2EnaAccess#), then enter !--- privileged EXEC mode and paste this whole file. Every line beginning with "!" is a !--- comment; IOS ignores it. !--- BR-SW-1 needs no configuration changes at all in this lab (only used as an SSH !--- reachability point per the instructions) - only BR-SW-2 and BR-SW-3 get the CDP !--- restriction below. ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- Access port to PC2 - stop advertising this switch's own CDP info out toward an end !--- host that has no use for it. ! -------------------------------------------------------------- interface FastEthernet0/1 no cdp enable end ! ============================================================== !--- Verification: !--- BR-SW-2# show cdp interface -> FastEthernet0/1 no longer listed as CDP-enabled !--- CDP itself stays globally enabled here (Branch's site standard) - only this one access !--- port is restricted. ! ==============================================================
Switch BR-SW-3
! ============================================================== !--- 10.8.1 Packet Tracer - Configure CDP, LLDP, and NTP !--- ANSWER SCRIPT FOR SWITCH BR-SW-3 !--- Usage: BR-SW-3 can't be reached by clicking it directly - connect via SSH first !--- (username admin, password SW3admin#, enable secret SW3EnaAccess#), then enter !--- privileged EXEC mode and paste this whole file. Every line beginning with "!" is a !--- comment; IOS ignores it. ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- Access port to PC3 - same restriction as BR-SW-2's port to PC2. ! -------------------------------------------------------------- interface FastEthernet0/1 no cdp enable end ! ============================================================== !--- Verification: !--- BR-SW-3# show cdp interface -> FastEthernet0/1 no longer listed as CDP-enabled ! ==============================================================


