Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My server is running Ubuntu 10.04 64bit and have 2 NICs, my configuration is one interface for incoming/outgoing traffic of all the KVM guest running on this server, the other interface for different purpose.

I set both NIC card and the virtual bridge with static IP address; here is my /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

and here is my 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

I can not access the internet. I manually delete all the default gw using route del and add only 1 default gw for the device eth0 to access the internet

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

The problem is when I reboot the server I manually run the route del command again and if I delete the default gw of eth1 in /etc/network/interface all the guest host can not access the internet.

Please help me how to configure that way

share|improve this question
    
Whoa that's one weird configuration... probably not what you were looking for. –  Chris S Feb 18 '11 at 13:37

1 Answer 1

up vote 10 down vote accepted

Edit /etc/network/interface and remove all but one of the gateway statements.

share|improve this answer
    
+1. Also, the config for eth1 appears to be inconsistent. On second thought, eth1 should probably be left unconfigured, since it is slaved to bridge br0. –  Steven Monday Nov 3 '10 at 5:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.