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.

running the root server with chbind'ed ip address

create following under /sbin/vinit (add the ip's you want)

#!/bin/sh
exec /sbin/chbind --ip 10.20.20.10/16 --bcast 10.20.255.255 -- /sbin/init $@

chmod +x /sbin/vinit

and then add init=/sbin/vinit to the kernel boot options (append= with Lilo)

Note: now the loopback interface on 127.0.0.1 is inaccessible from the root server. A workaround is to use the outside interfaces address in /etc/hosts instead 127.0.0.1 so:

10.20.20.10 localhost

instead

127.0.0.1 localhost

You might alter the firewall rules to allow traffic which orginates locally too.

configuring a 32 bit guest under x86_64

echo linux_32bit > /etc/vservers/$NAME/personality

echo i686 > /etc/vservers/$NAME/uts/machine

Changing the mask of the network interface

I had a vserver running perfectly on one host and no access on the network on another.

bonbons on IRC proposed me to put the same mask on the interface in the vserver and the host.

To see your current mask from the host:

root@thehost:/etc/vservers# ip addr list
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:0e:0c:32:e8:92 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:0c:f1:ad:0f:d8 brd ff:ff:ff:ff:ff:ff
    inet 130.225.64.85/24 brd 130.225.255.255 scope global eth1
    inet 130.225.64.84/32 scope global eth1
    inet6 fe80::20c:f1ff:fead:fd8/64 scope link
       valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:0c:f1:ad:0f:d9 brd ff:ff:ff:ff:ff:ff
5: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0

So you can see the mask before changing on eth1: 130.225.64.85/24 and 130.225.64.84/32

To change the mask I created the file: /etc/vservers/my-vserver/interfaces/0/prefix and put 24 in it.

Restart the vserver, enjoy...

configuring routing for a server with two network interfaces

If your physical server has two or more network interfaces you have to setup correct routing.

Packets must leave on the same interface on which they are received.

The following configuration on Debian/Ubuntu /etc/network/interfaces sets up two additional routing tables and two rules to route packets from different subnets through the correct interfaces.

# The primary network interface
auto eth0
iface eth0 inet static
        address 10.10.64.16
        netmask 255.255.255.0
        network 10.10.64.0
        broadcast 10.10.64.255
        gateway 10.10.64.1
        up /bin/ip route add 10.10.64.0/24 dev eth0 src 10.10.64.16 table 64
        up /bin/ip route add default via 10.10.64.1 table 64
        up /bin/ip rule add from 10.10.64.0/24 table 64
        post-down /bin/ip rule delete from 10.10.64.0/24 table 64

auto eth1
iface eth1 inet static
        address 10.10.68.61
        netmask 255.255.255.0
        network 10.10.68.0
        broadcast 10.10.68.255
        up /bin/ip route add 10.10.68.0/24 dev eth1 src 10.10.68.61 table 68
        up /bin/ip route add default via 10.10.68.1 table 68
        up /bin/ip rule add from 10.10.68.0/24 table 68
        post-down /bin/ip rule delete from 10.10.68.0/24 table 68