[Enterprise SONiC] LLDP (Link Layer Discovery Protocol) Follow
Link Layer Discovery Protocol (LLDP) is a data link layer protocol. Network devices can send LLDPDUs (Link Layer Discovery Protocol Data Units) over their local network to notify other devices of their status. This is a protocol that allows devices in a network to detect each other and announce their status and mutual information.
- Disable or stop LLDP function
- LLDP global configuration and learning status
- Frequently Asked Question
Tested model & firmware version:
- Switch model name:
DCS201, DCS202 [AS5835-54X(T)]
- Edgecore SONiC version:
202012.0 ~ 202012.5
202111.0 ~ 202111.8
Restriction:
- There is no SONiC command to disable LLDP in 202006 branch. (Workaround: “sudo systemctl stop lldp.service”. However, LLDP service restart after rebooting). In 202012 branch, there is "feature state" command to access LLDP function.
- Start/Stop LLDP service: sudo systemctl [start|stop] lldp
- Enable/Disable LLDP service by default: sudo systemctl [enable|disable] lldp
- Default setting:
- LLDP is enabled
- LLDP PDU interval : 30 seconds
- Support LLDP extended MIB (lldpremtable, lldplocporttable, lldpremmanaddrtable, lldplocmanaddrtable, lldpLocalSystemData). Refer to SNMP configuration
- In the 202012 and 202111 branches, there is commands for LLDP global configurations.
Disable or stop LLDP function
Procedure:
admin@sonic:~$ show feature status lldp
Feature State AutoRestart
--------- -------- -------------
lldp enabled enabled
Steps 2. Stop LLDP feature.
admin@sonic:~$ sudo config feature state lldp disabled
Steps 3. Check feature status.
admin@sonic:~$ show feature status lldp
Feature State AutoRestart
--------- -------- -------------
lldp disabled enabled
Steps 4. Check the systemd and container status for LLDP feature.
systemd:
admin@sonic:~$ sudo systemctl is-active lldp.service
inactive
container:(STATUS is exited)
admin@sonic:~$ docker ps -a -f name=lldp
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8008cfbceb1e docker-lldp:latest "/usr/bin/docker-lld…" 6 weeks ago Exited (137) 4 minutes ago lldp
Steps 5. Save to startup configuration for next booting or "config reload"
admin@sonic:~$ sudo config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json
LLDP global configuration and learning status
Topology:
Procedure:
Steps 1. Check LLDP default information on SwitchA.
admin@sonic:~$ show lldp global
--------------------------------------------------
LLDP Global configuration:
--------------------------------------------------
HELLO TIMER 30
SYSTEM NAME AS5835-54X
SYSTEM DESCRIPTION SONiC Software Version: SONiC.Edgecore-SONiC_20211125_074752_ec202012_227 - HwSku: Accton-AS5835-54X - Distribution: Debian 10.11 - Kernel: 4.19.0-12-2-amd64
Step2. Modified the LLDP information on SwitchA.
admin@sonic:~$ sudo config lldp global hello_timer 10
admin@sonic:~$ sudo config lldp global management_ip 1.1.1.1
admin@sonic:~$ sudo config lldp global system_description AS5835-54X_SWITCHA
admin@sonic:~$ sudo config lldp global system_name SWITCHA
Result:
- Check LLDP table information on SwitchB.
admin@sonic:~$ show lldp table
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort RemoteDevice RemotePortID Capability RemotePortDescr
----------- -------------- ----------------- ------------ -----------------
Ethernet0 8c:ea:1b:30:da:4f
Ethernet56 SWITCHA Eth51/1(Port51) BR Ethernet56
eth0 tor-1.on.ec swp32 BR swp32
--------------------------------------------------
Total entries displayed: 3
- Check LLDP detail neighbor information on SwitchB.
admin@sonic:~$ show lldp neighbors Ethernet56
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface: Ethernet56, via: LLDP, RID: 3, Time: 0 day, 00:01:55
Chassis:
ChassisID: mac 04:f8:f8:8d:81:e1
SysName: SWITCHA
SysDescr: AS5835-54X_SWITCHA
MgmtIP: 1.1.1.1
Capability: Bridge, on
Capability: Router, on
Capability: Wlan, off
Capability: Station, off
Port:
PortID: local Eth51/1(Port51)
PortDescr: Ethernet56
TTL: 40
LLDP-MED:
Device Type: Network Connectivity Device
Capability: Capabilities, yes
Capability: Policy, yes
Capability: Location, yes
Capability: MDI/PSE, yes
Capability: MDI/PD, yes
Capability: Inventory, yes
Inventory:
Hardware Revision: R0CA
Software Revision: 4.19.0-12-2-amd64
Firmware Revision: v43.01.01.00
Serial Number: AK02069566
Manufacturer: Accton
Model: AS5835-54_IKM_T
Asset ID: None
-------------------------------------------------------------------------------
Frequently Asked Question
How to restore the LLDP setting to default.
Tested model & firmware version:
- Switch model name:
DCS203 (AS7326-56X) - Edgecore SONiC version:
202111.1
202111.3
Problem description:
There's no command for remove/delete LLDP global configuration.
admin@sonic:~$ sudo config lldp global --help
Usage: config lldp global [OPTIONS] COMMAND [ARGS]...
LLDP global configuration
Options:
-h, -?, --help Show this message and exit.
Commands:
hello_timer LLDP protocol hello timer
management_ip LLDP protocol management IP address.
system_description LLDP protocol system description
system_name LLDP protocol system name
Solution:
Step 1: Create an LLDP JSON file.
admin@sonic:~$ cat LLDP_default.json
{
"LLDP": null
}
Step 2: execute this command.
admin@sonic:~$ sudo config load LLDP_default.json -y
Running command: /usr/local/bin/sonic-cfggen -j LLDP_default.json --write-to-db
Step 3: Disable the LLDP service. (It needs some time to disable, about 5~10 sec)
admin@sonic:~$ sudo config feature state lldp disabled
Step 4: Enable the LLDP service.
admin@sonic:~$ sudo config feature state lldp enabled.
Comments
0 comments
Please sign in to leave a comment.