Many of you have probably used OpenVZ and got very angry at the fact that out the box, the ipv6 support is there, but difficult, hidden and badly documented. Well one of the most common compliants is that getting ipv6 working on the host is easy, but getting it to work inside the containers is a different story.
For this how to, i’ll be assuming you have already configured your ipv6 tunnel on the OpenVZ host, and that you have a suitable prefix assigned, e.g. a /64.
Firstly, you have to run a few commands and depending on your installation, these may or may not already be set.
# echo 1 > /proc/sys/net/ipv6/conf/all/proxy_ndp
# sysctl -w net.ipv6.conf.all.forwarding=1
These basically enable ipv6 to travel to and from containers without problems. Note, after a reboot these will need to be set again, however they can be set permanently also. This configuration will work for all containers.
Finally, to add an address to a specific container run the following (replacing
# vzctl set
# ip -6 neigh add proxy 2001:630:c2:YYYY::XXXX dev eth0
The first line add’s the address inside the container (note: do not try to add an address manually inside the container… it won’t work). The second line basically makes the host os aware of this address (not always needed, but no harm done).
After this you should be able to communicate to and from the host to anywhere using the ipv6 address you just assigned! Good Luck!