IPv6 in LXC at OVH

Route IPv6 addresses to your linux containers (LXC) at OVH.

First make sure you have IPv6 running on the host, newer OVH hosts should have this activated by default.

Allow IPv6 forwarding and proxy ndp, edit /etc/sysctl.conf:

net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.proxy_ndp = 1

Now install an neighbor proxy daemon on your host to do IPv6 neighbor solicitations automatically. Download npd6 from https://code.google.com/p/npd6/, you may build a Debian package for Wheezy, see https://code.google.com/p/npd6/wiki/Building_npd6Example.
Building npd6 1.0 for amd64 on Debian Wheezy:

apt-get install make svnversion gcc debuild build-essential dpkg-buildpackage pdebuild-cross cdbs quilt
wget http://npd6.googlecode.com/files/npd6-1.0.0.tar.gz
tar xzf npd6-1.0.0.tar.gz 
cd npd6-1.0.0
make debian
cd ..
dpkg -i npd6_1.0.0_amd64.deb

Now edit /etc/npd6.conf (see /etc/npd6.conf.sample for an example):

// The prefix portion that we will match on
//prefix=2a01:0123:4567:89aa:
prefix=2001:41d0:x:xxxx:

// Which interface are we monitoring and using?
interface = br0

Now start ndp6 with “/etc/init.d/ndp6 start”. See “man npd6” for help.

Set an IPv6 address in your LXC config, gateway in my case the br0 interface on the host:

lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.ipv6 = 2001:41d0:x:xxxx::10/64
lxc.network.ipv6.gateway = 2001:41d0:x:xxxx::2

Network interface config /etc/network/interfaces inside LXC:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet6 manual

DNS config /etc/resolv.conf inside LXC:

nameserver 127.0.0.1
nameserver 2001:41d0:3:163::1
search ovh.net

More info:
http://help.ovh.com/Ipv4Ipv6
http://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol

Advertisements