我的服务器运行Ubuntu 10.04 64位,并有2个网卡,我的configuration是一个接口,用于在此服务器上运行的所有KVM客户端的传入/传出通信,另一个接口用于不同的目的。
我用静态IP地址设置了网卡和虚拟网桥; 这里是我的/etc/network/interface
# The primary network interface auto eth0 iface eth0 inet static address 192.168.5.10 netmask 255.255.255.0 network 192.168.5.0 broadcast 192.168.5.255 gateway 192.168.5.5 auto eth1 iface eth1 inet static address 192.168.5.12 netmask 255.255.255.0 network 192.168.3.0 broadcast 192.168.3.255 gateway 192.168.5.5 auto br0 iface br0 inet static address 192.168.5.11 netmask 255.255.255.0 network 192.168.5.0 broadcast 192.168.5.255 gateway 192.168.5.5 bridge_ports eth1 bridge_stp off bridge_fd 0 bridge_maxwait 0
这是我的netstat -nr output
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 br0 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 0.0.0.0 192.168.5.5 0.0.0.0 UG 0 0 0 eth1 0.0.0.0 192.168.5.5 0.0.0.0 UG 0 0 0 br0 0.0.0.0 192.168.5.5 0.0.0.0 UG 0 0 0 eth0
我无法访问互联网。 我手动删除所有默认的gw使用route del和添加设备eth0访问互联网只有1默认gw
192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 br0 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 0.0.0.0 192.168.5.5 0.0.0.0 UG 0 0 0 eth0
问题是当我重新启动服务器时,我再次手动运行route del命令,如果删除/etc/network/interface的默认gw eth1,则所有guest虚拟机都无法访问Internet。
请帮助我如何configuration这种方式
编辑/etc/network/interface并除去其中一个gateway语句。