I’ve been googling for some articles and tutorials about IPv6 support in Proxmox VE3, but most of them didn’t explain it clearly, and some of them using language other than English, so, here is some fix for IPv6 inside Proxmox.
Configuring sysctl.conf
1 2 3 4 5 6 7 8 9 10 11 12 |
# nano /etc/sysctl.conf ... net.ipv4.ip_forward = 1 net.ipv6.conf.eth0.autoconf = 0 net.ipv6.conf.eth0.accept_ra = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.all.router_solicitations = 1 net.ipv6.conf.default.forwarding = 1 net.ipv6.conf.all.forwarding = 1 net.ipv6.conf.default.proxy_ndp = 1 net.ipv6.conf.all.proxy_ndp = 1 ... |
To apply the configuration, we can reboot the dedicated server or run # sysctl -p
For the IPv6, let’s assume that we got the following IPv6 allocation :
- Routed IPv6 : 2a02:7900:1:1002::2/64
- Gateway : 2a02:7900:1:1002::1
Add an IPv6 to your OpenVZ container
1 2 3 |
# vzctl stop VEID # vzctl set VEID --ipadd 2a02:7900:1:1002::2:100 --save # vzctl start VEID |
Install radvd for announcing your IPv6 range
1 |
# apt-get install radvd -y |
Configure your /etc/radvd.conf, and we are using our whole IPv6 allocation here, so another IPv6 from our range will be announced.
1 2 3 4 5 6 7 8 9 10 |
interface vmbr0 { AdvSendAdvert on; MinRtrAdvInterval 3; MaxRtrAdvInterval 10; prefix 2a02:7900:1:1002::2/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr on; }; }; |
Configure our /etc/network/interfaces to automatically load the routing when the dedicated server boot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# nano /etc/network/interfaces ... auto lo iface lo inet loopback auto vmbr0 iface vmbr0 inet static address 80.95.29.98 netmask 255.255.255.248 network 80.95.29.96 broadcast 80.95.29.103 gateway 80.95.29.97 bridge_ports eth0 bridge_stp off bridge_fd 0 bridge_maxwait 0 auto eth0 iface eth0 inet manual iface vmbr0 inet6 static address 2a02:7900:1:1002::2 netmask 64 gateway 2a02:7900:1:1002::1 post-up ip -6 neigh add proxy 2a02:7900:1:1002::2:100 dev vmbr0 ... |
Now, we can login to the container or newly created OpenVZ VPS, and have a working IPv6 connection