Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a server with 4 public IP's. I have it with this configuration and I want to bridge the interface eth0 for using it with KVM:

So, I have 3 IP's (A.B.C.144, A.B.C.145, A.B.C.146) and another interface with the main IP that I want to bridge (188.165.X.Y)

/etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 188.165.X.Y
    netmask 255.255.255.0
    network 188.165.255.0
    broadcast 188.165.255.255
    gateway 188.165.255.254

# KVM Bridge
auto br0
iface br0 inet static
    address 188.165.X.Y
    netmask 255.255.255.0
    network 188.165.255.0
    broadcast 188.165.255.255
    gateway 188.165.255.254
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

auto eth0:0
iface eth0:0 inet static
    address A.B.C.145
    netmask 255.255.255.255

auto eth0:1
iface eth0:1 inet static
    address A.B.C.146
    netmask 255.255.255.255

auto eth0:2
iface eth0:2 inet static
    address A.B.C.147
    netmask 255.255.255.255

Everything (eth0, eth0:0: eth0:1, eth0:2) is working fine except the bridge (br0). But, If I do:

ifup br0

I lose the connection and I have to restore configuration without br0.

What should I do?

With @Ulrich configuration:

device eth0 entered promiscuous mode
e1000e 0000:00:19.0: irq 43 for MSI/MSI-X
e1000e 0000:00:19.0: irq 43 for MSI/MSI-X
ADDRCONF(NETDEV_UP): eth0: link is not ready
ADDRCONF(NETDEV_UP): br0: link is not ready
e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
e1000e 0000:00:19.0: eth0: 10/100 speed: disabling TSO
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
br0: port 1(eth0) entering forwarding state
br0: port 1(eth0) entering forwarding state
ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you really want to bridge eth0 with your kvm guests you should only configure your stuff via your bridge e.g:

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
    address 188.165.X.Y
    netmask 255.255.255.0
    network 188.165.255.0
    broadcast 188.165.255.255
    gateway 188.165.255.254
    bridge_ports eth0
    bridge_fd 9
    bridge_hello 2
    bridge_maxage 12
    bridge_stp off

If you don't want to bridge but just create a router (this depends on your network setup) you would have to create a bridge without any ports in your /etc/network/interface and create the appropriate routing entries. libvirt can create a correct bridge but the bridge will have to have an extra ip.

share|improve this answer
    
And the eth0:0 eth0:1 eth0:2 also because there are difference ip. Right? –  JavierMartinez Jun 26 '12 at 16:12
    
I did it and I lost the connection again. In my question I have just pasted the dmsg code –  JavierMartinez Jun 26 '12 at 16:21
    
@JavierMartinez what do you mean with you lost the connection? If you use this and activate the changes your new network device will be br0 instead of eth0 with a different mac address. You also have to deconfigure eth0, try to reboot the system. If this is a remote system where you don't have access to a rescue system you can run a script after some time with at which resets your configuration –  Ulrich Dangel Jun 26 '12 at 16:55
    
Yes, it is a remote system. I mean that if I use your configuration , when I do reboot I can't access to the server again without restore my previous configuration –  JavierMartinez Jun 26 '12 at 17:12
    
@JavierMartinez is there maybe some kind of port security or port pinning enabled? anyway just setup bridge for the virtual machines themselves and don't bridge it to the network. Another problem may be caused due to some restrictive firewall rules on your server? –  Ulrich Dangel Jun 26 '12 at 17:20
show 4 more comments

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.