Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 May 2008 23:04:37 +0800
From:      "Xiaobo Zhu" <albert.bowen@gmail.com>
To:        "Christer Hermansson" <mail@chdevelopment.se>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to config ipv6 for this instance
Message-ID:  <a827eca60805260804p1d43322eh36509504adb6f02f@mail.gmail.com>
In-Reply-To: <4826EC5A.8000203@chdevelopment.se>
References:  <a827eca60805091829t3b95bce9jbe4ae1ea66f8006f@mail.gmail.com> <4826330F.3020005@chdevelopment.se> <a827eca60805102355s4f20f931l49e9c316220cf51f@mail.gmail.com> <4826EC5A.8000203@chdevelopment.se>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
After a long time of study, I make things clear on my mind and finally get
ipv6 works on my FreeBSD, as well as linux platform.
The configuration itself isn't to diffcult once you know it, but the long
term of study is quite an unforgetable experience, So I'm glad to share it
with you so that time can be saved if you just want to get ipv6 worked,
instead of get deep into ipv6.

If you have any suggestions or questions, feel free to contact subert.zhu#
gmail.com.
Any feedbacks are welcome

The following step show how to configuration ipv6 on the top of ipv4.

==========Configuration for FreeBSD=========
// Create an virtula interface named gif0
#ifconfig gif0 create
// Specify the two end points of the tunnel, using ipv4 address. The first(
219.224.30.80 in this example) is the ipv4 address of your desktop, and the
second address(202.112.95.129 in this example) is the ipv4 address of the
remote server.
#ifconfig gif0 tunnel 219.224.30.80 202.112.95.129
// Specify the two end points of the tunnel, using ipv6 address. The first
is the address of your desktop, and the second is the address of the server.
Prefixlen 128 means the tunnel is host to host.
#ifconfig gif0 inet6 2001:da8:207:1:0:5efe:219.224.30.802001:da8:207:1:0:5efe:
202.112.95.129 prefixlen 128
// Add default ipv6 router to the host
#route -n add -inet6 default 2001:da8:207:1:0:5efe:202.112.95.129
// Bring the interface gif0 up
#ifconfig gif0 up
// Check if the configuration is correct.
#ping6 www.kame.net

// If you want to make it automatically configured every time boot up, add
the following lines to /etc/rc.conf
ipv6_enable="YES"
ipv6_defaultrouter="2001:da8:207:1:0:5efe:202.112.95.129"
gif_interfaces="gif0"
gifconfig_gif0="219.224.30.80 202.112.95.129"
ipv6_ifconfig_gif0="2001:da8:207:1:0:5efe:219.224.30.802001:da8:207:1:0:5efe:
202.112.95.129 prefixlen 128"



==========Configuration for Linux=========
// The following has only been tested on CentOS 5, but it should works on
other linux distributions.
// Please be aware that the ipv4 address is 172.16.120.226, instead of
219.224.30.80, I know you won't be confused. It is just on another computer.
:)

// Creat a ipv6-in-ipv4 tunnel named sit1, and specify the router's ipv4
address(202.112.95.129), as well as the client ipv4 add(172.16.120.226)
# ip tunnel add sit1 mode sit remote 202.112.95.129 local 172.16.120.226
// Active the tunnel sit1
# ifconfig sit1 up
// Asign ipv6 address to sit1
# ifconfig sit1 add 2001:da8:207:1:0:5efe:172.16.120.226/64
// Specify the default router
# ip route add ::/0 via 2001:da8:207:1:0:5efe:ca70:5f81 metric 1

// Check if the configuration is correctly.
# ping6 www.kame.net
PING www.kame.net(orange.kame.net) 56 data bytes
64 bytes from orange.kame.net: icmp_seq=0 ttl=52 time=90.3 ms
64 bytes from orange.kame.net: icmp_seq=1 ttl=52 time=90.3 ms

--- www.kame.net ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 90.340/90.364/90.389/0.301 ms, pipe 2

// If you wants to make ipv6 work every time you boot your linux, just add
the same command to /etc/rc.local. As follows:
# echo "ip tunnel add sit1 mode sit remote 202.112.95.129 local
172.16.120.226" >> /etc/rc.local
# echo "ifconfig sit1 up" >> /etc/rc.local
# echo "ifconfig sit1 add 2001:da8:207:1:0:5efe:172.16.120.226/64" >>
/etc/rc.local
# echo "ip route add ::/0 via 2001:da8:207:1:0:5efe:ca70:5f81 metric 1" >>
/etc/rc.local

good luck!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a827eca60805260804p1d43322eh36509504adb6f02f>