Skip to content

Instantly share code, notes, and snippets.

@soakes
Forked from DonSYS91/ipv6_proxmox_online.net.md
Created March 15, 2022 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soakes/19f03c6b3fe6596777994557aada3494 to your computer and use it in GitHub Desktop.
Save soakes/19f03c6b3fe6596777994557aada3494 to your computer and use it in GitHub Desktop.
Configuring IPv6 block from Online.net On Proxmox Host and Guests

Configuring IPv6 block from Online.net On Proxmox Host and Guests

Following the documentation on online.net would get IPv6 to work only in a simple system installation but won't get IPv6 to work with virtualization environment (Exp. Proxmox) as It's missing some IPv6 forwards and proxies on sysctl.conf.

On Proxmox Host (Or Debian if single Debian Installation)

Enable IPv6 on the System:

  • Change Module Options to Enable IPv6:

In the following file:

/etc/modprobe.d/local.conf

enable IPv6 by changing the 1 to 0:

options ipv6 disable=0
  • Load IPv6 Kernel Module at the boot: Edit the following file:
/etc/modules

Add ipv6:

ipv6
  • Reboot the server to load IPv6 Modules

Now the system has IPv6 modules loaded and enabled, we need to configure and allow IPv6 forwarding.

Note: You can skip this step if you have simple Debian installation without Virtualization.

  • Enable Forwarding by adding them into the system variables:

Edit the system variables file:

/etc/sysctl.conf

Disable autoconf for ipv6 on interface vmbr0, enable forwards on default interface and all other interfaces, enable NDP proxy on default and all interfaces, as the following:

net.ipv6.conf.vmbr0.autoconf = 0
net.ipv6.conf.vmbr0.accept_ra = 2

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

Read the new system variables, by executing the command:

sysctl -p

At this point we enabled IPv6 on the system by loading the required modules, and enabling forwarding and ndp proxy on the host, so that our guest machines can obtain IPv6 addresses from the host.

Configuring the IPv6 Client

We will use the default DHCP client to issue and get the IP Block from the router using DUID given in online.net console.

Edit or create the following file if not exists:

/etc/dhcp/dhclient6.conf

Add the following lines:

interface "vmbr0" {
   send dhcp6.client-id DUID;
}

Where vmbr0 represents the main interface, and DUID obtained from Online.net IPv6 Panel.

Configuring Interfaces file to add IPv6 address and run the dhclient6

Edit the interfaces file:

/etc/network/interfaces

And add the following lines:

iface vmbr0 inet6 static
    address YOUR_IPv6
    netmask YOUR_SUBNET
    accept_ra 1
    pre-up dhclient -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.vmbr0.pid -v -nw -6 -P vmbr0
    pre-down dhclient -x -pf /run/dhclient6.vmbr0.pid

Note: YOUR-IPv6 is the created subnet from online.net IPv6 panel, for example:

iface vmbr0 inet6 static
    address 2001:bc8:50ca:101::1
    netmask 64
  • Reboot the server, and your server should get IPv6 address now.

IPv6 On Proxmox Container:

  • On Proxmox GUI, create new network device, use vmbr0 as bridge.
  • Enter the desired IPv6 from your IPv6 block but not the one that's taken from host (Exp. 2001:bc8:50ca:101::2/64)
  • Enter the IPv6 of the host as gateway (2001:bc8:50ca:101::1).
  • Enter DNS server, exp. Google Public DNS: 2001:4860:4860::8888 and 2001:4860:4860::8844

After Rebooting the container it should have an IPv6 connectivity and connection to the internet.

IPv6 On Proxmox VM:

  • On Proxmox GUI, from Hardware windows edit the current IPv4 network device to IPv6 to it (only if it uses vmbr0 as Bridge, if it's on other bridge then create new network device).
  • Start the VM
  • Edit the interfaces file on the VM, /etc/network/interfaces
  • Add IPv6:
iface ens18 inet6 static
        address 2001:bc8:50ca:101::3
        netmask 64
  • restart the networking service networking restart or reboot the VM.

Known Problems:

  • The host loses IPv6 address after rebooting or after some time (an hour). checking the interface IPs:
ip a show vmbr0

If you notice that inet6 where our IPv6 is assigned is gone, then you have this problem, to fix the issue temporary, issue new IP:

ip -6 a a 2001:bc8:50ca:101::1/64 dev vmbr0

Now test the Connectivity:

ping6 ipv6.google.com

Note: that you need to do this everytime you restart the host.

The reason for this problem, may be due to this line in /etc/network/interfaces:

iface vmbr0 inet6 static
    address 2001:bc8:50ca:101::1
    netmask 64
    accept_ra 1
    pre-up dhclient -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.vmbr0.pid -v -nw -6 -P vmbr0
    pre-down dhclient -x -pf /run/dhclient6.vmbr0.pid

The system is trying to assign IPv6 but the pre-up phase hasn't been touched yet (timing problem), the pre-up line should be finished so the system can pull the IPv6 block from the router.

Still Investigating the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment