CentOS7 LLDP使用方法
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
目次~
#contents
*概要 [#s9a19d83]
CetnOS7にてlldpdを使用する方法。~
*x86への導入 [#k40a4174]
一般的なIntelアーキテクチャ環境への導入
**環境情報 [#h84000d3]
-ディストリビューション
# 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@kbuild...
-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.40...
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 api...
bogomips : 6784.76
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
〜以下略
**導入手順 [#sb3c9719]
***インストール [#vededb65]
CentOSのリポジトリよりインストールを行う。
-パッケージ導入
# yum install lldpad
-サービスの自動起動を設定する~
# systemctl enable lldpad
-サービスを起動する~
# systemctl start lldpad
-起動結果
# systemctl status lldpad
● lldpad.service - Link Layer Discovery Protocol Agent D...
Loaded: loaded (/usr/lib/systemd/system/lldpad.service...
Active: active (running) since Mon 2017-05-08 00:06:48...
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 ...
May 08 00:06:48 HOSTNAME systemd[1]: Starting Link Layer...
*ARMへの導入(Raspberry Pi) [#b88f197d]
Raspberry Piに導入した場合の事例。~
**環境情報 [#uaa2286f]
-ディストリビューション
# 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.ce...
-CPUタイプ
# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv...
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
〜以下略
**導入手順 [#nb1aba49]
***インストール [#n5bcfeb2]
CentOS7(ARM版)のリポジトリにはlldpadが含まれていないため...
-パッケージ入手
--lldpad
wget https://archive.fedoraproject.org/pub/archive/fedor...
--libconfig
wget https://archive.fedoraproject.org/pub/archive/fedor...
--libnl
wget https://archive.fedoraproject.org/pub/archive/fedor...
wget https://archive.fedoraproject.org/pub/archive/fedor...
-パッケージ導入
rpm -ivh libconfig-1.4.9-7.fc21.armv7hl.rpm
rpm -Uvh libnl3-cli-3.2.25-4.fc21.armv7hl.rpm libnl3-3.2...
rpm -ivh lldpad-0.9.46-8.git48a5f38.fc21.armv7hl.rpm
-サービスの自動起動を設定する~
# systemctl enable lldpad.service
Created symlink from /etc/systemd/system/multi-user.targ...
Created symlink from /etc/systemd/system/sockets.target....
-サービスを起動する~
# systemctl start lldpad
-起動結果
# systemctl status lldpad.service
● lldpad.service - Link Layer Discovery Protocol Agent D...
Loaded: loaded (/usr/lib/systemd/system/lldpad.service...
Active: active (running) since Sun 2017-05-07 14:59:10...
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]...
May 07 14:59:10 hw-mon01.localnet.asabiya.net systemd[1]...
Hint: Some lines were ellipsized, use -l to show in full.
*設定 [#x6df873d]
-インターフェイスが返す値を設定
for i in `ls /sys/class/net/ | grep 'eth\|ens\|eno\|em\|...
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.2...
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
終了行:
目次~
#contents
*概要 [#s9a19d83]
CetnOS7にてlldpdを使用する方法。~
*x86への導入 [#k40a4174]
一般的なIntelアーキテクチャ環境への導入
**環境情報 [#h84000d3]
-ディストリビューション
# 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@kbuild...
-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.40...
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 api...
bogomips : 6784.76
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
〜以下略
**導入手順 [#sb3c9719]
***インストール [#vededb65]
CentOSのリポジトリよりインストールを行う。
-パッケージ導入
# yum install lldpad
-サービスの自動起動を設定する~
# systemctl enable lldpad
-サービスを起動する~
# systemctl start lldpad
-起動結果
# systemctl status lldpad
● lldpad.service - Link Layer Discovery Protocol Agent D...
Loaded: loaded (/usr/lib/systemd/system/lldpad.service...
Active: active (running) since Mon 2017-05-08 00:06:48...
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 ...
May 08 00:06:48 HOSTNAME systemd[1]: Starting Link Layer...
*ARMへの導入(Raspberry Pi) [#b88f197d]
Raspberry Piに導入した場合の事例。~
**環境情報 [#uaa2286f]
-ディストリビューション
# 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.ce...
-CPUタイプ
# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv...
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
〜以下略
**導入手順 [#nb1aba49]
***インストール [#n5bcfeb2]
CentOS7(ARM版)のリポジトリにはlldpadが含まれていないため...
-パッケージ入手
--lldpad
wget https://archive.fedoraproject.org/pub/archive/fedor...
--libconfig
wget https://archive.fedoraproject.org/pub/archive/fedor...
--libnl
wget https://archive.fedoraproject.org/pub/archive/fedor...
wget https://archive.fedoraproject.org/pub/archive/fedor...
-パッケージ導入
rpm -ivh libconfig-1.4.9-7.fc21.armv7hl.rpm
rpm -Uvh libnl3-cli-3.2.25-4.fc21.armv7hl.rpm libnl3-3.2...
rpm -ivh lldpad-0.9.46-8.git48a5f38.fc21.armv7hl.rpm
-サービスの自動起動を設定する~
# systemctl enable lldpad.service
Created symlink from /etc/systemd/system/multi-user.targ...
Created symlink from /etc/systemd/system/sockets.target....
-サービスを起動する~
# systemctl start lldpad
-起動結果
# systemctl status lldpad.service
● lldpad.service - Link Layer Discovery Protocol Agent D...
Loaded: loaded (/usr/lib/systemd/system/lldpad.service...
Active: active (running) since Sun 2017-05-07 14:59:10...
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]...
May 07 14:59:10 hw-mon01.localnet.asabiya.net systemd[1]...
Hint: Some lines were ellipsized, use -l to show in full.
*設定 [#x6df873d]
-インターフェイスが返す値を設定
for i in `ls /sys/class/net/ | grep 'eth\|ens\|eno\|em\|...
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.2...
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
ページ名: