Setting up IPv6
Unfamiliar with IPv6? Try Hurricane Electric's free IPv6 certification.
- 1 Introduction
- 2 Calculating your IPv6 address
- 3 Updating your /etc/network/interfaces for Debian/Ubuntu
- 4 Updating /etc/sysconfig/network-scripts/ifcfg-eth0 for Fedora and CentOS
- 5 Making sure the IPv6 module is loaded
- 6 Bringing the interface up
- 7 Testing your connection
- 8 IPv6 on NetBSD
- 9 Setting up your own /64
By default you will only get one IPv6 address. You can receive a /64 subnet upon request to email@example.com. IPv6 subnet prefixes and default gateways are given below.
Prefix: 2605:2700:0:2::/64 (or 2605:2700:0:3::/64) Default Gateway: 2605:2700:0:2::1 (or 2605:2700:0:3::1) Prefix 2605:2700:0:5::/64 Default Gateway: 2605:2700:0:5::1 Prefix: 2605:2700:0:17::/64 Default Gateway: 2605:2700:0:17::1
Calculating your IPv6 address
Your IPv6 address is the prefix + your IPv4 address. (If you were using the old prefixes of 2001:470:21:20::/64 and 2001:470:21:31::/64, be aware that they are deprecated.)
IPv6 addresses consist of 8 groups of 16-bit hexadecimal numbers. Consecutive groups of 0's are represented by a double colon ::
Example: 2605:2700:0:3::adc5:47aa is equivalent to 2605:2700:0:3:0000:0000:adc5:47aa.
Finding your IPv6 address
The easiest way to find your IP addresses is through the Reverse DNS option on the Management Console. Select option 8.
Name ID Mem VCPUs State Time(s) cnryhilln 42 128 1 -b---- 4503.1 Wiki at http://wiki.prgmr.com Please contact firstname.lastname@example.org with any issues accessing your machine. Options for "cnryhilln" 1. out of band console (press ctrl-] to escape, not resizeable) 2. create/start, opens OOB console (try this if the machine is not running) 3. shutdown (requests operating system to shut down) 4. force power off (destroy/hard shutdown) 5. reboot (requests operating system to reboot) 6. swap i386/amd64 bootloaders currently "i386" 7. view/add/remove ssh authorized_keys 8. set reverse dns 9. swap pvgrub/grub2 bootloaders currently "pv-grub" 0. exit enter selection> 8 0. 22.214.171.124 --- cnryhilln.xen.prgmr.com 1. 2605:2700:0:17::4713:9b0f --- cnryhilln.xen.prgmr.com
Updating your /etc/network/interfaces for Debian/Ubuntu
Once you have your sddress, add the following lines to your /etc/network/interfaces file (remember to substitute your own address for the one in the example):
iface eth0 inet static address 126.96.36.199 netmask 255.255.255.128 gateway 188.8.131.52 iface eth0 inet6 static address 2605:2700:0:3::4444:630e netmask 64 gateway 2605:2700:0:3::1
Updating /etc/sysconfig/network-scripts/ifcfg-eth0 for Fedora and CentOS
DEVICE=eth0 IPADDR=184.108.40.206 NETMASK=255.255.255.128 GATEWAY=220.127.116.11 IPV6INIT=yes IPV6ADDR=2605:2700:0:3::4047:a7a5 IPV6_DEFAULTGW=2605:2700:0:3::1
Setting the default route with IPV6_DEFAULTGW is broken in CentOS/RHEL 5.2 and earlier, so in that case a route for 2000::/3 to the same router should work almost as well. A static ipv6 route can be set in /etc/sysconfig/static-routes-ipv6 like
eth0 2000::/3 2605:2700:0:3::1
For more information on ipv6 and other settings in /etc/sysconfig, see /usr/share/doc/initscripts-8.45.30/ or whatever version of initscripts is on your system.
Be sure to use the correct gateway for your network. The gateway for the 2605:2700:0:3:: prefix is different from the gateway for the 2605:2700:0:2:: prefix.
On CentOS you may need to add "NETWORKING_IPV6=yes" to /etc/sysconfig/network if the IPv6 address is not assigned on ifup.
Making sure the IPv6 module is loaded
Add the line "ipv6" to /etc/modules to ensure that the IPv6 kernel module is loaded on reboot.
Bringing the interface up
You can either reboot your server, or use the virtual console to bring down the interface from the virtual console and then bring it up again.
Important: If you are connected directly via SSH, you won't be able to send any more commands after bringing down the interface, so make sure you bring the interface back up in the same command:
ifdown eth0 && ifup eth0
Testing your connection
david@kauri:~$ ping6 ipv6.google.com PING ipv6.google.com(pv-in-x93.1e100.net) 56 data bytes 64 bytes from pv-in-x93.1e100.net: icmp_seq=1 ttl=54 time=24.0 ms 64 bytes from pv-in-x93.1e100.net: icmp_seq=2 ttl=54 time=24.0 ms
Congratulations, your native IPv6 connection is now up and running.
IPv6 on NetBSD
Add a line to /etc/ifconfig.xennet0:
inet6 2605:2700:0:3::XXXX:XXXX prefixlen 64 alias
Add a line to (or create) /etc/route.conf
inet6 -net 2000::/3 2605:2700:0:3::1
Remember to use the correct gateway for your prefix. The gatway for the 2605:2700:0:3:: prefix is different from the gatway for the 2605:2700:0:2:: prefix.
Setting up your own /64
To get your own /64, email email@example.com and ask for one. Once you receive it, you can configure it in Debian or Ubuntu by changing the IPv6 section in your /etc/network/interfaces file to look like this (be sure to change the IP addresses):
iface eth0 inet6 static address 2605:2700:0:3::4444:630e netmask 64 gateway 2605:2700:0:3::1 up ip -6 addr add 2605:2700:1:f00d::1/64 dev eth0 up ip -6 addr add 2605:2700:1:f00d::beef/64 dev eth0
For Fedora or CentOS, add the following line to your /etc/sysconfig/network-scripts/ifcfg-eth0 file, changing the addresses as necessary:
You can also add addresses under your prefix to a dummy, VPN, or bridge interface. You MUST keep your old address that you calculated earlier in the article because your prefix is routed through that address.