Sunday 2011-12-18

The stock Netgear WNR3500L firmwares that support IPv6 do not seem stable, I saw daily lockups after enabling the 6to4 anycast tunnel on

  1. WNR3500L-V1.2.2.44_35.0.53.chk
  2. WNR3500L-V1.2.2.40_34.0.48NA.chk
  3. WNR3500L-V1.2.2.30_34.0.37NA.chk

I switched to Tomato by loading the dd-wrt mini image dd-wrt.v24-14896_NEWD-2_K2.6_mini-WNR3500L.chk then booting tomato-K26USB-1.28.7486.4MIPSR2-Toastman-RT-Ext.bin

I mke2fs'd and e2label'd a usb thumbdrive for optware, then installed optware, then the buildroot and optware-devel ipkgs so I can compile binaries on the router directly.

For DNS64 support, I used totd, and for NAT64, tayga. Totd ./configure --prefix=/opt and make's, however the make script is broken and the make depend and make install do not work. Just make and copy totd to /opt/sbin and the example config to /opt/etc/totd.conf

With tayga, you need to remove lines 121-126 in tayga.c, then it ./configure --prefix=/opt and makes nicely.

I wanted totd to cooperate with dnsmasq, so I moved dnsmasq to port 5353, set totd up on port 53 with a forwarder to dnsmasq on port 5353.

I also wanted to use the well-known 64:ff9b::/96, so the configs end up like:

# totd.conf
forwarder 127.0.0.1 port 5353
prefix 64:ff9b:: 
port 53
pidfile /opt/var/run/totd5005.pid
# tayga.conf
tun-device nat64
ipv4-addr 192.168.255.1
ipv6-addr 2002:7457:6022:1:ffff::1
prefix 64:ff9b::/96
dynamic-pool 192.168.255.0/24
data-dir /opt/var/tayga
# /opt/etc/init.d/tayga
tayga_setup() {
        lsmod | grep -q "^tun " ||
                modprobe tun
        ifconfig nat64 || 
                /opt/sbin/tayga --mktun
        ip link show nat64 | grep -q UP ||
                ip link set nat64 up
        ip -4 addr show dev nat64 | grep -q 192.168.1.1 || 
                ip -4 addr add 192.168.1.1 dev nat64
        ip -4 route show | grep -q 192.168.255 ||
                ip -4 route add 192.168.255.0/24 dev nat64
        ip -6 addr show dev nat64 | grep -q 2002:7457:6022 ||
                ip -6 addr add 2002:7457:6022::1 dev nat64
        ip -6 route show | grep -q 64:ff9b ||
                ip -6 route add 64:ff9b::/96 dev nat64
        iptables -L FORWARD -n | grep -q nat64 || {
                iptables -I FORWARD 1 -i nat64 -j ACCEPT
                iptables -I FORWARD 1 -o nat64 -j ACCEPT
        }
        /opt/sbin/tayga
}
# interfaces on the router
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether c0:3f:0e:0f:8b:84 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c23f:eff:fe0f:8b84/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,ALLMULTI,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether c0:3f:0e:0f:8b:86 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c23f:eff:fe0f:8b86/64 scope link
       valid_lft forever preferred_lft forever
26: nat64: <POINTOPOINT,MULTICAST,NOARP,UP,10000> mtu 1500 qdisc pfifo_fast qlen 500
    link/[65534] 
    inet 192.168.1.1/32 scope global nat64
    inet6 2002:7457:6022::1/128 scope global 
       valid_lft forever preferred_lft forever
42: vlan1@eth0: <BROADCAST,MULTICAST,ALLMULTI,UP,10000> mtu 1500 qdisc noqueue 
    link/ether c0:3f:0e:0f:8b:84 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c23f:eff:fe0f:8b84/64 scope link 
       valid_lft forever preferred_lft forever
43: vlan2@eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue 
    link/ether c0:3f:0e:0f:8b:85 brd ff:ff:ff:ff:ff:ff
    inet 116.87.96.34/24 brd 116.87.96.255 scope global vlan2
    inet6 fe80::c23f:eff:fe0f:8b85/64 scope link 
       valid_lft forever preferred_lft forever
44: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue 
    link/ether c0:3f:0e:0f:8b:84 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br0
    inet6 2002:7457:6022:1::1/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::c23f:eff:fe0f:8b84/64 scope link 
       valid_lft forever preferred_lft forever
45: sit0: <NOARP> mtu 1480 qdisc noop 
    link/sit 0.0.0.0 brd 0.0.0.0
46: v6to4@NONE: <POINTOPOINT,NOARP,UP,10000> mtu 1480 qdisc noqueue 
    link/sit 116.87.96.34 peer 192.88.99.1
    inet6 2002:7457:6022::1/16 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::7457:6022/128 scope link 
       valid_lft forever preferred_lft forever

Annoyances:

  1. Tomato's gui doesn't let you subnet your lan below a /64
  2. tcpdump doesn't have ipv6 support compiled in

We'll see how this works over time...

Well, that was quick. The anycast ipv6 server near me is rotating IPv6s faster than once a day, or I'm bouncing between anycast hosts. Time to try a hurricane electric tunnel...