Networking and Bridges and such

Searching the internet for solutions for the strangeness created by xen’s networking solution really comes up with snippets from email chains or highly over complicated network diagrams, why? i’m not entirely sure. The default method for networking with Xen consists of a collection of ‘pokey’ scripts that seem to get (at least on my system) 90% of the way there.  I assume this again may be a ‘Gentoo’ issue however here are the steps (From a simplistic view) that are taken to create Xen networking:

  1. Original system consisted of eth0 and lo, eth0 has an ip of 10.0.0.1 etc.
  2. Once the system comes up and xen starts its scripts using brctl create a network bridge, this is then used to bridge the physical interface (currently still eth0 and virtual interfaces, called vifs)
  3. xend, the xen daemon uses brctl to create a bridge called xenbr0 then things get a bit random.
  4. eth0 is renamed peth0 (peth = phystical ethernet)
  5. The ip information is taken from peth0 and peth0 is then added to xenbr0
  6. Once the peth0 is added to xenbr0 the ip information is taken from peth0 and applied to xenbr0
  7. Any xen domU that is created afterwards creates a vif which it uses, this vif is then added to the xenbr0 allowing it to communicate on the network

This is a very sparse/dumbed down version of events, however it gives an idea of whats happening. The problem that occured with Gentoo is that step 5. never happens.

What this results in is that Gentoo comes up, brings eth0 up and we have network activity for a few seconds until xen starts to get it’s claws into the network configuration. However the most simple method for repairing this involves a small configuration change in /etc/conf.d/local.start

# 00/00/00 -- IP Allocation to Xenbr0
ifconfig xenbr0 10.0.0.1 netmask 255.255.255.0
route add default gw 10.0.0.254

This is an example taken from mine, you’ll need to alter the gateway and ip address information, but put simply this will execute after every other service has been started, resulting on your domO being visible and network aware etc…

One thought on “Networking and Bridges and such”

  1. Hi,

    I found your post while looking for a solution to the same problem, amongst the same email chains and complicated diagrams.

    I’d discovered a similar approach but by different means, of copying the details of config_eth0 to config_xenbr0 in /etc/conf.d/net and setting RC_PLUG_SERVICES=”net.xenbr0 !net.*” in /etc/conf.d/rc

    You get networking when Xend starts. However you end up with dom0 visible to it’s ether peers as FE:FF:FF:FF:FF:FF, rather than the real MAC address of [p]eth0. Which is a bit messy and limits you to one dom0 per ethernet segment.

    Have you come across any revelations to Gentoo and Xen’s networking quarrel?

Leave a Reply

Your email address will not be published. Required fields are marked *