CentOS7 LLDP»ÈÍÑÊýË¡
http://extstrg.asabiya.net/pukiwiki/index.php?CentOS7%20LLDP%BB%C8%CD%D1%CA%FD%CB%A1Ìܼ¡
³µÍ× †
CetnOS7¤Ë¤Ælldpd¤ò»ÈÍѤ¹¤ëÊýË¡¡£
x86¤Ø¤ÎƳÆþ †
°ìÈÌŪ¤ÊIntel¥¢¡¼¥¥Æ¥¯¥Á¥ã´Ä¶¤Ø¤ÎƳÆþ
´Ä¶¾ðÊó †
- ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó
# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core)
- Kernel
# cat /proc/version Linux version 3.10.0-514.16.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Apr 12 15:04:24 UTC 2017
- CPU¥¿¥¤¥×
# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1240 v3 @ 3.40GHz stepping : 3 microcode : 0x20 cpu MHz : 3400.000 cache size : 8192 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt bogomips : 6784.76 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: ¡Á°Ê²¼Î¬
ƳÆþ¼ê½ç †
¥¤¥ó¥¹¥È¡¼¥ë †
CentOS¤Î¥ê¥Ý¥¸¥È¥ê¤è¤ê¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤¦¡£
- ¥Ñ¥Ã¥±¡¼¥¸Æ³Æþ
# yum install lldpad
- ¥µ¡¼¥Ó¥¹¤Î¼«Æ°µ¯Æ°¤òÀßÄꤹ¤ë
# systemctl enable lldpad
- ¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤¹¤ë
# systemctl start lldpad
- µ¯Æ°·ë²Ì
# systemctl status lldpad ¡ü lldpad.service - Link Layer Discovery Protocol Agent Daemon. Loaded: loaded (/usr/lib/systemd/system/lldpad.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2017-05-08 00:06:48 JST; 5min ago Main PID: 16454 (lldpad) CGroup: /system.slice/lldpad.service ¨¦¨¡16454 /usr/sbin/lldpad -t May 08 00:06:48 HOSTNAME systemd[1]: Started Link Layer Discovery Protocol Agent Daemon.. May 08 00:06:48 HOSTNAME systemd[1]: Starting Link Layer Discovery Protocol Agent Daemon....
ARM¤Ø¤ÎƳÆþ(Raspberry Pi) †
Raspberry Pi¤ËƳÆþ¤·¤¿¾ì¹ç¤Î»öÎã¡£
´Ä¶¾ðÊó †
- ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó
# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core)
- Kernel
# cat /proc/version Linux version 4.4.26-v7.1.el7 (mockbuild@armv7-02.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ) #1 SMP Sat Oct 22 16:14:43 UTC 2016
- CPU¥¿¥¤¥×
# cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 ¡Á°Ê²¼Î¬
ƳÆþ¼ê½ç †
¥¤¥ó¥¹¥È¡¼¥ë †
CentOS7(ARMÈÇ)¤Î¥ê¥Ý¥¸¥È¥ê¤Ë¤Ïlldpad¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤¿¤á¡¢Fedora release 21¤Î¥ê¥Ý¥¸¥È¥ê¤è¤ê¥Ñ¥Ã¥±¡¼¥¸¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¡£
- ¥Ñ¥Ã¥±¡¼¥¸Æþ¼ê
- lldpad
wget https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/21/Cloud/armhfp/os/Packages/l/lldpad-0.9.46-8.git48a5f38.fc21.armv7hl.rpm
- libconfig
wget https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/21/Cloud/armhfp/os/Packages/l/libconfig-1.4.9-7.fc21.armv7hl.rpm
- libnl
wget https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/21/Cloud/armhfp/os/Packages/l/libnl3-3.2.25-4.fc21.armv7hl.rpm wget https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/21/Cloud/armhfp/os/Packages/l/libnl3-cli-3.2.25-4.fc21.armv7hl.rpm
- ¥Ñ¥Ã¥±¡¼¥¸Æ³Æþ
rpm -ivh libconfig-1.4.9-7.fc21.armv7hl.rpm rpm -Uvh libnl3-cli-3.2.25-4.fc21.armv7hl.rpm libnl3-3.2.25-4.fc21.armv7hl.rpm rpm -ivh lldpad-0.9.46-8.git48a5f38.fc21.armv7hl.rpm
- ¥µ¡¼¥Ó¥¹¤Î¼«Æ°µ¯Æ°¤òÀßÄꤹ¤ë
# systemctl enable lldpad.service Created symlink from /etc/systemd/system/multi-user.target.wants/lldpad.service to /usr/lib/systemd/system/lldpad.service. Created symlink from /etc/systemd/system/sockets.target.wants/lldpad.socket to /usr/lib/systemd/system/lldpad.socket.
- ¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤¹¤ë
# systemctl start lldpad
- µ¯Æ°·ë²Ì
# systemctl status lldpad.service ¡ü lldpad.service - Link Layer Discovery Protocol Agent Daemon. Loaded: loaded (/usr/lib/systemd/system/lldpad.service; enabled; vendor preset: disabled) Active: active (running) since Sun 2017-05-07 14:59:10 UTC; 12s ago Main PID: 14649 (lldpad) CGroup: /system.slice/lldpad.service ¨¦¨¡14649 /usr/sbin/lldpad -t May 07 14:59:10 hw-mon01.localnet.asabiya.net systemd[1]: Started Link Layer Discovery Protocol Agent Daemon.. May 07 14:59:10 hw-mon01.localnet.asabiya.net systemd[1]: Starting Link Layer Discovery Protocol Agent D...... Hint: Some lines were ellipsized, use -l to show in full.
ÀßÄê †
- ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤¬ÊÖ¤¹ÃͤòÀßÄê
for i in `ls /sys/class/net/ | grep 'eth\|ens\|eno\|em\|enp1s6f\|enp2s'`; 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 enableTx=yes; done
- ÀßÄê·ë²Ì¤Î³Îǧ
# lldptool get-tlv -i eth0 Chassis ID TLV MAC: b8:27:eb:39:f8:13 Port ID TLV MAC: b8:27:eb:39:f8:13 Time to Live TLV 120 Port Description TLV Interface 2 as eth0 System Name TLV hw-mon02.localnet.asabiya.net System Description TLV Linux hw-mon02.localnet.asabiya.net 3.18.13-501.20150510gitf36e19f.sc20.armv7hl.bcm2709 #1 SMP PREEMPT Sun May 10 13:50:02 BST 2015 armv7l System Capabilities TLV System capabilities: Station Only Enabled capabilities: Station Only Management Address TLV IPv4: 192.168.xxx.xxx Ifindex: 2 End of LLDPDU TLV
- ÀܳÀ赡´ï¤Î³Îǧ
# lldptool get-tlv -i eth0 -n
Last-modified: 2018-02-06 (²Ð) 17:11:36 (2494d)