Playing around with IPv6 on Linux and Freenet6
Gazette Linux n°184 — mars 2011
Anderson
Silva
afsilva CHEZ gmail POINT com
Prénom
Nom du traducteur
Adaptation française
adresse_électronique CHEZ fournisseur POINT code_pays
Prénom
Nom du relecteur
Relecture de la version française
adresse_électronique CHEZ fournisseur POINT code_pays
Article paru dans le n°184 de la Gazette Linux de mars 2011.
Cet article est publié selon les termes de la Open Publication License.
La Linux Gazette n'est ni produite, ni sponsorisée, ni avalisée par notre hébergeur principal, SSC, Inc.
2011
Anderson Silva
Année de traduction
Prénom Nom du traducteur
Année de relecture
Prénom Nom du relecteur
Earlier this month, ICANN announced that it had
assigned the last remaining blocks of IPv4 available under its control.
Essentially, this means that for regions without free addresses, it will no
longer be possible to get new devices to directly connect to the
Internet.
With that in mind, I decided to learn a bit more
about IPv6, and to try to get a Linux server working with an IPv6 address. In
this article, I am not going to go over the basics of IPv6 and how it compares
to IPv4. You can read all about that on
Wikipedia.
I also don’t claim to be an IPv6
expert or a networking expert. In fact, part of this article is based on
IPV6 Go6 Mini-HowTo
from 2008. I basically used it
to set up my own host, but had to do quite a few modifications for it to work
in 2011. I will show you how to set up a linux box to connect the
Internet using IPv6 using the gogo client from Freenet6.net.
I will also show you how to set up lighttpd to serve pages on IPv6, and a few other IPv6 related
tools.
Before we start, let me give you everything I
needed to get up and running :
A linux host with root access and
Internet connectivity : I have a slicehost running CentOS 5.5, running as a dns
and web server (lighttpd).
An account :
The freenet6 gogoCLIENT :
Making sure your linux box is IPv6 ready
Check for the ipv6 kernel module :
$ /sbin/lsmod | grep ipv6
ipv6 222188 xxxxx
Check for ifconfig output :
$ /sbin/ifconfig | grep inet6
inet6 addr: fe80::4240:6fff:fef7:334a/64 Scope:Link
If neither of the above commands return the
desirable output then check your /etc/modprobe.d/blacklist and make sure ipv6
isn’t being blacklisted. If it is, comment it out and load the
module :
$ /sbin/modprobe ipv6
Installing and Setting up the gogoCLIENT
Download the client :
$ wget http://gogo6.com/downloads/gogoc-1_2-RELEASE.tar.gz
Install the router advertisement daemon for IPv6 :
$ yum install radvd
Enable IPv6 forwarding kernel parameter :
$ echo “net.ipv6.conf.default.forwarding=1” >> /etc/sysctl.conf
$ sysctl -p
Install necessary packages to compile package :
$ yum install gcc gcc-c++ openssl-devel
$ make
Untar, compile and install package :
$ tar -zxvf gogoc-1_2-RELEASE.tar.gz
$ cd gogoc-1_2-RELEASE
$ make target=linux install installdir=/usr/local/gogoc
Configure gogoc :
$ cd /usr/local/gogoc
$ mkdir etc logs
$ mv bin/gogoc.conf* etc
Edit gogoc.conf and change the following
parameters :
userid=<enter the id you created with freenet6
passwd=<chosen password>
server=broker.freenet6.net
auth_method=any
host_type=router
if_prefix=eth0 # or whatever device you are
going to connect to the Internet with
log_file=2
log_filename=/usr/local/gogoc/logs/gogoc.log
Set up a service script, source of script :
$ cd /etc/init.d
$ wget https://github.com/afsilva/config-files/raw/master/gogoc
$ chmod 755 gogoc
$ chkconfig --add gogoc
$ chkconfig --list gogoc
At this point you should be able to connect to freenet6 :
$ service gogoc start
Testing connection :
$ ping6 -n ipv6.google.com
PING ipv6.google.com(2001:4860:b007::67) 56 data bytes
64 bytes from 2001:4860:b007::67: icmp_seq=0 ttl=53 time=274 ms
64 bytes from 2001:4860:b007::67: icmp_seq=1 ttl=53 time=274 ms
Finding out your IPv6 address :
$ /sbin/ifconfig | grep Global
inet6 addr: 2001:5c0:1400:b::9e55/128 Scope:Global
You can also install elinks, and go to .
Enabling IPv6 on lighttpd
Add the following to your /etc/lighttpd config :
$SERVER["socket"] == "[YOUR_IPv6_ADDRESS]:80"
{
accesslog.filename = "/var/log/lighttpd/ipv6.access.log"
server.document-root = "/var/www/html6/"
}
Replace YOUR_IPv6_ADDRESS with the IPv6 assigned
to you by gogoc.
Make sure you create the /var/www/html6/
directory (or whatever other directory you want your document-root to be) and
place an index.html in there.
Restart lighttpd :
$ service lighttpd restart
And you should be good to go. To test via
command line with links :
$ links http6://YOUR_IPv6_ADDRESS/
Or on your firefox, if you have an IPv6 provider, use the following
(don’t forget the brackets) :
http://[YOUR_IPv6_ADDRESS]/
Finally, if you want to have your IPv6 address
on your DNS server, add the following to your domain’s zone
file :
some_subdomain IN AAAA YOUR_IPv6_ADDRESS
Don’t forget to update your zone
file’s serial number and restart named service.
You should now be able to access your IPv6 web
server via a browser with the address : http://some_subdomain.yourdomain.com
À propos de l'auteur
Anderson Silva works as an IT Release Engineer at Red Hat, Inc. He holds a
BS in Computer Science from Liberty University, a MS in Information Systems
from the University of Maine. He is a Red Hat Certified Architect and has
authored several Linux based articles for publications like: Linux Gazette,
Revista do Linux, and Red Hat Magazine. Anderson has been married to his
High School sweetheart, Joanna (who helps him edit his articles before
submission), for 11 years, and has 3 kids. When he is not working or
writing, he enjoys photography, spending time with his family, road
cycling, watching Formula 1 and Indycar races, and taking his boys karting,
Adaptation française de la Gazette Linux
L'adaptation française de ce document a été réalisée dans le cadre du Projet de traduction de la Gazette Linux.
Vous pourrez lire d'autres articles traduits et en apprendre plus sur ce projet en visitant notre site : .
Si vous souhaitez apporter votre contribution, n'hésitez pas à nous rejoindre, nous serons heureux de vous accueillir.