bil*_*duc 3 ubuntu routing nic kvm-virtualization
我的服务器运行 Ubuntu 10.04 64 位并有 2 个 NIC,我的配置是一个接口用于在该服务器上运行的所有 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
Run Code Online (Sandbox Code Playgroud)
这是我的 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
Run Code Online (Sandbox Code Playgroud)
我无法访问互联网。我手动删除了所有使用的默认 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
Run Code Online (Sandbox Code Playgroud)
问题是当我重新启动服务器时,我route del
再次手动运行该命令,如果我删除了/etc/network/interface
所有来宾主机中 eth1 的默认网关,则无法访问互联网。
请帮我如何配置
归档时间: |
|
查看次数: |
5406 次 |
最近记录: |