我正在嘗試在 debian wheezy 主機上使用 xen 設定多 IP、多子網路環境。我只有一張網卡,客人也是debian喘息。
這是我在 dom0 上的原始工作 /etc/network/interfaces
# physical server IP
auto eth0
iface eth0 inet static
address a.b.197.140
netmask 255.255.255.0
gateway a.b.197.1
# Aliases all working when setup like this in dom0
auto eth0:1
iface eth0:1 inet static
address a.b.197.141
netmask 255.255.255.0
auto eth0:2
iface eth0:2 inet static
address a.b.197.139
netmask 255.255.255.0
auto eth0:3
iface eth0:3 inet static
address a.b.193.149 #new subnet
netmask 255.255.255.0
auto eth0:4
iface eth0:4 inet static
address a.b.192.23 #new subnet
netmask 255.255.255.0
我已將 dom0 介面配置更改為路由(我認為不是橋接?)設置,如下所示。
# Main interface - working
auto eth0
iface eth0 inet static
address a.b.197.140
netmask 255.255.255.0
gateway a.b.197.1
# second interface - working in a.b.192.* on domU
auto xenbr0
iface xenbr0 inet static
bridge_ports none
address a.b.192.254 #no address provided by ISP - its made up by me for gateway in domU
netmask 255.255.255.0
# third interface - working in a.b.193.* on domU
auto xenbr1
iface xenbr1 inet static
bridge_ports none
address a.b.193.254 #no address provided by ISP - its made up by me for gateway in domU
netmask 255.255.255.0
我已經在 xen 設定檔中啟用了封包轉送和 ARP。
我的 domU 是:domA、domB 和 domC
我想如下分配地址。我發現此設定存在一些限制,我需要幫助來解決這個問題。
domA (a.b.197.141)
domB (a.b.193.149)
domC (a.b.197.139, a.b.192.23)
上面唯一工作的是 domB,在 /etc/xen/domB.cfg 中有以下配置
vif = ['bridge=xenbr1, ip=a.b.193.149, mac=some mac']
/etc/網路/介面 (domB)
auto eth0
iface eth0 inet static
address a.b.193.149
netmask 255.255.255.0
gateway a.b.193.254 #made up by me in dom0
domA 應該與 dom0 位於同一子網中,只有當我使用正常橋接時才有效,正如他們在這裡建議的那樣:http://wiki.xenproject.org/wiki/Xen_Beginners_Guide#Setup_Linux_Bridge_for_guest_networking
我已經嘗試了我能想到的所有可能的設置,包括:
1) use same gateway as in dom0
2) set up own interface (xenbr2) with address a.b.197.254 and use as gateway
3) use dom0 eth0 address (a.b.197.140) as gateway
domC 應該在多個子網路中擁有 IP,但在任何一種設定(路由或橋接)中都不起作用。
任何幫助,將不勝感激。謝謝/M