Department of Defense
High Performance Computing Modernization Program

The following guide explains the steps involved with enabling IPv6 on Debian Linux. Ubuntu is based very closely on Debian, so these directions should work as well for Ubuntu systems, but have not been tested. The ipv6 module is loaded by default in Debian 2.6.x and later and in Ubuntu 6.10 and later, (so (1) and (2) below should not be necessary on these systems). To see if you already have an IPv6 address type:


Considerations: If you depend on iptables for securing the system make sure to appropriately apply ip6tables rules. See link at end of this article.

To get to root on Ubuntu type sudu -H -s and your user password. To get root on Debian type su and your root password.

1) Make sure you have the proper ipv6 support packages installed:

apt-get install iproute iputils-ping iputils-tracepath

Other ipv6 related packages can be found by searching:

apt-cache search ipv6

Read `man 8 apt-get` for documentation on using apt-get.

2) Test to see that the ipv6 kernel module is loaded:

lsmod |grep ipv6

2.a) If the module is not loaded:

modprobe ipv6

2.b) Add ipv6 to /etc/modules to have the module load at boot time. Read ‘man 5 modules’ for documentation on this file’s format.

3) By default, an IPv6 address is configured in Debian using StateLess Address AutoConfiguration (SLAAC). Prior to version 12.04 of Ubuntu, SLAAC was also the default. Then privacy addressing became the default.. To manually assign an IPv6 address, see 3.a) below. To manually enable privacy addressing, which causes the address to change on each reboot, see 3.b) below. To configure the use of Dynamic Host Configuration Protocol version 6 (DHCPv6), see 3.c) below.

3.a) To configure a static address, edit /etc/network/interfaces. Read ‘man 5 interfaces’ for documentation on this file’s format. Example:

iface eth0 inet6 static
address 2001:480:230::42
netmask 64
gateway 2001:480:230::1

3.b) To enable privacy addressing for all network interfaces, add these lines to /etc/sysctl.conf


and then restart the system. Privacy addressing will remain in effect on that interface until the next system halt after this line has been changed or removed. To enable privacy addressing for all network interfaces, add this line to /etc/sysctl.conf


Depending on your system release level, neither of the above commands may work properly for network interfaces attached after the initial boot process (USB Network cards or SD-IO and PC-CARD Network interfaces) completes. This bug will eventually be fixed. On such systems, a

sudo sysctl net.ipv6.conf.default.use_tempaddr=2

executed after such network interfaces are attached will temporarily enable privacy addresses on them. Again, success depends on your system release level.

To temporarily enable privacy addressing for a specific network interface (for example, ‘eth0’) until the next system halt, execute:

sudo sysctl net.ipv6.conf.eth0.use_tempaddr=2
sudo /etc/init.d/networking restart
When privacy addresses are enabled, the ifconfig command will often indicate "global temporary dynamic" or "global secondary dynamic" for such addresses.

Proceed to 4).

3.c) To configure SLAAC on a system where privacy addresses are enabled by default,

To re-enable SLAAC for a specific interface, add a line to /etc/sysctl.conf for that network interface (for example, ‘eth0’) (or change its value if the line already exists):


and then restart the system. SLAAC will remain in effect on that interface until the next system halt after this line has been changed or removed. To re-enable SLAAC for all network interfaces, add this line to /etc/sysctl.conf (or change its value if the line already exists):


and then restart the system. The caveats about system release level mentioned in 3.b) above apply.

3.d) To configure DHCPv6 requires the installation and configuration of an additional package, such as dibbler.(see

4) The Essential IPv6 for the Linux Systems Administrator presentation discusses additional aspects of enabling IPv6, such as routing and DNS.

5) To restart networking on all interfaces:

/etc/init.d/network restart

This may disconnect you temporarily as networking reloads. To restart networking for a specific interface:

ifdown $IFACE


ifup $IFACE

(where $IFACE is the interface name). Read ‘man 8 ifup’ for documentation on using ifup.

6) To verify that IPv6 is working, try pinging:

ping6 -n

The output should be similar to this:

Pinging [2001:470:1:18::119] with 32 bytes of data:
Reply from 2001:470:1:18::119: time=687ms
Reply from 2001:470:1:18::119: time=719ms
Reply from 2001:470:1:18::119: time=702ms
Reply from 2001:470:1:18::119: time=700ms


The kernel will automatically assign a Scope:link address (fe80:: prefix) to your system. If an IPv6 router is advertising on your network, a Scope:Global address will be assigned if /proc/sys/net/ipv6/conf/*/accept_ra is 1 . This can be explicitly configured at boot time by editing /etc/sysctl.conf by adding a line ‘net.ipv6.conf.$IFACE.accept_ra = $VAL’. $IFACE can be any interface name on your system, or ‘all’ (for every interface) or ‘default’ (default settings before interface specific settings are applied). $VAL can be either 0 (off) or 1 (on). Autoconfigure addresses can also be configured via /proc/sys/net/ipv6/conf/*/autoconf . See Documentation/networking/ip-sysctl.txt in the Linux Kernel Source for more information on these and other kernel configuration options.

Debian has an IPv6 setup page along with an IPv6 Project Page.

Also, checkout the Linux IPv6 HOWTO.

ip6tables info can be found in the Enabling IPv6 in ip6tables and other Linux-based Firewalls article in the Security section.