Link Layer Discovery Protocol¶
The Link Layer Discovery Protocol (LLDP) service provides a method for discovering which routers are connected to a LAN segment, and offers a way to discover the topology of a network.
Note
LLDP features may need to be enabled on the switch or L2 peer for this to function properly. For example, enabling LLDP on a switch itself or enabling LLDP Forwarding for other devices on the network to see LLDP advertisements from peers directly.
Configuring the LLDP Service¶
LLDP is configured in two places: Global router parameters and per-interface parameters.
To enable LLDP, at least one interface must participate in LLDP.
LLDP Router Configuration¶
Three LLDP commands are available in configuration mode (Configuration Mode) to configure global LLDP parameters for this router.
- lldp system-name <name>
The router hostname advertised by LLDP.
- lldp tx-interval <seconds>
Transmit interval, which controls the time between LLDP messages in seconds.
The default value is
30seconds.- lldp tx-hold <value>
Transmit hold multiplier, which is multiplied by the transmit interval to calculate the total time used for the Time-To-Live (TTL) of the LLDP message.
The default value is
4.
Tip
If the transmit interval is 30 and the transmit hold multiplier is 4,
then the advertised TTL of the LLDP message is 120 (4*30=120).
These parameters can be changed at any time.
LLDP Interface Configuration¶
Additional LLDP commands are available in config-interface mode
(Interface Command) to configure per-interface LLDP identification:
- lldp
Enables LLDP on this interface. Use
no lldpto disable LLDP.- lldp port-name <name>
The name of the interface as advertised by LLDP.
The default value is the name of the interface in TNSR, e.g.
TenGigabitEthernet3/0/0orLAN.- lldp management (ipv4|ipv6) <ip-address>
The IPv4 and/or IPv6 address advertised by LLDP as a means to manage this router on this interface.
- lldp management oid <oid>
An object identifier associated with the management IP address on this interface.
These parameters can be changed at any time.
Warning
LLDP requires lldp to be present on at least one interface to
function.
LLDP Configuration Examples¶
The simplest LLDP configuration involves enabling it on one interface with all default values:
tnsr(config)# interface TenGigabitEthernet3/0/0
tnsr(config-interface)# lldp
tnsr(config-interface)# exit
tnsr(config)#
This next example has global settings and additional configuration on the interface:
tnsr(config)# lldp system-name MyRouter
tnsr(config)# lldp tx-interval 30
tnsr(config)# lldp tx-hold 4
tnsr(config)# interface TenGigabitEthernet3/0/0
tnsr(config-interface)# lldp
tnsr(config-interface)# lldp port-name MyPort
tnsr(config-interface)# lldp management ipv4 192.0.2.123
tnsr(config-interface)# lldp management ipv6 2001:db8::1:2:3:4
tnsr(config-interface)# exit
tnsr(config)#
LLDP Status¶
The LLDP status may be viewed using the command show lldp [<verbose>].
To view a compact list of only LLDP peers, use show lldp:
tnsr(config)# show lldp
Local interface Peer chassis ID Remote port ID Last heard Last sent Status
WAN 9a:3d:b5:7a:8a:67 WAN 22.1s ago 5.5s ago active
For more detail, including the local LLDP configuration, use show lldp
verbose:
tnsr(config)# show lldp verbose
LLDP configuration:
Configured system name: tnsr
Configured tx-hold: 4
Configured tx-interval: 30
Time-to-live: 120
LLDP-enabled interface table:
Local Interface name: WAN
Local Port Description: WAN
Interface/peer state: active
Peer chassis ID: 9a:3d:b5:7a:8a:67 (MAC address)
Remote port ID: WAN (Interface name)
Last packet sent: 3.6s ago
Last packet received: 20.2s ago