Ìܼ¡

³µÍ×

CetnOS 6¤Ë¤Ælldpd¤ò»ÈÍѤ¹¤ëÊýË¡¡£

ƳÆþ¼ê½ç

¥¤¥ó¥¹¥È¡¼¥ë

  • ¥Ñ¥Ã¥±¡¼¥¸Æ³Æþ
    # yum install lldpad
    
    ==============================================================================================================================
     ¥Ñ¥Ã¥±¡¼¥¸                      ¥¢¡¼¥­¥Æ¥¯¥Á¥ã             ¥Ð¡¼¥¸¥ç¥ó                         ¥ê¥Ý¥¸¥È¥ê¡¼              ÍÆÎÌ
    ==============================================================================================================================
    ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤Þ¤¹:
     lldpad                          x86_64                     0.9.46-3.el6_5                     base                     215 k
    °Í¸À­´ØÏ¢¤Ç¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¤·¤Þ¤¹¡£:
     libconfig                       x86_64                     1.3.2-1.1.el6                      base                      51 k
     lldpad-libs                     x86_64                     0.9.46-3.el6_5                     base                      28 k
  • ¥µ¡¼¥Ó¥¹¤Î¼«Æ°µ¯Æ°¤òÀßÄꤹ¤ë
    # chkconfig lldpad on
    
    # chkconfig --list | grep lldp
    lldpad          0:off   1:off   2:on    3:on    4:on    5:on    6:off
  • ¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤¹¤ë
    # /etc/init.d/lldpad start
    lldpad ¤òµ¯Æ°Ãæ:                                           [  OK  ]

ÀßÄê

  • eth0¤¬ÊÖ¤¹ÃͤòÀßÄê
    # lldptool set-lldp adminStatus=rxtx
    adminStatus = rxtx
    
    # lldptool -T -i eth0 -V  sysName enableTx=yes
    enableTx = yes
    
    # lldptool -T -i eth0 -V  portDesc enableTx=yes
    enableTx = yes
    
    # lldptool -T -i eth0 -V  sysDesc enableTx=yes 
    enableTx = yes
    
    # lldptool -T -i eth0 -V  sysCap enableTx=yes  
    enableTx = yes
    
    # lldptool -T -i eth0 -V  mngAddr enableTx=yes 
    enableTx = yes
  • ÀßÄê¤ÎÍ­¸ú²½
    # /etc/init.d/lldpad restart
    lldpad ¤òÄä»ßÃæ:                                           [  OK  ]
    lldpad ¤òµ¯Æ°Ãæ:                                           [  OK  ]
  • ÀßÄê·ë²Ì¤Î³Îǧ
    # lldptool get-tlv -i eth0  
    Chassis ID TLV
           MAC: 00:50:56:9e:57:5e
    Port ID TLV
           MAC: 00:50:56:9e:57:5e
    Time to Live TLV
           120
    Port Description TLV
           Interface   3 as eth0
    System Name TLV
           zabbix.asabiya.net
    System Description TLV
           Linux zabbix.asabiya.net 2.6.32-504.16.2.el6.x86_64 #1 SMP Wed Apr 22 06:48:29 UTC 2015 x86_64
    System Capabilities TLV
           System capabilities:  Station Only
           Enabled capabilities: Station Only
    Management Address TLV
           IPv4: 192.168.xxx.xxx
           Ifindex: 3
    End of LLDPDU TLV

Tips

°ì³çÀßÄꤹ¤ë¥¹¥¯¥ê¥×¥È

   for i in `ls /sys/class/net/ | grep eth` ;
         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: 00:10:18:c8:57:bc
Port ID TLV
       MAC: 00:10:18:c8:57:bc
Time to Live TLV
       120
Port Description TLV
       Interface   2 as eth0
System Name TLV
       kvm01.localnet.asaboya.net
System Description TLV
       Linux kvm01.localnet.asaboya.net 2.6.32-696.3.2.el6.x86_64 #1 SMP Tue Jun 20 01:26:55 UTC 2017 x86_64
System Capabilities TLV
       System capabilities:  Router
       Enabled capabilities: Router
Management Address TLV
       IPv4: 192.168.1.245
       Ifindex: 2
End of LLDPDU TLV

¥È¥Ã¥×   ÊÔ½¸ Åà·ë º¹Ê¬ ŽÊŽÞŽ¯Ž¸Ž±Ž¯ŽÌŽß źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS
Last-modified: 2017-07-04 (²Ð) 21:59:20 (2481d)