[Pkg-xen-devel] bridging and peth0

Ralph Passgang ralph at debianbase.de
Sun Jul 15 10:45:09 UTC 2007

Am Sonntag, 15. Juli 2007 06:13:19 schrieb Andy Smith:
> Hi,

Hi Andy,

> If one sets xend to use network-bridge and there are no bridges
> already present then it seems that xend will clone eth0 to peth0,
> create xenbr0 and add peth0 and vif0.0 as ports on that bridge.
> If on the other hand xenbr0 is created in /etc/network/interfaces
> then xend will not do any of that peth0 stuff, nor will it add
> vif0.0 to xenbr0, yet (barring some changes in iptables rules)
> things still seem to work.
> So my questions are:
> 1) What is the actual purpose of this cloning of eth0 to peth0?

The interface is not cloned. It's renamed to peth0. 
This is the xen way of setting up a bridge, The difference is, that if eth0 is 
renamed to peth0, then the interface with the name eth0 is not present 
anymore and can be used for a virtual interface. Xen exactly does this by 
setting up a new (virtual) eth0 interface, which should be used from within 
dom0. But this eth0 is not a simple clone of peth0 (or the other way around).

A quite good overview over networking in xen can be found on:

> 2) Is creating the bridge in /etc/network/interfaces the preferred
>    Debian way?

Hmmm, depends... I am even not sure how other xen developers thing of this. So 
if someone has another oppionion, please comment my statement!

The interface file is the preferred way of handling networking stuff in 
debian, for sure.

On the other hand the xen default is to use the /etc/xen/xend-config.sxp + 
various scripts in /etc/xen/scripts to set the networking.

You can use both methods within debian, but if you don't use the xen default 
way, then you might need deeper knowledge of xen networking to build a 
interface configuration file that does everything correctly for having a 
bridged xen setup. If you can manage that, feel free to use the interface 
file for configuring your xen network stuff.

I personally prefer to use the xen way, because it's very easy to setup and I 
think the xen packages doesn't really help you to use the interface file, 
because there is no example configuration or something like that.

> 2a) If so, does the peth0 thing need to be done somehow too?

No, you don't need to rename eth0 to peth0, but (as explained above or visible 
in the xen networking wiki) it might be clever. You should use the pysical 
eth0 interface directly in a bridged xen setup, because the packets should 
also be sent over the bridge. So if you don't rename eth0, then you should be 
at least sure, that everything (routing, listening sockets, etc.) goes over 
the bridge and not directly over the physical interface.

> 2b) And should vif0.0 be added to the bridge?  Various guides I have
>     seen for Debian and Xen only add eth0.

vif0.0 passes the traffic to your "eth0" interface, which is not the physical 
interface, but a virtual one. If you don't add vif0.0 to your bridge, your 
virtual eth0 interface will not get traffic that comes from the bridge. For 
the default xen-way you definitly need vif0.0 in your bridge.

> Cheers,
> Andy


More information about the Pkg-xen-devel mailing list