
我對主幹測試環境有一個非常具體的問題。我有這樣的網路設定:
+------------+ +------------+
| | +-----+ | |
| eth0 +----+ br0 +----+ eth0 |
| | +-+---+ | |
| Guest1 | | | Guest2 |
| | +-----+ | |
| eth1 +----+ br1 +----+ eth1 |
| | +---+-+ | |
+------------+ | | +------------+
+-+-+--+
| Host |
+------+
KVM 主機為來賓電腦提供兩個橋接器 (/etc/network/interfaces):
auto br0
iface br0 inet manual
bridge_ports none
bridge_fd 0
bridge_stp off
auto br1
iface br1 inet manual
bridge_ports none
bridge_fd 0
bridge_stp off
來賓電腦使用以下設定連接到交換器:
# Actual interfaces
allow-hotplug eth0 eth1
iface eth0 inet manual
iface eth1 inet manual
# Internet facing network
auto eth0.100 eth1.100
iface eth0.100 inet manual
iface eth1.100 inet manual
auto bond0
iface bond0 inet manual
bond_mode active-backup
bond_miimon 200
bond_downdelay 200
bond_updelay 200
# Something I found to make the active secondary slave listening
post-up echo 1 > /sys/devices/virtual/net/bond0/bonding/all_slaves_active
slaves eth0.100 eth1.100
auto bond0.1
address 10.110.0.10x
netmask 255.255.0.0
# Please don't ask why the three vlan is needed.
# The bonding works only if these three are defined :\
現在我的問題如下:
預設的主從介面是兩台客戶機上的 eth0.100 介面。如果我使用以下命令關閉主從伺服器
$ ip link set eth0.100 down
連結根據「ip link」關閉,綁定更改主從,但封包在非活動介面上被接受。 (我透過執行「tshark -i eth1.100」發現了這一點,並且只顯示了 ping 回覆訊息。)
如果我關閉主機上的接口,來賓之間的整個通訊就會停止。即使債券也不承認這種變化。
附加資訊:
- 我沒有 IPTables/EBTables 規則來阻止此介面上的包
- 我知道廣播模式會幫助解決我所有的問題,儘管我認為它會讓兩位客人之間的溝通變得臃腫。我寧願不使用該選項。
問題:
- 為什麼「ip link set ... down」不關閉連結?
- 幹預 all_slaves_active 是否有可能以某種方式乾擾介面狀態?
- 是否有任何我可能會忽略的選項,使主動備份知道介面變更?
- (為什麼我需要三個 VLAN 才能使綁定工作?)
任何答覆表示讚賞。