虚拟路由 xen 环境中的多个 IP 和子网

虚拟路由 xen 环境中的多个 IP 和子网

我正在尝试使用 xen 在 debian wheezy 主机上设置多 ip、多子网环境。我只有一个 NIC,客户机也是 debian wheezy。

这是我在 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/network/interfaces(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 在同一子网中具有 IP,只有当我使用正常桥接时它才有效,正如他们在此处建议的那样: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

相关内容