目次
Raspbian GNU/Linux 9 (stretch)にてlldpdを使用する方法。
Raspberry Piに導入した場合の事例となるため、CPUアーキテクチャはARMとなる。
# apt-get install lldpd パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 以下の追加パッケージがインストールされます: libjansson4 提案パッケージ: snmpd 以下のパッケージが新たにインストールされます: libjansson4 lldpd アップグレード: 0 個、新規インストール: 2 個、削除: 0 個、保留: 25 個。 207 kB のアーカイブを取得する必要があります。 この操作後に追加で 538 kB のディスク容量が消費されます。 続行しますか? [Y/n] y 取得:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian stretch/main armhf libjansson4 armhf 2.9-1 [25.2 kB] 取得:2 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian stretch/main armhf lldpd armhf 0.9.6-1 [182 kB] 207 kB を 2秒 で取得しました (97.7 kB/s) 以前に未選択のパッケージ libjansson4:armhf を選択しています。 (データベースを読み込んでいます ... 現在 37259 個のファイルとディレクトリがインストールされています。) .../libjansson4_2.9-1_armhf.deb を展開する準備をしています ... libjansson4:armhf (2.9-1) を展開しています... 以前に未選択のパッケージ lldpd を選択しています。 .../lldpd_0.9.6-1_armhf.deb を展開する準備をしています ... lldpd (0.9.6-1) を展開しています... libjansson4:armhf (2.9-1) を設定しています ... libc-bin (2.24-11+deb9u1) のトリガを処理しています ... systemd (232-25+deb9u1) のトリガを処理しています ... man-db (2.7.6.1-2) のトリガを処理しています ... lldpd (0.9.6-1) を設定しています ... Created symlink /etc/systemd/system/multi-user.target.wants/lldpd.service → /lib/systemd/system/lldpd.service. libc-bin (2.24-11+deb9u1) のトリガを処理しています ... systemd (232-25+deb9u1) のトリガを処理しています ...
# systemctl enable lldpd Synchronizing state of lldpd.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable lldpd
# systemctl start lldpd
# systemctl status lldpd
● lldpd.service - LLDP daemon
Loaded: loaded (/lib/systemd/system/lldpd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-01-16 23:33:02 JST; 9min ago
Docs: man:lldpd(8)
Main PID: 13706 (lldpd)
CGroup: /system.slice/lldpd.service
├─13706 lldpd: monitor.
└─13709 lldpd: connected to MGT-SW01.
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13706]: 2018-01-16T23:33:02 [INFO/main] protocol EDP disabled
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13706]: 2018-01-16T23:33:02 [INFO/main] protocol FDP disabled
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13706]: 2018-01-16T23:33:02 [INFO/event] libevent 2.0.21-stable initialized with epoll method
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13709]: protocol CDPv1 disabled
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13709]: protocol CDPv2 disabled
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13709]: protocol SONMP disabled
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13709]: protocol EDP disabled
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13709]: protocol FDP disabled
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13709]: libevent 2.0.21-stable initialized with epoll method
1月 16 23:33:02 cs-pi.localnet.asabiya.net lldpd[13706]: 2018-01-16T23:33:02 [INFO/lldpctl] lldpd should resume operationslldpdはインストール後の設定は不要。
サービスが起動するのみで動作する。
# lldpcli show neighbors ------------------------------------------------------------------------------- LLDP neighbors: ------------------------------------------------------------------------------- Interface: eth0, via: LLDP, RID: 1, Time: 0 day, 00:11:35 Chassis: ChassisID: mac cc:e1:d5:09:f7:1a SysName: MGT-SW01 SysDescr: BUFFALO BS-GS2016 TTL: 240 MgmtIP: 192.168.1.3 Capability: Bridge, on Port: PortID: ifname Port 3 PortDescr: Gigabit Ethernet Interface 3 -------------------------------------------------------------------------------
# lldpcli show statistics ------------------------------------------------------------------------------- LLDP statistics: ------------------------------------------------------------------------------- Interface: eth0 Transmitted: 29 Received: 50 Discarded: 0 Unrecognized: 0 Ageout: 0 Inserted: 1 Deleted: 0 -------------------------------------------------------------------------------