LLDP Configuration
show lldp neighbors
Section titled “show lldp neighbors”[Command]
**show lldp neighbors ** [interface_name]
show lldp table
[Purpose]
Show LLDP neighbors
[Parameter]
| Parameter | Description |
|---|---|
| interface_name | Interface name |
[View]
System view
[Use Cases]
sonic# show lldp tableCapability codes: (R) Router, (B) Bridge, (O) OtherLocalPort RemoteDevice RemotePortID Capability RemotePortDescr---------- ---------------- ----------------- ------------ ---------------Ethernet15 sonic 32:31:9b:9b:1c:18 BR Ethernet15Ethernet19 76-Server ac:1f:6b:78:00:af BR eno2Ethernet25 sonic G25 BR Ethernet25Ethernet47 sonic Ethernet47 BR Ethernet47Ethernet50 2-20-1 Ethernet15 BR Ethernet15Ethernet51 sonic Ethernet53 BR Ethernet53eth0 e4:54:e8:ce:f6:8e--------------------------------------------------Total entries displayed: 7sonic# show lldp neighbor Ethernet15-------------------------------------------------------------------------------LLDP neighbors:-------------------------------------------------------------------------------Interface: Ethernet15 , via: LLDP, RID: 1, Time: 1 day, 08:51:31 Chassis: ChassisID: mac 18:17:25:37:65:40 SysName: spine-228 SysDescr: Debian GNU/Linux 9 (stretch) Linux 4.9.0-14-2-amd64 #1 SMP Debian 4.9.246-2 (2020-12-17) x86_64 MgmtIP: 10.250.0.228 MgmtIface: 2 Capability: Bridge, on Capability: Router, on Capability: Wlan, off Capability: Station, off Port: PortID: local C1 PortDescr: 0/0 TTL: 120-------------------------------------------------------------------------------show lldp table
Section titled “show lldp table”[Command] show lldp table
[Purpose] Show interface LLDP neighbor
[View] System View
[Use Cases]
sonic# show lldp tableCapability codes: (R) Router, (B) Bridge, (O) OtherLocalPort RemoteDevice RemotePortID Capability RemotePortDescr----------- -------------- --------------------- ------------ --------------------------Ethernet1 sonic Ethernet50 BR Ethernet50Ethernet7 sonic Ethernet11 BR Y11Ethernet8 sonic Ethernet11 BR Y11show lldp config
Section titled “show lldp config”[Command] show lldp config
[Purpose] Show LLDP configuration
[View] System View
[Use Cases]
sonic# show lldp configLLDP Enable: enabledLLDP Management IP: 30.102.0.144LLDP Port ID Subtype: macaddressLLDP Dots Power: disableLLDP Med Power: disable+-------------+--------------------+| Interface | LLDP Transparent |+=============+====================+| Ethernet1 | enable |+-------------+--------------------+show lldp ports med-policy
Section titled “show lldp ports med-policy”[Command]
show lldp ports med-policy
[Purpose]
Display interface LLDP MED configuration policy
[View]
System view
[Use Cases]
sonic# show lldp ports med-policy+------------+---------------+--------+----------+------------+--------+| Ports | application | vlan | tagged | priority | dscp |+============+===============+========+==========+============+========+| Ethernet20 | voice | 20 | NA | NA | NA |+------------+---------------+--------+----------+------------+--------+lldp enable
Section titled “lldp enable”[Command]
lldp enable
no lldp enable
[Purpose]
Enable LLDP
[View]
System configuration view
[Use Cases]
sonic(config)# lldp enablelldp mgmt-ip
Section titled “lldp mgmt-ip”[Command]
lldp mgmt-ip A.B.C.D
[Purpose]
Configure the management IP address of LLDP
[View]
System configuration view
[Usage Scenario]
Configuring a management address is useful for clearly identifying a device, aiding in network topology mapping, and facilitating network management. When there’s a need to advertise a specific management address to neighbors, this command is used for configuration.
[Notes]
The management address is carried in the Management Address TLV field of LLDP packets, uniquely identifying a device. By default, it is set to the IP address of the management interface. If the management interface address is not configured, it will default to the Docker container’s internal address.
[Use Cases]
sonic(config)# lldp mgmt-ip 10.1.0.15lldp port-id-subtype
Section titled “lldp port-id-subtype”[Command]
lldp port-id-subtype {macaddress|ifname}
[Purpose]
Configure the interface ID type of LLDP
[Parameter]
| Parameter | Description |
|---|---|
| macaddress | MAC Address |
| ifname | Interface Name |
[View]
System configuration view
[Usage Scenario]
In the LLDP table, the interface IP used in the mode is the device’s interface name. To clearly identify interconnected devices, you can configure the interface ID type as a MAC address. By default, the interface ID type is set to “ifname.”.
[Use Cases]
sonic(config)# lldp port-id-subtype macaddresslldp ports med-policy
Section titled “lldp ports med-policy”[Command]
lldp ports med-policy voice [vlan vlan_id ] [vlan-type {tagged|untagged}] [priority priority ] [dscp dscp ]
[Purpose]
Configure interface to publish MED TLV
[Parameter]
| Parameter | Description |
|---|---|
| vlan_id | Confgure the VLAN ID of voice-vlan, video-vlan |
| priority | Cos priority |
| dscp | DSCP priority |
[View]
Interface view
[Usage Scenario]
An LLDPDU is the basic unit of communication in the LLDP protocol, and all device configuration information to be sent is encapsulated within LLDPDUs. Different TLVs are used to transmit or receive information about oneself and neighboring devices. By configuring TLVs to be advertised on an interface, you can automatically configure information such as the IP phone VLAN and priority associated with devices connected to that interface.
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# lldp ports med-policy voice vid 100 vlan-type tagged priority 1