解决办法:
1,正常安装lldpad的RPM包。
# rpm -ivh libconfig-1.4.9-5.el7.x86_64.rpm
# rpm -ivh lldpad-0.9.46-10.el7.x86_64.rpm
# rpm -ivh lldpad-devel-0.9.46-10.el7.x86_64.rpm
2,正常打开LLDP服务,保持运行状态。
# lldpad –d //开启LLDP服务
# lldptool set-lldp -i $i adminStatus=rxtx //设置LLDP工作模式,其中$i为网卡名(对接TOR上网卡的名称)
# lldptool -T -i $i -V sysName enableTx=yes //设置LLDP信息中包含hostname信息
# lldptool -T -i $i -V portDesc enableTx=yes //设置LLDP信息中包含接口信息
# lldptool -T -i $i -V sysDesc enableTx=yes //设置LLDP信息中包含系统描述信息
3,关闭X722网卡自身的LLDP功能
echo 'lldp stop' > /sys/kernel/debug/i40e/0000\:2b\:00.0/command
其中加粗部分是网卡的PCI号,可以通过lspci | grep Eth查到,替换时符号不用动,只做字符替换即可。
举例:
lspci | grep Eth
2b:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)
2b:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)
2b:00.2 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09)
2b:00.3 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09)
4,在交换机通过 dis lldp nei bri命令可以发现邻居信息(包含主机名)。