论野生技术&二次元

Configure IPv6 for OVH dedicated servers

中文版本

OVH gives you a /128 block by default. But in fact you can use the whole /64. You can simply add a /64 address to eth0.
But if you activate IPv6 in docker and try to allocate an address in bridge network, you will find the address is not ping-able. The problem here is we should send a NDP notification to OVH router.

How it works

Configure docker to use IPv6

According to this docker document ,we should append these options to dockerd:

–ipv6 –fixed-cidr-v6=aaaa:bbbb:cccc:dddd:1::/80

If you are an Ubuntu user and upgrade from 14.04 to 16.04, you may be thinking to edit /etc/default/docker. But actually systemd will not read this file at all. Systemd is never wrong. So you may either add these lines to /lib/systemd/system/docker.service:

or create /etc/docker/daemon.json and put:

The latter is recommended.

Configure kernel to forward IPv6

According to docker document,run:

OVH does not use Router Advertisement to allocate IPv6, so we don’t need to touch net.ipv6.conf.eth0.accept_ra.

Configure kernel to proxy NDP

This is needed to tell the OVH router that please let me handle the packet with source or destination equal to this address. Run:

Then set to proxy NDP, the IPv6 address should be container’s IPv6 address.

You may find this annoying to set this every time for a new container. So you can:

  1. Set ndp proxy for aaaa:bbbb:cccc:dddd:1:242:ac11:0 – aaaa:bbbb:cccc:dddd:1:242:ac11:ffff in advance. That’s because docker uses MAC address to configure IPv6 by default, according to this document, docker will only use 02:42:ac:11:00:00 to 02:42:ac:11:ff:ff as MAC address for container.
  2. Install ndppd,create and edit /etc/ndppd.conf:

proxy eth0 {
rule aaaa:bbbb:cccc:dddd:1::/80 {

}
}

退出移动版