ESXi6 LLDP使用方法
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
目次~
#contents
*概要 [#w4b56e82]
ESXi 6.0のLLDPサポート状況は以下となっている。
|vSwitch|CDPのみサポート|
|dvSwitch|LLDP/CDPをサポート|
|vmnic|LLDPをサポート|
*vmnicのLLDP有効化 [#u8284e4c]
**概要 [#k774ee77]
GUI画面にはLLDPに関する項目は無く、有効化にはSSHにてリモ...
**設定手順 [#vb23c431]
設定はvSwitch単位で行い、vmnicとの接続性があるポートに対...
***ポート番号を確認 [#wfabd045]
-コマンド書式
vsish -e ls /net/portsets/[vSwitch Num]/ports
-サンプル
vsish -e ls /net/portsets/vSwitch0/ports
-出力結果
33554433/
33554434/
33554435/
33554436/
33554437/
33554438/
***vmnicとの接続ポート確認 [#f002ddc3]
-コマンド書式
vsish -e get /net/portsets/[vSwitch Num]/ports/[Port Num...
-サンプル
vsish -e get /net/portsets/vSwitch0/ports/33554434/status
-出力結果
port {
port index:2
portCfg:
dvPortId:
clientName:vmnic2
clientType:port types: 4 -> Physical NIC
clientSubType:port types: 0 -> NONE
world leader:0
flags:port flags: 0x1010c043 -> IN_USE ENABLED UPLINK ...
Impl customized blocked flags:0x00000000
Passthru status:: 0x1 -> WRONG_VNIC
fixed Hw Id:00:1f:29:57:70:b0:
ethFRP:frame routing {
requested:filter {
flags:0x00000000
unicastAddr:00:00:00:00:00:00:
numMulticastAddresses:0
multicastAddresses:
LADRF:[0]: 0x0
[1]: 0x0
}
accepted:filter {
flags:0x00000000
unicastAddr:00:00:00:00:00:00:
numMulticastAddresses:0
multicastAddresses:
LADRF:[0]: 0x0
[1]: 0x0
}
}
filter supported features:features: 0 -> NONE
filter properties:properties: 0 -> NONE
rx mode:properties: 0 -> INLINE
tune mode:Tuning mode: 0 -> default
}
clientName:欄にvmnic名が表示されているポートでのみLLDPを...
***LLDPの設定確認 [#o70df31b]
-コマンド
vsish -e get /net/portsets/[vSwitch Num]/ports/[Port Num...
-サンプル
vsish -e get /net/portsets/vSwitch0/ports/33554434/lldp/...
-出力結果
|0|LLDPが無効|
|1|LLDPが有効|
***LLDPの有効化 [#hda09a27]
-コマンド
vsish -e set /net/portsets/[vSwitch Num]/ports/[Port Num...
-サンプル
vsish -e set /net/portsets/vSwitch0/ports/33554434/lldp/...
**設定スクリプト [#b4be8686]
下記サイトにて公開されているスクリプトを使用することでvSw...
[[esxi_lldp_control.sh:https://gist.github.com/raspi/21f7...
***使用方法 [#lcd20e63]
-コマンド書式(有効化)
esxi_lldp_control.sh [vSwitch Num] 1
-コマンド書式(無効化)
esxi_lldp_control.sh [vSwitch Num] 0
-サンプル(有効化)
# esxi_lldp_control.sh vSwitch0 1
Port: 33554433
port index:1
clientName:Management
clientType:port types: 0 -> NONE
portCfg:
Trying to change LLDP state to 1..
ERROR: changing LLDP state failed
------------------------------
Port: 33554434
port index:2
clientName:vmnic2
clientType:port types: 4 -> Physical NIC
portCfg:
Trying to change LLDP state to 1..
LLDP state successfully changed
------------------------------
***ソース [#u9b72e90]
-esxi_lldp_control.sh
#!/bin/sh
# Enable/Disable LLDP on vSwitch ports on VMWare ESXi
# Tested with ESXi 6.0.0 3620759
# Doesn't need vCenter, only SSH access to the ESXi mach...
# (c) Pekka "raspi" Jarvinen 2016 http://raspi.fi/
SWITCH=$1
OPERATION=$2
if [ "$SWITCH" = "" ] || [ "$OPERATION" = "" ]; then
echo "Enable/disable LLDP on vSwitch"
echo ""
echo "USAGE:"
echo "$0 <vSwitch> <operation>"
echo "Examples: "
echo "Enable LLDP: $0 vSwitch0 1"
echo "Disable LLDP: $0 vSwitch0 0"
exit 1
fi
case "$OPERATION" in
0) ;;
1) ;;
*) echo "Invalid operation: $OPERATION"; exit 1 ;;
esac
for PORT in `vsish -e ls /net/portsets/$SWITCH/ports | s...
do
echo "Port: $PORT"
DATA=`vsish -e get /net/portsets/$SWITCH/ports/$PORT/s...
echo "$DATA" | grep -i "port index:"
echo "$DATA" | grep -i "clientName:"
echo "$DATA" | grep -i "clientType:"
echo "$DATA" | grep -i "portCfg:"
echo " Trying to change LLDP state to $OPERATION.."
vsish -e set /net/portsets/$SWITCH/ports/$PORT/lldp/en...
LLDPSTATE=`vsish -e get /net/portsets/$SWITCH/ports/$P...
if [ "$LLDPSTATE" = "$OPERATION" ]; then
echo " LLDP state successfully changed"
else
echo " ERROR: changing LLDP state failed"
fi
echo "------------------------------"
echo ""
done
*ESXi起動時のLLDP自動有効化 [#d83c4937]
** 概要[#jdfb23c8]
ESXiの再起動によりLLDPの設定は初期化(無効化)されてしま...
~
/etc/rc.local.d/local.shに記入することで、ESXiの起動時に...
** 設定 [#y89ea477]
起動時にアクセスが可能な場所に前述のesxi_lldp_control.sh...
-/etc/rc.local.d/local.sh
(任意の箇所に記入)
## enable LLDP
/vmfs/volumes/〜PATH〜/esxi_lldp_control.sh vSwitch0 1 >...
/vmfs/volumes/〜PATH〜/esxi_lldp_control.sh vSwitch1 1 >...
・・・必要数を記述する
*参考資料 [#sf0b61b7]
[[LLDP and Standard Virtual Switches :http://blog.shanono...
~
[[esxi_lldp_control.sh:https://gist.github.com/raspi/21f7...
終了行:
目次~
#contents
*概要 [#w4b56e82]
ESXi 6.0のLLDPサポート状況は以下となっている。
|vSwitch|CDPのみサポート|
|dvSwitch|LLDP/CDPをサポート|
|vmnic|LLDPをサポート|
*vmnicのLLDP有効化 [#u8284e4c]
**概要 [#k774ee77]
GUI画面にはLLDPに関する項目は無く、有効化にはSSHにてリモ...
**設定手順 [#vb23c431]
設定はvSwitch単位で行い、vmnicとの接続性があるポートに対...
***ポート番号を確認 [#wfabd045]
-コマンド書式
vsish -e ls /net/portsets/[vSwitch Num]/ports
-サンプル
vsish -e ls /net/portsets/vSwitch0/ports
-出力結果
33554433/
33554434/
33554435/
33554436/
33554437/
33554438/
***vmnicとの接続ポート確認 [#f002ddc3]
-コマンド書式
vsish -e get /net/portsets/[vSwitch Num]/ports/[Port Num...
-サンプル
vsish -e get /net/portsets/vSwitch0/ports/33554434/status
-出力結果
port {
port index:2
portCfg:
dvPortId:
clientName:vmnic2
clientType:port types: 4 -> Physical NIC
clientSubType:port types: 0 -> NONE
world leader:0
flags:port flags: 0x1010c043 -> IN_USE ENABLED UPLINK ...
Impl customized blocked flags:0x00000000
Passthru status:: 0x1 -> WRONG_VNIC
fixed Hw Id:00:1f:29:57:70:b0:
ethFRP:frame routing {
requested:filter {
flags:0x00000000
unicastAddr:00:00:00:00:00:00:
numMulticastAddresses:0
multicastAddresses:
LADRF:[0]: 0x0
[1]: 0x0
}
accepted:filter {
flags:0x00000000
unicastAddr:00:00:00:00:00:00:
numMulticastAddresses:0
multicastAddresses:
LADRF:[0]: 0x0
[1]: 0x0
}
}
filter supported features:features: 0 -> NONE
filter properties:properties: 0 -> NONE
rx mode:properties: 0 -> INLINE
tune mode:Tuning mode: 0 -> default
}
clientName:欄にvmnic名が表示されているポートでのみLLDPを...
***LLDPの設定確認 [#o70df31b]
-コマンド
vsish -e get /net/portsets/[vSwitch Num]/ports/[Port Num...
-サンプル
vsish -e get /net/portsets/vSwitch0/ports/33554434/lldp/...
-出力結果
|0|LLDPが無効|
|1|LLDPが有効|
***LLDPの有効化 [#hda09a27]
-コマンド
vsish -e set /net/portsets/[vSwitch Num]/ports/[Port Num...
-サンプル
vsish -e set /net/portsets/vSwitch0/ports/33554434/lldp/...
**設定スクリプト [#b4be8686]
下記サイトにて公開されているスクリプトを使用することでvSw...
[[esxi_lldp_control.sh:https://gist.github.com/raspi/21f7...
***使用方法 [#lcd20e63]
-コマンド書式(有効化)
esxi_lldp_control.sh [vSwitch Num] 1
-コマンド書式(無効化)
esxi_lldp_control.sh [vSwitch Num] 0
-サンプル(有効化)
# esxi_lldp_control.sh vSwitch0 1
Port: 33554433
port index:1
clientName:Management
clientType:port types: 0 -> NONE
portCfg:
Trying to change LLDP state to 1..
ERROR: changing LLDP state failed
------------------------------
Port: 33554434
port index:2
clientName:vmnic2
clientType:port types: 4 -> Physical NIC
portCfg:
Trying to change LLDP state to 1..
LLDP state successfully changed
------------------------------
***ソース [#u9b72e90]
-esxi_lldp_control.sh
#!/bin/sh
# Enable/Disable LLDP on vSwitch ports on VMWare ESXi
# Tested with ESXi 6.0.0 3620759
# Doesn't need vCenter, only SSH access to the ESXi mach...
# (c) Pekka "raspi" Jarvinen 2016 http://raspi.fi/
SWITCH=$1
OPERATION=$2
if [ "$SWITCH" = "" ] || [ "$OPERATION" = "" ]; then
echo "Enable/disable LLDP on vSwitch"
echo ""
echo "USAGE:"
echo "$0 <vSwitch> <operation>"
echo "Examples: "
echo "Enable LLDP: $0 vSwitch0 1"
echo "Disable LLDP: $0 vSwitch0 0"
exit 1
fi
case "$OPERATION" in
0) ;;
1) ;;
*) echo "Invalid operation: $OPERATION"; exit 1 ;;
esac
for PORT in `vsish -e ls /net/portsets/$SWITCH/ports | s...
do
echo "Port: $PORT"
DATA=`vsish -e get /net/portsets/$SWITCH/ports/$PORT/s...
echo "$DATA" | grep -i "port index:"
echo "$DATA" | grep -i "clientName:"
echo "$DATA" | grep -i "clientType:"
echo "$DATA" | grep -i "portCfg:"
echo " Trying to change LLDP state to $OPERATION.."
vsish -e set /net/portsets/$SWITCH/ports/$PORT/lldp/en...
LLDPSTATE=`vsish -e get /net/portsets/$SWITCH/ports/$P...
if [ "$LLDPSTATE" = "$OPERATION" ]; then
echo " LLDP state successfully changed"
else
echo " ERROR: changing LLDP state failed"
fi
echo "------------------------------"
echo ""
done
*ESXi起動時のLLDP自動有効化 [#d83c4937]
** 概要[#jdfb23c8]
ESXiの再起動によりLLDPの設定は初期化(無効化)されてしま...
~
/etc/rc.local.d/local.shに記入することで、ESXiの起動時に...
** 設定 [#y89ea477]
起動時にアクセスが可能な場所に前述のesxi_lldp_control.sh...
-/etc/rc.local.d/local.sh
(任意の箇所に記入)
## enable LLDP
/vmfs/volumes/〜PATH〜/esxi_lldp_control.sh vSwitch0 1 >...
/vmfs/volumes/〜PATH〜/esxi_lldp_control.sh vSwitch1 1 >...
・・・必要数を記述する
*参考資料 [#sf0b61b7]
[[LLDP and Standard Virtual Switches :http://blog.shanono...
~
[[esxi_lldp_control.sh:https://gist.github.com/raspi/21f7...
ページ名: