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.

I'm running a Lenny Xen dom0 hosting multiple virtual machines in a routed IP setup. To get an additional private subnet, I created the bridge xenbr0 in the dom0 with the following commands:

brctl addbr xenbr0
ifconfig xenbr0 10.0.0.1 netmask 255.255.255.0
ifconfig xenbr0 up

This works as expected, and domU interfaces are added to the bridge by Xen on VM start. My only problem is: how the heck do i specify this configuration in /etc/network/interfaces that it remains permanent and the bridge is available after a reboot? I tried the following config as found on a lot of tutorials:

auto xenbr0
iface xenbr0 inet static
  address 10.0.0.1
  netmask 255.255.255.0
  network 10.0.0.0
  broadcast 10.0.0.255
  bridge_stp no

I get 2 different errors, depending on if the bridge already exists or not. If it doesn't exist:

root@dom0:~# brctl show
bridge name     bridge id               STP enabled     interfaces
root@dom0:~# /etc/init.d/networking restart
Reconfiguring network interfaces...if-up.d/mountnfs[eth0]: waiting for interface xenbr0 before doing NFS mounts (warning).
SIOCSIFADDR: No such device
xenbr0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
xenbr0: ERROR while getting interface flags: No such device
xenbr0: ERROR while getting interface flags: No such device
Failed to bring up xenbr0.
done.

And if it exists:

root@dom0:~# brctl show
bridge name     bridge id               STP enabled     interfaces
xenbr0          8000.000000000000       no
root@dom0:~# /etc/init.d/networking restart
Reconfiguring network interfaces...if-up.d/mountnfs[eth0]: waiting for interface xenbr0 before doing NFS mounts (warning).
RTNETLINK answers: File exists
Failed to bring up xenbr0.
done.

Could anyone point me in the right direction please? The bridge works fine when created manually, i just need the right config file entries. The most tutorials I found add some devices to the bridge in the config, is that maybe the problem why it is not working? I don't have any interfaces I want to add to the bridge on creation as they get added later on VM start...

Thanks, Mathias

share|improve this question
    
Have you checked the Xen mailing list and wiki.xensource.com/xenwiki/XenNetworking ? –  M_1 Jun 14 '10 at 22:37
    
Sure, the setup works as desired. I just need to know how to setup the bridge in /etc/network/interfaces to have it available on a dom0 reboot without having to manually create the bridge over the shell. So it's not a Xen specific problem, but debian-related (I just need to know the right config file syntax). –  Mathias Jun 14 '10 at 23:16
add comment

3 Answers

up vote 3 down vote accepted

You seem to miss the most important line:

auto xenbr0
iface xenbr0 inet static
  bridge_ports eth0 eth4 eth7    # bridge traffic between these interfaces
  bridge_stp no
  address 10.0.0.1
  netmask 255.255.255.0
  network 10.0.0.0
  broadcast 10.0.0.255

man says: If you need to specify the interfaces more flexibly, you can use the following syntax (most useful on a Xen dom0):

     bridge_ports regex (eth|vif).*

This means to evaluate (as in egrep(1)) the expressions that follow after "regex".

share|improve this answer
    
I don't have any ports to bridge when the bridge is created as the only bridged interfaces belong to the VMs which get created later. However, i re-checked my config and noticed that I had 2 "up route add..." entries standing below the bridge config which belonged to the eth0 interface. I also added "bridge_ports none" to the bridge config and now it works :) –  Mathias Jun 16 '10 at 19:59
add comment

How about a script that runs after startup to perform the commands you want?

share|improve this answer
    
Sure, that would be possible, but using debian's built in network scripts would be the cleaner way. –  Mathias Jun 15 '10 at 7:40
add comment

You may have to remove the network-manager packet. It often interferes with manual interface settings.

share|improve this answer
add comment

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.