Skip to content
Ask AI

LLDP Configuration

[Command]

**show lldp neighbors ** [interface_name]

show lldp table

[Purpose]

Show LLDP neighbors

[Parameter]

ParameterDescription
interface_nameInterface name

[View]

System view

[Use Cases]

sonic# show lldp table
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort RemoteDevice RemotePortID Capability RemotePortDescr
---------- ---------------- ----------------- ------------ ---------------
Ethernet15 sonic 32:31:9b:9b:1c:18 BR Ethernet15
Ethernet19 76-Server ac:1f:6b:78:00:af BR eno2
Ethernet25 sonic G25 BR Ethernet25
Ethernet47 sonic Ethernet47 BR Ethernet47
Ethernet50 2-20-1 Ethernet15 BR Ethernet15
Ethernet51 sonic Ethernet53 BR Ethernet53
eth0 e4:54:e8:ce:f6:8e
--------------------------------------------------
Total entries displayed: 7
sonic# 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
-------------------------------------------------------------------------------

[Command] show lldp table

[Purpose] Show interface LLDP neighbor

[View] System View

[Use Cases]

Terminal window
sonic# show lldp table
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort RemoteDevice RemotePortID Capability RemotePortDescr
----------- -------------- --------------------- ------------ --------------------------
Ethernet1 sonic Ethernet50 BR Ethernet50
Ethernet7 sonic Ethernet11 BR Y11
Ethernet8 sonic Ethernet11 BR Y11

[Command] show lldp config

[Purpose] Show LLDP configuration

[View] System View

[Use Cases]

Terminal window
sonic# show lldp config
LLDP Enable: enabled
LLDP Management IP: 30.102.0.144
LLDP Port ID Subtype: macaddress
LLDP Dots Power: disable
LLDP Med Power: disable
+-------------+--------------------+
| Interface | LLDP Transparent |
+=============+====================+
| Ethernet1 | enable |
+-------------+--------------------+

[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 |
+------------+---------------+--------+----------+------------+--------+

[Command]

lldp enable

no lldp enable

[Purpose]

Enable LLDP

[View]

System configuration view

[Use Cases]

sonic(config)# lldp enable

[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.15

[Command]

lldp port-id-subtype {macaddress|ifname}

[Purpose]

Configure the interface ID type of LLDP

[Parameter]

ParameterDescription
macaddressMAC Address
ifnameInterface 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 macaddress

[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]

ParameterDescription
vlan_idConfgure the VLAN ID of voice-vlan, video-vlan
priorityCos priority
dscpDSCP 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 1
sonic(config-if-1)# lldp ports med-policy voice vid 100 vlan-type tagged priority 1