
伺服器重新啟動後,bond0
由於其從屬乙太網路之一 ( ) 沒有連結而尚未啟動eth2
,我必須使用以下命令手動設定它:
ip link set dev eth2 up
伺服器有一個到 LAN 的綁定(帶有用於 KVM 的網橋),另一個用於 drbd 到另一台伺服器的綁定:
kvm + lan drbd
##############################################
+------------------------+
| br0 |
+------------------------+
+---------------+ +------+ +---------------+
| bond0 | | vnet | | bond1 |
+---------------+ +------+ +---------------+
+------+ +------+ +------+ +------+
| eth0 | | eth2 | | eth1 | | eth3 |
+------+ +------+ +------+ +------+
兩台伺服器都運行 Debian Wheezy,這是/etc/network/interfaces
:
# The loopback network interface
auto lo
iface lo inet loopback
# to the switch
auto bond0
iface bond0 inet manual
slaves eth0 eth2
bond-mode 802.3ad
bond-miimon 100
bond-downdelay 200
bond-updelay 200
# bridge for KVM
auto br0
iface br0 inet static
address 192.168.0.92
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.101
bridge_ports bond0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
# bond for drbd
auto bond1
iface bond1 inet static
address 10.200.200.2
netmask 255.255.255.0
network 10.200.200.0
broadcast 10.200.200.255
slaves eth1 eth3
bond-mode balance-rr
bond-miimon 100
bond-downdelay 200
bond-updelay 200
另一台伺服器正確啟動,兩者之間的唯一區別interfaces
是聲明時static
的不同manual
bond0
iface bond0 inet static
我怎樣才能防止這種情況再次發生?
增加ip link set
介面是個好主意嗎?
auto bond0
iface bond0 inet manual
pre-up ip link set eth0 up
pre-up ip link set eth2 up
(...)
static
和 和有什麼不一樣manual
?或者更好的是,我可以在哪裡找到介面文件的完整文件? (man interfaces
沒有提及綁定、橋接、無線......選項)
答案1
只需添加:
auto eth0
iface eth0 inet manual
up ip link set eth0 up
down ip link set eth0 down
auto eth1
iface eth1 inet manual
up ip link set eth1 up
down ip link set eth1 down
auto eth2
iface eth2 inet manual
up ip link set eth2 up
down ip link set eth2 down
auto eth3
iface eth3 inet manual
up ip link set eth3 up
down ip link set eth3 down
static
和之間的差異在於manual
,靜態是透過參數(如位址、網路遮罩、從機等)配置的,而手動是透過命令序列(pre-up、up、down、post-down)定義的