1

Fresh install of Ubuntu 12.04 LTS with libvert/KVM installed. I have 2 virtual machines that I need need to be on the same LAN as the host. The host has two physical interfaces eth0 and eth1. eth1 is not in use. I would like eth0 to have a static assigned IP and act as a bridge for my VM's.

Prior to setting up the bridge my /etc/network/interfaces looks like:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 10.0.5.5
    netmask 255.255.255.0
    gateway 10.0.5.254
    dns-nameservers 10.0.5.1

Everything works as expected under this configuration. However, When I apply the below captioned configuration:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br0
iface br0 inet static
    address 10.0.5.5
    netmask 255.255.255.0
    gateway 10.0.5.254
    dns-nameservers 10.0.5.1
    bridge_ports eth0
    bridge_stp off
    bridge_maxwait 0
    bridge_fd 0

Under this configuration I can ping internal hosts by IP and name. Name resolution works as expected. Attempting to ping an external hosts yields "No route to host."

Here is ifconfig -a after the bridge configuration is applied.

br0       Link encap:Ethernet  HWaddr 00:25:90:da:29:8f  
          inet addr:10.0.5.5  Bcast:10.0.5.255  Mask:255.255.255.0
          inet6 addr: fe80::225:90ff:feda:298f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11569 errors:0 dropped:0 overruns:0 frame:0
          TX packets:586 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1433248 (1.4 MB)  TX bytes:63079 (63.0 KB)

eth0      Link encap:Ethernet  HWaddr 00:25:90:da:29:8f  
          inet addr:10.0.5.107  Bcast:10.0.5.255  Mask:255.255.255.0
          inet6 addr: fe80::225:90ff:feda:298f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13632 errors:0 dropped:122 overruns:0 frame:0
          TX packets:1240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2008747 (2.0 MB)  TX bytes:119540 (119.5 KB)
          Interrupt:20 Memory:dfa00000-dfa20000 

eth1      Link encap:Ethernet  HWaddr 00:25:90:da:29:8e  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16 Memory:df900000-df920000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:745 errors:0 dropped:0 overruns:0 frame:0
          TX packets:745 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:66095 (66.0 KB)  TX bytes:66095 (66.0 KB)

virbr0    Link encap:Ethernet  HWaddr c2:dd:f8:44:eb:2d  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Ultimately, I want eth0 to have static 10.0.5.5 and put both of my VM's on this interface with statically assigned 10.0.5.6-7. What is wrong with my configuration?

  • 1
    What is the output of ip route ls? – Mark Wagner Jan 28 '14 at 19:38
  • default via 10.0.5.254 dev eth0 proto static default via 10.0.5.254 dev br0 metric 100 10.0.5.0/24 dev br0 proto kernel scope link src 10.0.5.5 10.0.5.0/24 dev eth0 proto kernel scope link src 10.0.5.107 metric 1 169.254.0.0/16 dev br0 scope link metric 1000 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 – sardean Jan 28 '14 at 19:44
  • Why would eth0 have ip address 10.0.5.107? – Mark Wagner Jan 28 '14 at 20:18
  • @MarkWagner - I haven't the slightest clue. I don't understand where that address is coming from. I presume its DHCP assigned although it shouldn't be. What should the IP config look like on the physical interface eth0 when it is a bridge port? – sardean Jan 28 '14 at 20:45
  • 1
    Is networkmanager installed? – sciurus Jan 28 '14 at 22:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.