[root@sl01 ~]# lldptool -h Usage: lldptoolサービスlldpadの設定ファイルは、/var/lib/lldpad/lldpad.conf。この設定ファイルは、lldpadデーモン起動時に存在していなければ、デーモンが自動的に作成する。[options] [arg] general command line usage format lldptool go into interactive mode [options] [arg] general interactive command format Options: -i [ifname] network interface -V [tlvid] TLV identifier may be numeric or keyword (see below) -n "neighbor" option for command -a "add" option for command -d "remove" option for command -r show raw message -R show only raw messages Commands: license show license information -h|help show command usage information -v|version show version -q|quit exit lldptool (interactive mode) -S|stats get LLDP statistics for ifname -t|get-tlv get TLVs from ifname -T|set-tlv set arg for tlvid to value -l|get-lldp get the LLDP parameters for ifname -L|set-lldp set the LLDP parameter for ifname TLV identifiers: chassisID : Chassis ID TLV portID : Port ID TLV TTL : Time to Live TLV portDesc : Port Description TLV sysName : System Name TLV sysDesc : System Description TLV sysCap : System Capabilities TLV mngAddr : Management Address TLV macPhyCfg : MAC/PHY Configuration Status TLV powerMdi : Power via MDI TLV linkAgg : Link Aggregation TLV MTU : Maximum Frame Size TLV LLDP-MED : LLDP-MED Settings medCap : LLDP-MED Capabilities TLV medPolicy : LLDP-MED Network Policy TLV medLoc : LLDP-MED Location TLV medPower : LLDP-MED Extended Power-via-MDI TLV medHwRev : LLDP-MED Hardware Revision TLV medFwRev : LLDP-MED Firmware Revision TLV medSwRev : LLDP-MED Software Revision TLV medSerNum : LLDP-MED Serial Number TLV medManuf : LLDP-MED Manufacturer Name TLV medModel : LLDP-MED Model Name TLV medAssetID : LLDP-MED Asset ID TLV DCBXv1 : PRE-CEE DCBX TLV DCBX : CEE DCBX TLV evbCfg : EVB Configuration TLV vdp : VDP protocol configuration [root@sl01 ~]#
[root@sl01 ~]# service lldpad stop Shutting down lldpad: [done] [ OK ] [root@sl01 ~]# rm /var/lib/lldpad/lldpad.conf rm: remove 通常ファイル `/var/lib/lldpad/lldpad.conf'? y [root@sl01 ~]# ls -l /var/lib/lldpad/lldpad.conf ls: cannot access /var/lib/lldpad/lldpad.conf: そのようなファイルやディレクトリ はありません [root@sl01 ~]# service lldpad start Starting lldpad: [done] [ OK ] [root@sl01 ~]# ls -l /var/lib/lldpad/lldpad.conf -rw-------. 1 root root 213 1月 28 11:02 2012 /var/lib/lldpad/lldpad.conf [root@sl01 ~]#中身はテキストファイルだ。
[root@sl01 ~]# cat /var/lib/lldpad/lldpad.conf
dcbx :
{
version = "1.0";
dcbx_version = 2;
};
lldp :
{
em1 :
{
tlvid00000001 :
{
info = "04D4AE52724ADD";
};
tlvid00000002 :
{
info = "03D4AE52724ADD";
};
};
};
[root@sl01 ~]#デーモン起動時にリンクアップしているインターフェースに関する定義が自動的に追加されている。 この設定ファイルは、前回までに見たとおり、lldptool(8)コマンドを使い間接的に編集するが、手で編集できないわけでもない。 [root@sl01 ~]# service lldpad stop
Shutting down lldpad: [done] [ OK ]
[root@sl01 ~]# rm /var/lib/lldpad/lldpad.conf
rm: remove 通常ファイル `/var/lib/lldpad/lldpad.conf'? y
[root@sl01 ~]# cp lldpad.conf /var/lib/lldpad/
[root@sl01 ~]# cat /var/lib/lldpad/lldpad.conf
dcbx :
{
version = "1.0";
dcbx_version = 2;
};
lldp :
{
common :
{
adminStatus = 3;
tlvid00000005 :
{
enableTx = true;
};
tlvid00000006 :
{
enableTx = true;
};
tlvid00000004 :
{
enableTx = true;
};
tlvid00000007 :
{
enableTx = true;
};
tlvid00120f01 :
{
enableTx = true;
};
tlvid00120f03 :
{
enableTx = true;
};
tlvid00120f04 :
{
enableTx = true;
};
tlvid00000008 :
{
enableTx = true;
};
};
};
[root@sl01 ~]#この状態でデーモンを起動すると、期待通りLLDPの送受信が有効となっている。 [root@sl01 ~]# service lldpad start
Starting lldpad: [done] [ OK ]
[root@sl01 ~]# lldptool get-tlv -i em1
Chassis ID TLV
MAC: d4:ae:52:72:4a:dd
Port ID TLV
MAC: d4:ae:52:72:4a:dd
Time to Live TLV
120
Port Description TLV
Interface 4 as em1
System Name TLV
sl01.mynetwork.local
System Description TLV
Linux sl01.mynetwork.local 2.6.32-220.2.1.el6.x86_64 #1 SMP Thu Dec 22 11:15:52 CST 2011 x86_64
System Capabilities TLV
System capabilities: Station Only
Enabled capabilities: Station Only
Management Address TLV
IPv6: f246:4000::
Ifindex: 4
MAC/PHY Configuration Status TLV
Auto-negotiation supported and enabled
PMD auto-negotiation capabilities: 0x8037
MAU type: 1000 BaseTFD
Link Aggregation TLV
Aggregation not capable
Currently not aggregated
Aggregated Port ID: 0
Maximum Frame Size TLV
1522
End of LLDPDU TLV
[root@sl01 ~]#ただし、デーモン起動時にリンクアップしていたインターフェースの設定が自動的に追加されている。 [root@sl01 ~]# diff lldpad.conf /var/lib/lldpad/lldpad.conf
43a44,58
> em1 :
> {
> tlvid00000001 :
> {
> info = "04D4AE52724ADD";
> };
> tlvid00000002 :
> {
> info = "03D4AE52724ADD";
> };
> tlvid00000008 :
> {
> ipv6 = "f246:4000::";
> };
> };
[root@sl01 ~]#『Red Hat 6系でLLDPを使う・その1』『Red Hat 6系でLLDPを使う・その2』