We currently migrate to MediaWiki from our old installation, but not all content has been migrated yet. Take a look at the Wiki Team page for instructions how to help or browse through our new wiki at wiki.linux-vserver.org to find the information already migrated.

THIS DOCUMENT IS A WORK IN PROGRESS

Goal

Setup Linux-Vserver to use the future Network virtualization for testing purpose. While this new code is higly experimental and not yet integrated in util-vserver, we will have to use some dirty tricks.

Requirements

Prepare the host system

We assume here that you have a working platform running Linux-Vserver 1.9.x with alpha version of util-vserver.

Once those things are done, you can try to boot your system with the newly compiled kernel. If you don't succeed here, try to get some help on the #vserver channel.

Configure util-vserver

We'll have to remove all the network handling of util-vserver and replace it by the vnet stuff. To do that, you will remove (or not add) the interfaces directory in each vserver configuration directory and add some new actions to the vshelper tool. Util-vserver is so kind that you can hook some code for vshelper directly in the configuration of your vserver. We will use this ability to bind some vnet device configuration. This for each vserver, put the following lines in /etc/vservers/<vserver_name>/apps/vshelper/startup:

vnet -x <xid> -n <vnid1> -d lo
vnet -x <xid> -n <vnid2> -d eth0 -D en0
iptables -t vnet -A PREROUTING -d <vserver_ip> -j VNET --vnet <vnid2>
iptables -t vnet -A OUTPUT -s <vserver_ip> -j VNET --vnet <vnid2>

And replace:

Set the executable bit on this flag:

chmod 755 /etc/vservers/<vserver_name>/apps/vshelper/startup

Feel free to enhance this script, it's really a first try. We could take some info in environment/args set by vshelper and compute some uniq ids and then put this script in /etc/vservers/.defaults/apps/vshelper/statup. If you do such a script, please edit this page!

The en0 device of the vserver is bound to eth0 of the host. This really depend on your setup. You may change eth0 by something else if eth0 isn't the network device used for your vservers.

TODO: clean vnids

To be able to setup your network interfaces inside the Vserver you should give it a NET_ADMIN capability. It's easy with util-vserver: just edit /etc/vservers/<vserver_name>/bcapabilities and add a line to this file which is NET_ADMIN.

Configure vserver image

Now, you vserver is started with two devices not configured: lo and en0. It's now the work of the vserver to setup network devices. So you can use scripts provided by the distribution to setup network devices and IPs. Iptables rules allow only some IPs to talk to the network, but you can setup any IPs you want on your vserver devices.