Difference between revisions of "Setting up IPv6"

From PrgmrWiki
(Introduction)
Line 19: Line 19:
  
 
<pre>
 
<pre>
MPT and SVTIX
+
MPT
 
Default Gateway: 2605:2700:0:2::1 (or 2605:2700:0:3::1)
 
Default Gateway: 2605:2700:0:2::1 (or 2605:2700:0:3::1)
 
Prefix: 2605:2700:0:2::/64 (or 2605:2700:0:3::/64)
 
Prefix: 2605:2700:0:2::/64 (or 2605:2700:0:3::/64)
 +
 +
SVTIX
 +
Default Gateway: 2605:2700:0:5::1
 +
Prefix 2605:2700:0:5::/64
  
 
Fremont
 
Fremont

Revision as of 11:36, 15 November 2011

Careful: The IPv6 is on a dedicated router now. There will be changes soon though because of renumbering to our own IP block from ARIN. Please check the IRC channel or this wiki page for updates.

Unfamiliar with IPv6? Try Hurricane Electric's free IPv6 certification.

Introduction

IPv6 will at the moment only work for hosts at the Market Post Tower (MPT), svtix colocation, and Fremont datacenters.

By default you will only get one IPv6 address, which has to be manually configured. If you are located at the MPT or svtix datacenter, you can receive a /64 subnet upon request to support@prgmr.com.

New VPS's are placed on servers at the Market Post Tower (MPT) datacenter, and so can use IPv6, and can receive a /64 by requesting it from support@prgmr.com.

MPT
Default Gateway: 2605:2700:0:2::1 (or 2605:2700:0:3::1)
Prefix: 2605:2700:0:2::/64 (or 2605:2700:0:3::/64)

SVTIX
Default Gateway: 2605:2700:0:5::1
Prefix 2605:2700:0:5::/64

Fremont
Default Gateway: 2001:470:1:41::1
Prefix: 2001:470:1:41::/64

Calculating your IPv6 address

The global prefix for one of the subnets is 2605:2700:0:2::/64, and the other is 2605:2700:0:3::/64. (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.) Your IPv6 address is the prefix + your IPv4 address.

IPv6 addresses consist of 8 groups of 16-bit hexadecimal numbers. Consecutive groups of 0's are represented with a double colon ::

Example: 2605:2700:0:3::adc5:47aa is equivalent to 2605:2700:0:3:0000:0000:adc5:47aa.

Finding your prefix

On debian, install rdisc6 from the ndisc6 package.

$ rdisc6 eth0
Soliciting ff02::2 (ff02::2) on eth0...

Hop limit                 :           64 (      0x40)
Stateful address conf.    :           No
Stateful other conf.      :           No
Router preference         :       medium
Router lifetime           :            0 (0x00000000) seconds
Reachable time            :  unspecified (0x00000000)
Retransmit time           :  unspecified (0x00000000)
 Prefix                   : 2001:470:21:31::/64
  Valid time              :            0 (0x00000000) seconds
  Pref. time              :            0 (0x00000000) seconds
 Prefix                   : 2605:2700:0:3::/64
  Valid time              :            0 (0x00000000) seconds
  Pref. time              :            0 (0x00000000) seconds
 Source link-layer address: 00:30:48:BC:A1:9A
 from fe80::230:48ff:febc:a19a

Use the prefix shown above (the one beginning with 2605:2700) as your IPv6 prefix (without the /64). Ignore the prefix beginning with 2001:470; as noted above, that prefix is deprecated.

Web Interface

You can use the web interface at subnetonline.com, but please make sure that you replace the default prefix with the prgmr.com prefix.

With irb (interactive ruby)

irb(main):001:0> ip4 = "68.68.99.14"
=> "68.68.99.14"
irb(main):002:0> prefix = "2605:2700:0:3::"
=> "2605:2700:0:3::"
irb(main):003:0> ip6 = prefix + ip4.split(".").map { |x| x.to_i }.pack("CCCC").unpack("H4H4").join(":")
=> "2605:2700:0:3::4444:630e"

With sipcalc

$ sipcalc 68.68.99.14
-[ipv4 : 68.68.99.14] - 0

[CIDR]
Host address            - 68.68.99.14
Host address (decimal)  - 1145332494
Host address (hex)      - 4444630E

Updating your /etc/network/interfaces for Debian/Ubuntu

Add the following lines to your /etc/network/interfaces (don't forget to substitute the address for your own):

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/64

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.