Personal computing discussed

Moderators: renee, SecretSquirrel, notfred

 
notfred
Maximum Gerbil
Topic Author
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

IPv6 setup

Mon Feb 21, 2011 1:57 pm

So after posting over on the Networking forum about the death of IPv4, I thought it was time to step up and bring IPv6 to my home network. My ISP doesn't actually have IPv6 turned on and I use a Debian system as a router (plus server) for my LAN. This was originally set up on Lenny and survived the upgrade to Squeeze with no issues. Ubuntu is probably similar.

First thing was to acquire an IPv6 tunnel. I looked around at various free services and settled on HurricaneElectric as they are free and have a tunnel server hung off of the Toronto Internet Exchange where my ISP peers. I registered at http://tunnelbroker.net/ and got a tunnel, the server has both an IPv4 and an IPv6 address and I need to configure my end with my part of the IPv4 and IPv6 address. There's one additional wrinkle in that I have a dynamic IPv4 address from my ISP and the server needs to know my IPv4 address for where to send the tunneled traffic, fortunately there is an auto-update webpage for that.

I considered how to set this up on my server and first was going to use /etc/network/interfaces, but my ISP uses PPPoE so my IPv6 tunnel rides within my IPv4 PPP connection. I therefore decided to add this as a script that is executed as my PPP connection goes up and down. Scripts in /etc/ppp/ip-up.d are executed on the PPP interface going up and scripts in /etc/ppp/ip-down.d are executed on it going down.

Here is /etc/ppp/ip-up.d/he-ipv6 with some obscuration of details:
#!/bin/sh

# Update the tunnel with our IP
curl -k -s "https://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&pass=6xxxxxxxxxxxxxxxxxxxxxxxxxxxxx0&user_id=axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9&tunnel_id=9xxx1"

# Bring up the tunnel
ip tunnel add he-ipv6 mode sit remote 216.66.38.58 local $PPP_LOCAL ttl 255
ip link set he-ipv6 up
ip addr add 2001:4xx:1x:4xx::2/64 dev he-ipv6
ip route add 2000::/3 dev he-ipv6

The pass parameter is the md5sum of your password, formed by
echo -n password | md5sum

The user_id parameter is actually shown on the main page of the website when you are logged in, it is not your plain login name or md5sum of it, it's something else so just copy paste it.
The tunnel_id parameter is given when you click on the tunnel that you have created.
The IPv6 address that gets added to the device is the client IPv6 address given on the tunnel page.

To make sure everything gets cleaned up when the PPP link goes down so that there is no problem starting it up again, here is /etc/ppp/ip-down.d/he-ipv6
#!/bin/sh

# Bring down the tunnel
ip route del 2000::/3 dev he-ipv6
ip link set he-ipv6 down
ip tunnel del he-ipv6


A quick "ifdown ppp0" followed by and "ifup ppp0" and my server has IPv6 connectivity, verified by "ping6 ipv6.google.com" showing packets.

Next stage is to get the rest of my LAN up on IPv6. First I went to the tunnel information webpage and requested the routable /48 option. This actually gives me 65536 /64s, I'm only going to use the first one for my LAN, but it's good to know I've got room for expansion :-)

On my server I first needed to tell it to act as an IPv6 router, so I editted /etc/sysctl.conf and uncommented out the line "net.ipv6.conf.all.forwarding=1". To avoid the need to reboot to pick this up "echo -n 1 > /proc/sys/net/ipv6/conf/all/forwarding". Now it's just time to get the server advertising the first /64 prefix for my LAN. "apt-get install radvd" and then create /etc/radvd.conf
interface eth2
{
   AdvSendAdvert on;
   AdvLinkMTU 1472;
   prefix 2001:4xx:bxx::/64
   {
   };
};   

eth2 is my LAN interface. The prefix is the one shown for the routable /48 on the website but /64s are always used for LAN segments so advertise it as a /64 and that's just using the first of the 65536 of them.

The tricky bit is the MTU setting, I initially didn't have anything there and I found all kinds of stuff not working, then I went to http://test-ipv6.com/ and it told me that large packets were not getting through and I realised I had MTU issues. Ethernet normally has an MTU of 1500, but as mentioned earlier my ISP uses PPPoE which consumes 8 bytes bringing my Internet MTU down to 1492. The IPv6 tunnel then consumes another 20 bytes resulting in an IPv6 Internet MTU of 1472. I can't be bothered to try and get 1500 byte MTU on my LAN with IPv6 and 1472 for Internet, the difference is so small.

Remember to "/etc/init.d/radvd start" to bring it up without rebooting the server. With this, all my other boxes on the LAN that are IPv6 capable picked up the IPv6 and autoconfigured correctly. All of them can go to http://test-ipv6.com/ and see the dancing turtle at http://www.kame.net/ I score 10/10 for IPv4 and 9/10 for IPv6 (ISP not running an IPv6 DNS) at http://test-ipv6.com/

Hmm, maybe I should add Hurricane Electric's IPv6 anycast DNS server at 2001:470:20::2 ....

Edit - fixed the /48 being 64k /64s
 
Krogoth
Emperor Gerbilius I
Posts: 6049
Joined: Tue Apr 15, 2003 3:20 pm
Location: somewhere on Core Prime
Contact:

Re: IPv6 setup

Mon Feb 21, 2011 3:04 pm

Not to crap on your thread.

Your concerns with IPv4 are grossly overexaggerated. The only people who should be worrying about it are network engineer that are on datacenters, ISPs and other large networks. The problem will not affect mainstream for several years. By the time, it starts to become apparent. IPv6 support among ISPs and home grade networking equipment should be more ubiquitous
Gigabyte X670 AORUS-ELITE AX, Raphael 7950X, 2x16GiB of G.Skill TRIDENT DDR5-5600, Sapphire RX 6900XT, Seasonic GX-850 and Fractal Define 7 (W)
Ivy Bridge 3570K, 2x4GiB of G.Skill RIPSAW DDR3-1600, Gigabyte Z77X-UD3H, Corsair CX-750M V2, and PC-7B
 
notfred
Maximum Gerbil
Topic Author
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: IPv6 setup

Mon Feb 21, 2011 4:55 pm

Sure, I'm well aware that IPv4 is going to be around for years, I just thought it fun to setup and run dual-stack so I get the best of all worlds.

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On