Setting up IPv6
Unfamiliar with IPv6? Try Hurricane Electric's free IPv6 certification. |
Contents
- 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
Introduction
By default you will only get one IPv6 address. You can receive a /64 subnet upon request to support@prgmr.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 support@prgmr.com 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. 71.19.155.15 --- 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 64.71.167.165 netmask 255.255.255.128 gateway 64.71.167.129 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=64.71.167.165 NETMASK=255.255.255.128 GATEWAY=64.71.167.129 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 initscripts is on your system. (And 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
When rebooting my IPv6 connection was not initialized automatically. Adding the line "ipv6" to /etc/modules makes sure that the IPv6 kernel module gets loaded.
Bringing the interface up
You can either just reboot your server, or bring down the interface from the virtual console and then bring it up again. If you are connected directly via SSH and bring down the interface, you won't be able to send any more commands after bringing down the interface, so make sure you bring the interface 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.
You may also want to test your connection from the outside, you can use the tools at http://www.berkom.blazing.de/ or browse your website with ipv6 using http://www.sixxs.net/tools/gateway/
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 support@prgmr.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:
IPV6ADDR_SECONDARIES="2605:2700:1:f00d::1/64 2605:2700:1:f00d::beef/64"
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.