Skip to content

Instantly share code, notes, and snippets.

@eraserewind
Last active October 24, 2021 03:47
Show Gist options
  • Save eraserewind/85f54668f6c3d80a7d40 to your computer and use it in GitHub Desktop.
Save eraserewind/85f54668f6c3d80a7d40 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 dhclient -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

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

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