Revision as of 02:00, 5 January 2012 by Craig Peacock (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Preamble

It has been a couple of years since I last played with IPv6, and since then my ISP Internode has introduced IPv6 as a production service - dual stack, native IPv6. Hence, it is now time to get more serious and have a go implementing IPv6 on the home network.

What is IPv6

IPv6 is the new Internet Protocol Version 6 defined by RFC 2460 and set to replace the current Internet Protocol Version 4 (IPv4). The address space for IPv4 is only 32 bits long, and with the proliferation of IP devices from desktop computers, tablets, smart phones, set-top boxes, VoIP telephones etc, the world is quickly running out of Internet Addresses.

While the main objective of IPv6 is a much larger address space, IPv6 can also offer these other advantages:

  • Stateless Address Auto-configuration
  • No NAT (Network Address Translation)
  • Easy Address Renumbering
  • Multiple Addresses per Interface
  • Improved Network Security

IPv6 Address Formats

Version 6 Internet Protocol (IP) addresses are 128 bits long and written in hexadecimal with pairs of bytes separated by colons. A IPv6 address looks like :

2001:44b8:0219:6400:0000:0000:0000:0001

but can be shortened to

2001:44b8:219:6400::1

by removing leading zeros and substituting zero blocks with two colons.

Scopes

With IPv4, RFC 1918 "Address Allocation for Private Internets" outlined private or non route-able address spaces e.g. 192.168.0.0/16

IPv6 defines a range of scopes, some of the more common are listed below:

  • Link-local Scope : Addresses that are not routable and are limited to the local subnet or link. These addresses start with a prefix of fe80::/64
  • Global Scope : Addresses that can be globally routed over the entire IPv6 inter-network. Currently prefixes with 2000::/3 have been allocated.

In addition to the above scopes, ff00::0/12 is reserved for multicast addresses.

Stateless address autoconfiguration

IPv6 Router Advertisement Daemon (radvd)

The IPv6 Router Advertisement Daemon periodically sends Router Advertisement Messages to a local ethernet LAN. These messages can also be requested using a Router Solicitation Message.

RFC 2461 Neighbour Discovery for IP Version 6 (IPv6)

The source for radvd can be downloaded from http://www.litech.org/radvd/

interface eth0 {
	AdvSendAdvert on;
	MinRtrAdvInterval 3;
	MaxRtrAdvInterval 10;
	prefix 2001:44b8:219:6400::/64 {
		AdvOnLink on;
		AdvAutonomous on;
	};
};

Options

  • AdvSendAdvert: Enable router to send periodic router advertisements and respond to router solicitations.
  • MinRtrAdvInterval: Minimum time between sending unsolicited multicast router advertisements (seconds)
  • MaxRtrAdvInterval: Maximum time between sending unsolicited multicast router advertisements (seconds). Must be no greater than 1800 seconds (30 Minutes)
  • Prefix: Prefix Definition
    • AdvOnLink: Indicates if prefix can be used for on-link determination.
    • AdvAutonomous: When set, indicates that this prefix can be used for autonomous address configuration as specified in RFC 4862.
    • AdvRouterAddr: When set, indicates that the address of interface is sent instead of network prefix

Routing

/sbin/ip -6 route show

Add default route

ip -6 route add 2000::/3 dev ppp0 ip -6 route add default dev ppp0 route add -inet6 default -interface ppp0

Firewall

ip6tables -A INPUT -m state --state NEW -m udp -p udp --dport 546 --sport 547 -s fe80::/10 -d fe80::/10 -j ACCEPT