Note: A 2022 tutorial on the many aspects of IPv6 can be found in this All Things TECH IPv6 on Linux article.
Enabling IPv6
Linux systems built with a Linux kernel 2.6 or later will have Internet Protocol version 6 (IPv6) enabled by default, including Red Hat (Desktop or WS 3.0 or later and Enterprise (RHEL) 5.2 or later), Mandrake 8 or later, Fedora 9 or later, and CentOS 7 or later systems. IPv4 will continue to run. You must be logged in as root to make these changes. Also, in the absence of other policy or guidance about hardening RHEL to guard against potential IPv6-related attacks, a guide for configuring RHEL servers 6.6 and later to prevent IPv6-related attacks is provided by this Linux Security Guide for Hardening IPv6 article.
The following guide explains the steps involved with enabling IPv6 in earlier versions of Red Hat Linux. These instructions also work for the Mandrake, Fedora, and CentOS Linux distributions.
Considerations: If you depend on iptables for securing the system make sure to appropriately apply ip6tables rules. See link at end of this section.
Quick Start Instructions:
1) Test to see that the ipv6 kernel module is loaded: lsmod |grep ipv6
If it’s not loaded, load immediately as follows:
modprobe ipv6
To have the module loaded when the system starts, edit /etc/modules.conf and add the following line:
alias net-pf-10 ipv6
2) Edit: /etc/sysconfig/network, add:
NETWORKING_IPV6=yes
3) For each of the /etc/sysconfig/network-scripts/ifcfg-ethX files, add:
IPV6_AUTOCONF=yes
to enable Stateless Address Autoconfiguration (SLAAC) addressing, or, if you want to manually configure things, instead add:
(remembering to use square brackets and colons in the IPv6 addresses).
4) Privacy extensions are not enabled by default. For each configured interface ethX where privacy extensions are being enabled, add the line:
IPV6_PRIVACY=rfc3041
to the /etc/sysconfig/network-scripts/ifcfg-interface ethX file for that interface. Then create the file /etc/sysctl.d/ipv6_privacy_extensions (if it does not already exist), containing the lines
net.ipv6.conf.default.use_tempaddr=2
net.ipv6.conf.all.use_tempaddr=2
5) This LINUX IPv6 HOWTO document discusses additional aspects of enabling IPv6, such as routing and DNS.
6) Then issue a "service network restart" command. (This may disconnect you temporarily as networking reloads)
7) Then try pinging:
# ping6 -n ipv6.test-ipv6.com
The output should be similar to this:
Pinging ipv6.test-ipv6.com [2001:470:1:18::115] with 32 bytes of data:
Reply from 2001:470:1:18::115: time=687ms
Reply from 2001:470:1:18::115: time=719ms
Reply from 2001:470:1:18::115: time=702ms
Reply from 2001:470:1:18::115: time=700ms
ip6tables information can be found in the Enabling IPv6 in ip6tables and other Linux-based Firewalls article in the Security section.
Disabling IPv6
In releases built with a Linux kernel 2.6 and later, IPv6 is enabled by default. This includes Red Hat (Desktop or WS 3.0 or later and RHEL 5.2 or later), Mandrake 8.0 or later, Fedora 9 or later, and CentOS 7 or later systems. IPv4 will continue to run. You must be logged in as root to make these changes. To disable IPv6:
1. Edit the file /etc/modprobe.conf
2. Add the following lines to the file
alias net-pf-10 off
alias ipv6 off
3. Write the file, save it, and exit the editor
4. Edit the file /etc/sysconfig/network
5. Change the following line in the file
NETWORKING_IPV6= yes
so that it looks like
NETWORKING_IPV6= no
6. Write the file, save it, and exit the editor
7. Reboot
Enabling IPv6
The following guide explains the steps involved with enabling Internet Protocol version 6 (IPv6) in Oracle Solaris.
· Must be running Solaris 8 or later. Solaris 10 or later is preferred since previous versions did not support DHCPv6. Configuration information for Dynamic Host Configuration Protocol version 6 (DHCPv6) may be found here.
· Create empty file /etc/hostname6.int, for each int that is an interface on which to enable IPv6, i.e. if hme0 is such a network interface:
#> touch /etc/hostname6.hme0
· Configure IPv6 values in /etc/rc2.d/S70nddconfig as appropriate for your site/security requirements.
· (Solaris 8 and later only) Make sure the following is in /etc/nsswitch.conf:
#> ipnodes: dns files
· Reboot
A couple of notes on IPv6 enabling Sun boxes:
Oracle Solaris 11.4 Information Library has a good collection of v6 related info for Solaris11.4.
IPv6 Administration Guide: Oracle Solaris 11.4 IPv6 Interfaces.
For the WebServer (iPlanet), checkout this Web Tier Reference.To enable privacy addresses (Solaris 10 and later), add the following line (or change its value) in /etc/inet/ndpd.conf:
ifdefault TmpAddrsEnabled true
and optionally add the following (XX is in seconds):
ifdefault TmpValidLifetime XX
ifdefault TmpPreferredLifetime XX
Then restart ndpd with:
svcadm restart svc:/network/routing/ndp:default
Disabling IPv6
Remove any ipv6 values previously created in /etc/rc2.d/S70nddconfig. Enter the command:
#> rm /etc/hostname6.*
and then reboot. If this command fails for some interface, enter the following command:
#> ifconfig int unplumb inet6
To disable privacy addresses (Solaris 10 and later) without disabling IPv6, change the following line in /etc/inet/ndpd.conf:
ifdefault TmpAddrsEnabled false
and remove the following lines (whatever their values)
ifdefault TmpValidLifetime
ifdefault TmpPreferredLifetime
Then restart ndpd with:
svcadm restart svc:/network/routing/ndp:default
for that int on which IPv6 has previously been enabled and then reenter the rm command.
Enabling IPv6
Internet Protocol version 6 (IPv6) has been enabled by default in OpenBSD since 3.0. IPv6 privacy extensions have been enabled by default since OpenBSD 5.3.
To manually disable the use of IPv6 privacy extensions, determine the name of the installed network interfaces using the ifconfig command. Typical interfaces are em0 or fxp0.
To disable IPv6 privacy extensions on an inet6-enabled interface em0, execute the following:
ifconfig em0 –autoconfprivacy
The existing temporary privacy address will persist until it becomes invalid.
To enable IPv6 privacy extensions on an inet6-enabled interface em0, execute the following:
ifconfig em0 autoconfprivacy
A temporary privacy address will be generated and assigned to the interface em0. It will automatically be replaced by another temporary privacy address after 24 hours of use and after receipt of the next router advertisement for that interface’s prefix.
For more details, please look at the OpenBSD ifconfig manual page.
Disabling IPv6
The recommended practice is to block all IPv6 inbound and outbound traffic in the pf packet filter, rather than attempting to disable it in the kernel.
1. Edit the file /etc/pf.conf
2. Add the following lines to the end of the file
block in inet6
block out inet6
3. Reboot (or, restart the pf.d script)
For more details, please look at the OpenBSD pf manual page.
Enabling IPv6
Internet Protocol version 6 (IPv6) has been enabled by default in NetBSD for so long (since at least 1.5) that there is little point in describing how to enable it.
IPv6 temporary addresses have been supported in NetBSD releases since version 7.0. The command to enable them is:
sysctrl –w net.inet6.ip6.use_tempaddr=1
and the command to disable them is:
sysctrl –w net.inet6.ip6.use_tempaddr=0
IPv6 temporary addresses are supported in dhcpcd. See the man page for configuration details.
The NetBSD Project maintains an IPv6 Frequently Asked Questions (IPv6 FAQ) about configuring IPv6 in NetBSD.
Disabling IPv6
The recommended practice is to block all IPv6 inbound and outbound traffic in the npf packet filter, rather than attempting to disable it in the kernel.
1. Edit the file /etc/npf.conf
2. Add the following lines to the (default) group
block in inet6
block out inet6
3. Then, reload and start npf.
For more details, please look at the NetBSD npf.conf manual page.
1. Enabling IPv6 in Advanced Interactive eXecutive (AIX) 7.2 and later
Enabling IPv6 in IBM AIX 7.2 and later is documented here.
2. Enabling IPv6 in i 7.5 and later
The general topic of networking in IBM i 7.5 is documented here. Enabling IPv6 in IBM i 7.6 and later is documented here.
3. Enabling IPv6 in z/OS 3.1.0 and later
Enabling IPv6 in IBM z/OS 3.1.0 and later is documented here.
4. Enabling IPv6 in z/VM 4.4 and later
Enabling IPv6 in IBM z/VM 4.4 and later is documented here.
