Raspbian 10 LLDP関連
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
目次~
#contents
*概要 [#i95b6f19]
RaspbianへLLDPサービスを追加・稼働させる手順。
*手順 [#l24ee657]
**導入 [#q4a73b1c]
標準リポジトリでパッケージ(lldpad)が提供されているため...
# apt install lldpad
~
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必...
libexiv2-14 libgfortran3 libgmime-2.6-0 libssl1.0.2 uui...
これを削除するには 'apt autoremove' を利用してください。
以下の追加パッケージがインストールされます:
libconfig9
以下のパッケージが新たにインストールされます:
libconfig9 lldpad
アップグレード: 0 個、新規インストール: 2 個、削除: 0 個...
216 kB のアーカイブを取得する必要があります。
この操作後に追加で 642 kB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/rasp...
取得:2 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/rasp...
216 kB を 2秒 で取得しました (142 kB/s)
以前に未選択のパッケージ libconfig9:armhf を選択していま...
(データベースを読み込んでいます ... 現在 165760 個のファ...
.../libconfig9_1.5-0.4_armhf.deb を展開する準備をしてい...
libconfig9:armhf (1.5-0.4) を展開しています...
以前に未選択のパッケージ lldpad を選択しています。
.../lldpad_1.0.1+git20180808.4e642bd-1_armhf.deb を展開...
lldpad (1.0.1+git20180808.4e642bd-1) を展開しています...
libconfig9:armhf (1.5-0.4) を設定しています ...
lldpad (1.0.1+git20180808.4e642bd-1) を設定しています ...
Created symlink /etc/systemd/system/multi-user.target.wa...
Created symlink /etc/systemd/system/sockets.target.wants...
systemd (241-7~deb10u4+rpi1) のトリガを処理しています ...
man-db (2.8.5-2) のトリガを処理しています ...
libc-bin (2.28-10+rpi1) のトリガを処理しています ...
**設定 [#c606d5d9]
lldpadは管理対象とするインターフェイスを指定した設定を行...
-サービス自動起動設定
# systemctl enable lldpad.service
Synchronizing state of lldpad.service with SysV service ...
Executing: /lib/systemd/systemd-sysv-install enable lldpad
-サービス起動
# systemctl start lldpad
-インターフェイスの有効化~
以下のコマンドをにて全インターフェイスのLLDPを有効化する。
~
for i in `ls /sys/class/net/ | grep 'eth\|ens\|eno'`;
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 -T -i eth0 -V mngAddr ipv4=192.168.1.xxx
ipv4 = 192.168.1.xxx
-動作確認
# lldptool get-tlv -i eth0
Chassis ID TLV
MAC: b8:27:eb:3c:21:79
Port ID TLV
MAC: b8:27:eb:3c:21:79
Time to Live TLV
120
Port Description TLV
Interface 2 as eth0
System Name TLV
raspberrypi
System Description TLV
Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10...
System Capabilities TLV
System capabilities: Station Only
Enabled capabilities: Station Only
Management Address TLV
IPv4: 192.168.1.186
Ifindex: 2
End of LLDPDU TLV
終了行:
目次~
#contents
*概要 [#i95b6f19]
RaspbianへLLDPサービスを追加・稼働させる手順。
*手順 [#l24ee657]
**導入 [#q4a73b1c]
標準リポジトリでパッケージ(lldpad)が提供されているため...
# apt install lldpad
~
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必...
libexiv2-14 libgfortran3 libgmime-2.6-0 libssl1.0.2 uui...
これを削除するには 'apt autoremove' を利用してください。
以下の追加パッケージがインストールされます:
libconfig9
以下のパッケージが新たにインストールされます:
libconfig9 lldpad
アップグレード: 0 個、新規インストール: 2 個、削除: 0 個...
216 kB のアーカイブを取得する必要があります。
この操作後に追加で 642 kB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/rasp...
取得:2 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/rasp...
216 kB を 2秒 で取得しました (142 kB/s)
以前に未選択のパッケージ libconfig9:armhf を選択していま...
(データベースを読み込んでいます ... 現在 165760 個のファ...
.../libconfig9_1.5-0.4_armhf.deb を展開する準備をしてい...
libconfig9:armhf (1.5-0.4) を展開しています...
以前に未選択のパッケージ lldpad を選択しています。
.../lldpad_1.0.1+git20180808.4e642bd-1_armhf.deb を展開...
lldpad (1.0.1+git20180808.4e642bd-1) を展開しています...
libconfig9:armhf (1.5-0.4) を設定しています ...
lldpad (1.0.1+git20180808.4e642bd-1) を設定しています ...
Created symlink /etc/systemd/system/multi-user.target.wa...
Created symlink /etc/systemd/system/sockets.target.wants...
systemd (241-7~deb10u4+rpi1) のトリガを処理しています ...
man-db (2.8.5-2) のトリガを処理しています ...
libc-bin (2.28-10+rpi1) のトリガを処理しています ...
**設定 [#c606d5d9]
lldpadは管理対象とするインターフェイスを指定した設定を行...
-サービス自動起動設定
# systemctl enable lldpad.service
Synchronizing state of lldpad.service with SysV service ...
Executing: /lib/systemd/systemd-sysv-install enable lldpad
-サービス起動
# systemctl start lldpad
-インターフェイスの有効化~
以下のコマンドをにて全インターフェイスのLLDPを有効化する。
~
for i in `ls /sys/class/net/ | grep 'eth\|ens\|eno'`;
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 -T -i eth0 -V mngAddr ipv4=192.168.1.xxx
ipv4 = 192.168.1.xxx
-動作確認
# lldptool get-tlv -i eth0
Chassis ID TLV
MAC: b8:27:eb:3c:21:79
Port ID TLV
MAC: b8:27:eb:3c:21:79
Time to Live TLV
120
Port Description TLV
Interface 2 as eth0
System Name TLV
raspberrypi
System Description TLV
Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10...
System Capabilities TLV
System capabilities: Station Only
Enabled capabilities: Station Only
Management Address TLV
IPv4: 192.168.1.186
Ifindex: 2
End of LLDPDU TLV
ページ名: