我正在尝试在2个网卡的服务器上安装Debian Lenny上的Xen 3.2,一个连接到专用LAN,另一个连接到Internet。 这台服务器已经在非Xen状态下运行了一段时间,一切正常。 然而,与Xen,networking是不正确的。 我很难找出正确的方法来configuration这个,因为在Xen站点/ wiki,邮件列表,甚至是这里都有很多相互矛盾的build议。
以下是基础知识:eth0是专用networking,eth1是公共互联网。 最终,我希望dom0(以及所有的domU)能够访问这两个接口。 目前有一个iptables脚本(来自Xen之前的使用)为专用networking上的其他客户端机器设置防火墙和端口转发。 所以即使在我担心安装一个domU之前,我正在尝试为桥接工作,知道这是我需要的地方。
Xen Networking wiki和Debian Xen wiki都指向我使用Xen的桥接脚本,但是当我这样做时,eth1在启动时不会自动启动,所以dom0无法访问公共networking。 当我手动sudo ifup eth1时,它会出现。 请注意,我甚至不担心domU的问题,而且我很清楚现成的Xen桥接对于eth1 < – > domU不会做任何事情。
此ServerFault问题build议不要使用Xen桥接脚本。 我试过这个configuration,dom0不能访问私有或公共networking。
这个邮件列表线程说,Debian的bridge-utils包应该做我所需要的一切,但是这似乎暗示了如果我想让我的dom0在公共networking上,我必须分配一个地址给真正的eth1以及桥梁。 所以在这种情况下我需要刻录两个公共地址?
/etc/network/interfaces
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth1 allow-hotplug eth1 iface eth1 inet static address 24.123.138.34 netmask 255.255.255.248 network 24.123.138.32 broadcast 24.123.138.39 gateway 24.123.138.33 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 127.0.0.1 dns-search lightyearsoftware.com auto eth1:0 iface eth1:0 inet static address 24.123.138.36 netmask 255.255.255.248 network 24.123.138.32 broadcast 24.123.138.39 gateway 24.123.138.33 # Internal network auto eth0 allow-hotplug eth0 iface eth0 inet static address 192.168.1.1 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 # mtu 9000 # memory alloc failures with 2.6.26-2 e1000 driver #auto br-eth0 br-eth1 #iface br-eth0 inet manual # bridge_ports eth0 #iface br-eth1 inet manual # bridge_ports eth1
/etc/xen/xend-config.sxp在interfaces文件的最后4行未注释时使用(network-script network-dummy) ,否则(network-script network-bridge) 。
我非常乐意提供任何可以帮助的诊断信息。
“Xen Networking wiki和Debian Xen wiki都指向我使用Xen的桥接脚本”
维基的问题是任何白痴都可以编辑它们 – 而且通常是这样。 Debian Xen wiki页面是错误的,所以非常非常错误; 我甚至没有心思去看Xennetworking维基。 在xen-utils软件包的README.Debian曾经有过有用的networking文档,但是他们似乎已经在某个阶段走过了。
我的回答是,在没有在Debian中configurationIP的情况下启动networking接口,对于XEN dom0来说可能不适合你,因为它解决了一个非常不同的问题。 你应该重读这个问题来发现差异。
那个邮件列表线程充满了乱码(和Nabble通常的大脑愚蠢的格式化),所以我不打算试着弄清楚你需要在接口和桥接器上放置一个IP地址,但我可以向你保证,你不需要这样做 – 只要桥上的IP地址就足够了。
修复您的networkingconfiguration的简单方法可能是:
(network-script network-dummy) ,然后chattr +i /etc/xen/xend-config.sxp (阻止你试图摆弄它) br-*节 eth0:1节删除gateway线 /allow_hotplug/d s/eth0/br0/; s/eth1/br1/ bridge_ports eth0添加到您的now- br0configuration中 bridge_ports eth1添加到您的now- br1configuration中 /etc/init.d/networking restart