This is an old revision of the document!
By default, when you get 2 DomUs running, they both get an interface frontend within the domU (usualy called “eth0”), and an interface backend in the dom0 (usualy called vifX.0 – X is the dom id, and 0 is the interface number for that domU).
.---------------. .--------------------. | Dom0 | | DomU: foo | |---------------| |--------------------| | .---------. .--------. | | | vifX.0 |<-----| eth0 | | | '---------' '--------' | | | '--------------------' | .---------. '------| vifY.0 | .--------------------. '---------' | DomU: bar | ^ |--------------------| | .--------. | '-----------| eth0 | | '--------' | '--------------------'
To avoid having too much network configuration each time you start/stop a domU, the easiest way is to have a bridge ready on the dom0, and use some script to add the backend interface to.
When /etc/init.d/xen
starts, it runs the configured
network-script
. The configuration is made in
/etc/xen/xend-config.sxp
, script is searched in
/etc/xen/scripts
.
That network script is supposed to do an initial setup for the incoming
domUs network backends. Prepare to forward, create the bridges, and
whatever else you need. Most could be done directly in the rest of your
system (/etc/network/interfaces
, /etc/sysctl.conf
, and your
firewall configuration)
When a new backend is presented, the kernel will create the interface,
and xen will run the configured vif-script
. That script should do
what's necessary to get your interface usable. It's really like if you
inserted a new network card, with a cable already plugged to a single
remote host.
As you may have multiple of such, and usualy don't want starting/stopping your domUs messing with your dom0 network configuration, stable bridges, and simply having the domU plugging itself to it, bridge seems the easiest way.