OpenWrt Forum Archive

Topic: Howto ipv6 on km 8.09

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

I spent several nights to get running Ipv6 on my wrt54g,
now I share my experience and wrote this post to
all want get Ipv6 ready.

Environment:

Linksys wrt54g v2
Kamikaze 8.09 brcm-2.4 r14511

Ipv6 provider: http://tunnelbroker.net/

(all ip addresses are changed)
Server IPv4 address: 216.66.80.30
Server IPv6 address: 2001:345:567a:12ab::1/64
Client IPv4 address: 62.143.121.121
Client IPv6 address: 2001:345:567a:12ab::2/64
Routed /64: 2001:345:567b:12ab::/64

Clients:
Win2k3 Server Std.
Debian Lenny  2.6.26-1-xen-amd64 with e16


Installation:

At first I flashed the Wrt54g with the firmware to have
a clean installation as starting point and adjusted the
internet connection.

This is my /etc/config/network:

#### VLAN configuration
config switch eth0
        option vlan0    "1 2 3 4 5*"
        option vlan1    "0 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0
        option ip6addr  2001:345:567b:12ab::1/64

#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp
        option macaddr  00:0F:66:30:F7:A3

This is almost the original config except two lines.

option ip6addr

With this option you assign an static
Ipv6 from the /64 subnet you get from Tunnelbroker.

option macaddr

This I need to get an Ipv4 address
of my ISP. This is also useful when you want to separate
your WAN from your LAN on layer 2.


In next step I removed unnecessary services like the
web-interface and the WLAN apps from the Kamikaze installation.

opkg remove luci-admin-full luci-admin-core luci-admin-mini luci-app-firewall luci-http luci-i18n-english luci-ipkg luci-sgi-cgi luci-theme-openwrt luci-theme-base luci-sys wire less-tools ppp-mod-pppoe ppp kmod-pppoe kmod-ppp kmod-brcm-wl kmod-wlcompat

Also removed the http daemon from autostart:

rm /etc/rc.d/S50httpd

Reboot once at this point and hope all works well.

Now let's start with the Ipv6 stuff:

The default Kamikaze installation doesn't support Ipv6.
You have to install some packages and kernel modules.

opkg install ip kmod-ipv6 kmod-ip6tables ip6tables radvd

The router advertisement daemon (radvd) is run by Linux
or BSD systems acting as IPv6 routers.

After installation is finished reboot again.

Next step is to create a script that initialize/creates a
tunnel interface that connect  to Tunnelbroker and give you
access to the Ipv6 world.

Create a file /etc/init.d/tunnel (replace the addresses):

#!/bin/sh /etc/rc.common
LOCALIP=62.143.121.121
POPIP=216.66.80.30
LOCTUN= 2001:345:567a:12ab::2
REMTUN= 2001:345:567a:12ab::1

START=48

start() {
        echo -n "Starting TunnelBroker.net IPv6 tunnel: "
        echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
        ip tunnel add he-ipv6 mode sit local $LOCALIP remote $POPIP
        ip link set he-ipv6 up
        ip -6 addr add $LOCTUN/64 dev he-ipv6
        ip -6 ro add default via $REMTUN dev he-ipv6
        echo "Done."
}
stop() {
        echo -n "Stopping TunnelBroker.net IPv6 tunnel: "
        ip link set he-ipv6 down
        ip tunnel del he-ipv6
        #ip -6 addr del $REMTUN/64 dev br-lan
        echo "Done."
}
restart() {
        stop
        start
}

Make the file executable

chmod +x /etc/init.d/tunnel

do

/etc/init.d/tunnel start

to start the tunnel.

After that ifconfig will show a new interface named he-ipv6.

Ifconfig output:

[...]
he-ipv6   Link encap:IPv6-in-IPv4 
          inet6 addr: fe80::3e8f:c675/128 Scope:Link
          inet6 addr: 2001:345:567a:12ab::2/64 Scope:Global
          UP POINTOPOINT RUNNING NOARP  MTU:1480  Metric:1
          RX packets:932 errors:0 dropped:0 overruns:0 frame:0
          TX packets:928 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:741279 (723.9 KiB)  TX bytes:150841 (147.3 KiB)
[...]

Now you should be able to ping Ipv6 hosts with your Wrt54.

Ping6 output to heise.de:

root@OpenWrt:~# ping6 www.six.heise.de
PING www.six.heise.de (2a02:2e0:3fe:100::6): 56 data bytes
64 bytes from 2a02:2e0:3fe:100::6: seq=0 ttl=60 time=16.068 ms
64 bytes from 2a02:2e0:3fe:100::6: seq=1 ttl=60 time=18.756 ms
64 bytes from 2a02:2e0:3fe:100::6: seq=2 ttl=60 time=20.015 ms
[...]

OK, now we configure Radvd on the Wrt54 to propagate your
Ipv6 subnet to the clients on your lan. Edit the config of Radvd
and replace the addresses in the top.

Edit /etc/config/radvd (replace the addresses):

config interface
        option interface        'lan'
        option AdvSendAdvert    1
        option AdvManagedFlag   0
        option AdvHomeAgentFlag 0
        option AdvOtherConfigFlag 0
        option ignore           0

config prefix
        option interface        'lan'
        # If not specified, a non-link-local prefix of the interface is used
        option prefix           '2001:345:567b:12ab::/64'
        option AdvOnLink        1
        option AdvAutonomous    1
        option AdvRouterAddr    1
        option ignore           0

config rdnss
        option interface        'lan'
        # If not specified, the link-local address of the interface is used
        option addr             ''
        option ignore           1

Then start the daemon:

/etc/init.d/radvd start

Radvd will create and assign an Ipv6 address based on Mac
to the clients. This is my ifconfig eth0 on my Debian:

Before run Radvd:

xen:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:22:15:17:0b:62 
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::222:15ff:fe17:b62/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:541816 errors:0 dropped:0 overruns:0 frame:0
          TX packets:521016 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:277187766 (264.3 MiB)  TX bytes:65876873 (62.8 MiB)

After run Radvd:

eth0      Link encap:Ethernet  HWaddr 00:22:15:17:0b:62
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2001:345:567b:12ab:222:15ff:fe17:b62/64 Scope:Global
          inet6 addr: fe80::222:15ff:fe17:b62/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:551199 errors:0 dropped:0 overruns:0 frame:0
          TX packets:530978 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:280487014 (267.4 MiB)  TX bytes:67768160 (64.6 MiB)

On Win2K3 ( and maybe Xp but not tested) you need to
install Ipv6 first.

Do:

netsh interface ipv6 install

in the command line. Thats all.


Now you're able to access Ipv6 hosts from your LAN.
Example go to http://www.kame.net and see the
turtle dancing.


Finally step is to activate the services to autostart on boot. It's
important that Radvd comes up after the tunnel is created. To
grant this do on the Wrt54g:

ln -s /etc/init.d/tunnel /etc/rc.d/S50tunnel
ln -s /etc/init.d/radvd /etc/rc.d/S85radvd

For those who doesn't have the comfort of a static ipv4 there is
a howto to tell Tunnelbroker your actually Ipv4:

www.tunnelbroker.net

Hope this help to join the Ipv6 net for testing and tell people that
it really works.


Help is based on:
http://oldwiki.openwrt.org/IPv6_howto.h … t.org/IPv6

http://www.757.org/~joat/wiki/index.php … ia_OpenWRT

Thanks for this wonderful HOWTO.


Could you add the "SIT" package for install?

I could not setup the HE-IPv6 interface before installing the package:
sit
& also
kmod-iptunnel4


I don't know if it's necessary but i found it at:

http://forum.openwrt.org/viewtopic.php?id=18475


Again... thanks... it works...


Did not check the RADVD config though,

The discussion might have continued from here.