The program to open lldp on centos is lldpad, and lldpd on ubuntu. Of course, the connected switch also needs to open lldp
First install and run
#yum install lldpad
#lldpad -d
Open on all interfaces
for i in `ls /sys/class/net/ | grep "em\|eth"|grep -v veth`
do
echo "enabling lldp for interface: $i"
lldptool set-lldp -i $i adminStatus=rxtx
lldptool -T -i $i -V sysName enableTx=yes
lldptool -T -i $i -V portDesc enableTx=yes
lldptool -T -i $i -V sysDesc enableTx=yes
lldptool -T -i $i -V sysCap enableTx=yes
lldptool -T -i $i -V mngAddr ipv4=`hostname -I`
lldptool -T -i $i -V mngAddr enableTx=yes
done
In this way, the switch can find that
lldpad has a command line debugging tool on the server
#lldptool get-tlv -n -i "interface"
Ubuntu should be easier to use, directly have lldpcli command line for debugging
---------------------
lldp protocol packet capture:
tcpdump -i enp3s0 -nev ether proto 0x88cc
centos7 recommends the following scheme for simpler configuration: https://blog.csdn.net/BK_sys/article/details/88554593
lldpd yum installation method: https://software.opensuse.org/download.html?project=home:vbernat&package=lldpd