Prerequisite : You have Xen running correctly for less than 3 virtual interfaces. This HOWTO explains how to get it to work on Ubuntu Edgy.
Xen does not support using more than 3 virtual interfaces on the guest machines (the so-called DomU). It is stated in the Xen FAQ, and attempting to use more resultsĀ in what Ernie Fontes experienced in this post.
The usual trick for having more interfaces in a stand-alone system is to use IP Aliasing. Ubuntu Linux, among others, support IP Aliasing without any problem. However, IP Aliasing seems not to work (according to my tests) for a Xen DomU.
For some reason that I cannot explain nor understand, there is still a way to use more than 3 virtual interfaces in a Xen DomU by using the offical Xen way of adding interfaces, and by using IP Aliasing on top of that. It is weird, but it works :
- using Xen virtual interfaces is limited to 3 interfaces.
- using IP aliasing interfaces makes interfaces that are not pingable from the outside
- BUT using exactly 3 Xen virtual interfaces, and adding more interfaces thanks to IP Aliasing works beautifully….
Here is a quick HOWTO explaining this procedure :
Xen Configuration
Add 3 interfaces for the DomU (you might replace xenbr1 by xenbr0 if your bridge name is the standard one) :
vif = [ 'bridge=xenbr1','bridge=xenbr1','bridge=xenbr1' ]
And you can create your domain using the usual xm create command.
xm create config.cfg
xm console
DomU Network configuration
You can now configure your domain interfaces and the aliases. For the sake of giving a complete example, here is how to achieve that under Debian/Ubuntu :
Let’s say that we want to configure the 216.240.153.78, 216.240.138.247, 216.240.146.76 IPs for, respectively, eth0, eth1 and eth2, and 216.240.134.6 as well as 216.240.128.182 for the 2 aliases eth0:0 and eth0:1.
/etc/network/interfaces
auto eth0
iface eth0 inet static
address 216.240.153.78
netmask 255.255.255.0
gateway 216.240.153.1auto eth1
iface eth1 inet static
address 216.240.138.247
netmask 255.255.255.0
gateway 216.240.138.1auto eth2
iface eth2 inet static
address 216.240.146.76
netmask 255.255.255.0
gateway 216.240.146.1auto eth0:0
iface eth0:0 inet static
address 216.240.134.6
netmask 255.255.255.0
gateway 216.240.134.1auto eth0:1
iface eth0:1 inet static
address 216.240.128.182
netmask 255.255.255.0
gateway 216.240.128.1
You can now tell the system to reconfigure the network (/etc/init.d/networking restart), and if it still doesn’t work (especially for the aliases), you can restart the DomU (xm reboot domU-name).
Now, if someone has an idea of why this tip works, I am really really interested to know. Because right now, it looks like magical stuff that I’m not even sure of how I discovered
Sami,
I’m not sure if you’ll even respond to this but is there any way you can help me out with setting a basic bridged network with Xen? I’m having a very difficult time trying to find the resources to get this accomplished.
My e-mail is bpark@dolda2000.com.
Thank you.
-Bruce
[...] In a recent post, Ian lists the current limitations of Xen 3.0. Nice work ! Definitely Useful, but I would just like to add that there is a trick that I previously described, to circumvent the 3 network interfaces limit. [...]
Adding secondary IPs (what you probably mean with ip aliasing) works without any problems both on Xen 2 and Xen 3. If you did not get it working, you must have made some mistake.
Are you still using the old eth0, eth0:1, eth0:2 notation? If so, try to use “ip addr add 1.2.3.4/32 dev eth0″ instead.
[...] * http://www.dalouche.com/wordpress/2006/11/26/howto-use-more-than-3-virtual-interfaces-with-xen-by-us... [...]
HOWTO: Use more than 3 virtual interfaces with Xen (by using IP Aliasing)…
Xen does not support using more than 3 virtual interfaces on the guest machines (the so-called DomU). It is stated in the Xen FAQ, and attempting to use more results in what Ernie Fontes experienced in this post. The usual trick for having more interfa…