Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save olivierlambert/95563a225101268b16af to your computer and use it in GitHub Desktop.
Save olivierlambert/95563a225101268b16af to your computer and use it in GitHub Desktop.
Online.net: IPv6 in Debian virtual machines

Online.net: IPv6 in Debian virtual machines

Without this annoying dribbler thing.

Variables

  • RANGE = /64
  • EXT_IF = external interface
  • IPV6 = Any IPv6 in RANGE
  • DUID = dhcp client id. Find it in console.online.net

Procedure

Add to /etc/network/interfaces

iface EXT_IF inet6 static
  address IPV6
  netmask 64
  accept_ra 1
  pre-up sleep 5 # because dhclient will fail if called too early
  # -1 parameter to avoid infinite fail
  pre-up dhclient -1 -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.EXT_IF.pid -6 -P EXT_IF
  pre-down dhclient -x -pf /run/dhclient6.EXT_IF.pid

Create /etc/dhcp/dhclient6.conf

With a timeout to avoid infinite fail:

interface "EXT_IF" {
  send dhcp6.client-id DUID;
  request;
  timeout 10;
}

Apply

With networking restart: ifdown EXT_IF && ifup EXT_IF

Without:

sysctl net.ipv6.conf.EXT_IF.accept_ra=1
sysctl net.ipv6.conf.EXT_IF.autoconf=0
dhclient -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.EXT_IF.pid -6 -P EXT_IF
ifconfig EXT_IF inet6 add IPV6/64

Bonus: add moar IPs

In /etc/network/interfaces, in the "iface EXT_IF inet6 static" section:

  up ifconfig eth0 inet6 add ANOTHER_IPV6/64
  down ifconfig eth0 inet6 del ANOTHER_IPV6/64

Source

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