As some of you may know, I’m planning on updating my home server to an ubuntu-based one at some point, and I have been busy trying to get to grips with Linux and all its many different ways about how it works. Some of you may also know that IPv4 is slowly coming to an end; last I checked they’ve exhausted the pool of allocation for IPv4 (possibly bad choice of words? Please correct me if I’m wrong). I don’t mean that every possible combination of IP’s have been used up… they’ve just all been allocated off to individuals/ISP’s/corporations/etc. and its only a matter of time when they will no longer be able to provide people with an IP address (not without creating subnets, and NAT’s on top of each other to allow for more).
So in light of this, the lovely people at #ubuntu-uk have suggested I try and setup IPv6 tunnelled over IPv4 via one of many different IPv6 brokers… and I can honestly say I have successfully managed to do so! Not just for one machine, but for any machine that gets connected to my network! Score! \o/
Credits
Before I go on, as usual, I like to take this opportunity to thank the #ubuntu-uk community (mainly through IRC) for all their help and support. The main man himself that helped me through it is MartijnVdS, without his patience and help I think I would probably still be sat trying out millions of different combinations trying to get it to work. I can’t forget shauno, since me and him were talking about IPv6 (along with MartijnVdS and possibly a few others). Shauno has also helped when I was struggling by linking me to some useful places (when most people would normally be asleep). Thank you all :). If I’ve missed anyone out, please let me know.
I’m going to essentially walk through the settings and configuration as best as I possibly can (the way I understood it as people were trying to help me), and hopefully the information here will help others get started and setup too :).
Some info on World IPv6 Day is in the spoiler.
Show Spoiler ▼
Spoiler
I would just like to quickly point out, on the 8th of June 2011 (2 days before my birthday!), some of the major companies and websites are planning on switching IPv6 onto their main servers for a day (using dual-stacking protocols to have both IPv4 and IPv6 being hosted at the same time). You may notice that if your using incompatible browsers, tools or applications on this day that you may not be able to reach them (unless you have IPv6, in which case you should be able to access them with no problems). Here is a link to the website for more information on it: http://isoc.org/wp/worldipv6day/.
Let’s begin…
Now there are two (2) ways you can get an IPv6. You can either set each machine individually, or you can setup a machine as an IPv6 router (or IPv6 announcer) to dish out IPv6 to all machines that are capable of doing so on your network. The second method is the way I have things setup at home, however as I was learning I did do the first method first. It is entirely up to you which one you want to do, and I will be listing them both. Just click on the section you’d like to follow.
Note: Both have similar steps. Also note, using a broker you’ll essentially be assigned 2^64 address (which is a HUGE number of IPv6′s that you can have for your devices!)
Show How To Setup Individually ▼
Step 1: Selecting a broker
- Now although I just picked a broker for the simple fact that I’d heard it before (and visited their site before), I recommend that if your serious about doing this that you look into why your doing it and which one may suit your needs more. I picked HE (Hurricane Electrics – http://www.he.net/), simply because I knew the name, plus I’d noticed some people on #ubuntu-uk use them too, so this made it helpful because I was able to get help from people who had experienced setting-up before with them before. Anyway, moving on…
- Register for an account for your chosen broker (HE’s tunnel broker site is here: http://www.tunnelbroker.net/).
Step 2: Create a tunnel
- Now this may be different for each broker, but the steps should be similar for all of them. After you’ve logged in to HE, you should see on the left hand side navigation a “Create regular tunnel” link – click it.
- It will ask for an IPv4 endpoint, this is basically your internet facing IP address. It will show you your IP on the page in the section “You are viewing from IP:”, unless your using proxies or other fancy methods of hiding your IP I recommend you put that IP address shown there. If your using fancy methods, then I suggest you connect to your router and find your internet IP address that way.
- Select a server that’s closest to you, this is just to reduce lag/latency/etc… however you can pick any you prefer.
- Click Submit. You’ll now be allocated an IPv6 range. You should see this in your “Main Page” section.
- Click the link for the new tunnel you’ve created, and keep it open in a new tab/window since you will be referring to this page a bit.
- Common errors will be placed in the box below when doing this section (based on comments and from experience when I was doing this).
You may need to set your router to allow pings, otherwise you cannot create a tunnel.
Step 3: Configure /etc/network/interfaces
- We’re going to configure a virtual network interface (or endpoint) for your tunnel. We’ll be calling this “he-ipv6″.
- There are a few ways you can configure this file, I prefer using a text editor called nano… however you can use gedit instead if you wish for a GUI version. Just replace the commands nano with gedit. Type in the following into a terminal:
sudo nano /etc/network/interfaces
- Then add the following lines at the end of your file. Don’t forget to change these to your own values. The # represent comments, and you don’t need to include these.
1
2
3
4
5
6
7
8
| # This is for IPv6 tunnelbroker.net (HE)
auto he-ipv6
iface he-ipv6 inet6 v4tunnel
endpoint 216.45.64.21
address 2001:470:beef:a3d::2
netmask 64
up ip -6 route add default dev he-ipv6
down ip -6 route del default dev he-ipv6 |
- Here are the changes you need to make
216.45.64.21 = Server IPv4 address
2001:470:beef:a3d::2 = Client IPv6 address (notice that the /64 is taken out, this is used in the netmask section).
- Now if your using nano, just save the file with CTRL+O then hit enter. Then close with CTRL+X. If your using gedit, just click save and then close the document.
- Lets now activate the he-ipv6 we just configured above with the following command:
-You should now be able to run the following and get some replies:
ping6 ipv6.google.com -c 5
-If your able to do the command above, try visiting this website for another test: ipv6.google.com. If you can see that page, everything was configured perfectly! Congrats!! \o/
-If not, try restarting the machine and see if you can then.
-If your still having trouble, it could be possible that you haven’t got IPv6 enabled. To fix that you’ll need to open up network manger by doing either:
System -> Preferences ->Network Connections
- …or right-click the network icon on your toolbar and pick “Edit Connections”.
- Once you’ve done that, pick the connection you’d like to gain an IPv6 (for example “Auto eth0″) and click “edit”.
- Go to the IPv6 Settings tab, and where it says “Method” pick “Manual”. Make sure the “Require IPv6 addressing for this connection to complete” is NOT ticked.
- Click the “Add” button, then add the follow:
Address =Routed /64 (minus off the /64 part, and replace with 1)
Prefix = 64
Gateway = Client IPv6 address (minus the /64 part).
- That’s it! Click apply, and once you’ve done that you may want to reconnect to that network (or restart your computer). You should now be able to do the ping6 command from earlier :). Also try visiting this website: ipv6.google.com. If you can see that page, you’ve successfully got an IPv6 address! Hurray! \o/
Show How To Setup as a Router ▼
Step 1: Selecting a broker
- Now although I just picked a broker for the simple fact that I’d heard it before (and visited their site before), I recommend that if your serious about doing this that you look into why your doing it and which one may suit your needs more. I picked HE (Hurricane Electrics – http://www.he.net/), simply because I knew the name, plus I’d noticed some people on #ubuntu-uk use them too, so this made it helpful because I was able to get help from people who had experienced setting-up before with them before. Anyway, moving on…
- Register for an account for your chosen broker (HE’s tunnel broker site is here: http://www.tunnelbroker.net/).
Step 2: Create a tunnel
- Now this may be different for each broker, but the steps should be similar for all of them. After you’ve logged in to HE, you should see on the left hand side navigation a “Create regular tunnel” link – click it.
- It will ask for an IPv4 endpoint, this is basically your internet facing IP address. It will show you your IP on the page in the section “You are viewing from IP:”, unless your using proxies or other fancy methods of hiding your IP I recommend you put that IP address shown there. If your using fancy methods, then I suggest you connect to your router and find your internet IP address that way.
- Select a server that’s closest to you, this is just to reduce lag/latency/etc… however you can pick any you prefer.
- Click Submit. You’ll now be allocated an IPv6 range. You should see this in your “Main Page” section.
- Click the link for the new tunnel you’ve created, and keep it open in a new tab/window since you will be referring to this page a bit.
- Common errors will be placed in the box below when doing this section (based on comments and from experience when I was doing this).
You may need to set your router to allow pings, otherwise you cannot create a tunnel.
Step 3: Create a /48 subnet
- Since we’ll be creating a router to dish out IP address, we’ll need to create a subnet. Don’t worry, its almost physically impossible for you to run out of IP’s they’ve assigned you unless your a really huge company.
-On the page where you have all your details. Click the link to allocate a “Routed /48″ range.
-That’s it :). Done!
Step 4: Configure /etc/network/interfaces
- We’re going to configure a virtual network interface (or endpoint) for your tunnel. We’ll be calling this “he-ipv6″.
- There are a few ways you can configure this file, I prefer using a text editor called nano… however you can use gedit instead if you wish for a GUI version. Just replace the commands nano with gedit. Type in the following into a terminal:
sudo nano /etc/network/interfaces
- Then add the following lines at the end of your file. Don’t forget to change these to your own values. The # represent comments, and you don’t need to include these.
1
2
3
4
5
6
7
8
| # This is for IPv6 tunnelbroker.net (HE)
auto he-ipv6
iface he-ipv6 inet6 v4tunnel
endpoint 216.45.64.21
address 2001:470:beef:a3d::2
netmask 64
up ip -6 route add default dev he-ipv6
down ip -6 route del default dev he-ipv6 |
- Here are the changes you need to make
216.45.64.21 = Server IPv4 address
2001:470:beef:a3d::2 = Client IPv6 address (notice that the /64 is taken out, this is used in the netmask section).
- Now if your using nano, just save the file with CTRL+O then hit enter. Then close with CTRL+X. If your using gedit, just click save and then close the document.
- Lets now activate the he-ipv6 we just configured above with the following command:
-You should now be able to run the following and get some replies:
ping6 ipv6.google.com -c 5
-If not, try restarting the machine and see if you can then.
Step 5: Configure /etc/sysctl.conf to allow IPv6 forwarding
- This step is important, because without IPv6 forwarding… you won’t be able to pass out IPv6 to other machines.
- First lets open that file, type in the following command:
sudo nano /etc/sysctl.conf
- Now this document has a lot of things commented out, however all we’re going to be looking for is something that says “#net.ipv6.conf.all.forwarding=1″. You may find yours only has “#net.ipv6.conf.default.forwarding=1″ depending on your setup. However, either way you want to remove the hash (#) out. So you should have something that looks like this (after you take the # out):
1
2
3
4
| # Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
net.ipv6.conf.all.forwarding=1 |
- If it doesn’t exist, thats fine too. Just add those lines in at the end of the file.
- Now save with CTRL+O, hit enter, then close with CTRL+X.
- At this point, it might be a good idea to restart to make sure all the settings take place for the next lot of sections.
Step 6: Install radvd (Router ADVertisement Daemon)
- Now we need to install a tool to be able to send out IPv6 to other machines. This tool is called radvd (Router Advertisement Daemon). If your using Ubuntu (or Debian), you should be able to grab this via:
sudo apt-get install radvd
Step 7: Configure /etc/radvd.conf
- Now we shall configure radvd to dish out some IPv6 addresses to your machines.
- Run the following command (don’t worry if its blank, we are creating a new file).
sudo nano /etc/radvd.conf
- We need to put in the following:
interface eth0
{
AdvSendAdvert on;
prefix 2001:470:cafe::/64
{
AdvOnLink on;
AdvAutonomous on;
};
};
- Make sure you change out the prefix from the one supplied by your broker. As shown below:
2001:470:cafe::/64 = Routed /48 address
IMPORTANT: Please note, that the number they give you ends in /48 however we need to set in the config this as /64.
So instead of putting 2001:470:cafe::/48, we're putting 2001:470:cafe::/64.
- Now that we’ve done those changes save with CTRL+O, then enter, then exit with CTRL+X.
- Now lets start up the radvd daemon :). Put in the following command (don’t worry, this won’t restart the system… it is only restarting the radvd tool):
sudo /etc/init.d/radvd restart
That’s all folks!
We have now fully configured the system to be a router for IPv6. Every system now able to receive an IPv6 on your network should now have one, you can test this by typing in:
ping6 ipv6.google.com -c 5
- If however that doesn’t work, it could be that your system hasn’t been enabled to automatically be assigned an IPv6 address. You can check this with:
- You should see an address that starts with “2001:470:cafe” (this is the starting IPv6 address that HE gave you, as used earlier in this example) and an address that starts with “fe80″. If you only see an address that starts with “fe80″ then you’ll need to enable IPv6 on your machine. To do this continue onto the section “Automatically Assign IPv6″ below.
Show Automatically Assign IPv6 ▼
- If your using ubuntu, this is easily achieved by using the network manager. To access this you do either:
System -> Preferences ->Network Connections
- …or right-click the network icon on your toolbar and pick “Edit Connections”.
- Once you’ve done that, pick the connection you’d like to gain an IPv6 (for example “Auto eth0″) and click “edit”.
- Go to the IPv6 Settings tab, and where it says “Method” pick “Automatic”. Make sure the “Require IPv6 addressing for this connection to complete” is NOT ticked.
- That’s it! Click apply, and once you’ve done that you may want to reconnect to that network (or restart your computer). You should now be able to do the ping6 command from earlier :). Also try visiting this website: ipv6.google.com. If you can see that page, you’ve successfully got an IPv6 address! Hurray! \o/
Hope this guide helps you, and was informative at the same time. Please feel free to post any problems you may have in the comments, and I’ll try my best to answer them for you :).
VN:F [1.9.8_1114]
Rating: +2 (from 2 votes)