目次~
#contents
*概要 [#s9a19d83]
CetnOS 6にてlldpdを使用する方法。

*導入手順 [#nb1aba49]
**インストール [#n5bcfeb2]
-パッケージ導入
 # 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  ]

**設定 [#x6df873d]
-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 [#ud9b925b]
**一括設定するスクリプト [#zecd2699]
    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

**取得結果 [#x35ec0f5]
 # 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