Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Ubuntu 10.04 server with 2 public static addresses. There is a KVM guest (also Ubuntu) installed and running. What i want is to give the guest an IP of the host, so that both machines have public IPs.

When i create a bridge for the guest, add interfaces to the bridge then the host loses connectivity but the guest begins to be able to ping from outside.

What should i do to have connection for host and guest ?

This is network conf:

# ifconfig -a
br0       Link encap:Ethernet  Hardware Adresse ee:29:4b:xx:xx:xx  
          BROADCAST MULTICAST  MTU:1500  Metrik:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  Hardware Adresse 00:1a:4b:xx:xx:xx  
          inet  Bcast:  Maske:
          inet6-Adresse: fe80::21a:4bff:fe46:eca4/64 Gültigkeitsbereich:Verbindung
          RX packets:16101 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13577 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000 
          RX bytes:6470077 (6.4 MB)  TX bytes:2058971 (2.0 MB)

eth0:0    Link encap:Ethernet  Hardware Adresse 00:1a:4b:46:ec:a4  
          inet  Bcast:  Maske:

# route
Ziel            Router          Genmask         Flags Metric Ref    Use Iface   *        U     0      0        0 eth0
link-local      *          U     1000   0        0 eth0
default         UG    100    0        0 eth0

# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.000000000000       no              eth0

There is no firewall enabled and DNS is configured properly.

What I want to achieve:

     |                         |            
|    |          Host           |        |   
|    |                         |        |   
|    |            +------------+------+ |
|  eth0           |          eth0:0   | | 
|  x.x.x.100      |                   | |          
|                 |                   | |          
|                 |  br0     vnet0    | | 
|                 +------------+------+ |
|                              |        |   
|                              |        |   
|                 +------------+------+ |
|                 |            |      | |   
|                 |       eth0-+      | |
|                 |       x.x.x.101   | |
|                 |                   | |          
|                 |       Guest       | |
|                 +-------------------+ |
share|improve this question
why do you want to use an alias interface ? these are obsolete since iproute2, and have various quirks that may cause problems in this case. – b0fh Aug 7 '10 at 23:12
Since i have only one interface and 2 IP addresses, i thought it is the proper way to assign multiple IP addresses. Various guides from debian and ubuntu also say so. If you know a better way, please elaborate. – Lamnk Aug 13 '10 at 13:14
up vote 2 down vote accepted

I'm not sure if it's required, but this works for me:

  • eth0-on-the-host: no ip on host, added to bridge
  • vnet0: no ip on host, added to bridge
  • bridge: ip of the host
  • eth0-in-the-guest: ip of the guest

Note that most documentation suggests bringing the physical interface up with ip after attaching it to the bridge.

share|improve this answer
Thanks, it worked. I tried your solution before but I was stuck adding gateway with this command "route add default gw xxx". It should be "route add default gw xxx dev br0". – Lamnk Aug 13 '10 at 13:36

Your Answer


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.