• Welcome to Hurricane Electric's IPv6 Tunnel Broker Forums.

News:

Welcome to Hurricane Electric's Tunnelbroker.net forums!

Main Menu

DD-WRT Netgear WNR3500L

Started by donbushway, June 25, 2010, 02:35:04 PM

Previous topic - Next topic

donbushway

After a week of searching and trying various scripts I finally got the Tunnel to work properly.
Here are the scripts I used. There are many posts on how to enable ipv6 on DD-wrt so I will not repeat them here.

Startup script: You will have to change to your addresses.

insmod ipv6
sleep 5

# This gets WAN IP from the router interface (vlan2 for WNR3500L)
WANIP=$(ip -4 addr show dev vlan2 | awk '/inet / {print $2}' | cut -d/ -f1) # WAN IP from vlan2

#Change these to match Tunne Details from Hurricane Electric
MY_ROUTED_ADDR="2001:470:1f0e:dead::1" # Server IPv6 Tunnel Address
MY_TUNNEL_ADDR="2001:470:1f0e:dead::2" # Client IPv6 Tunnel Address
MY_ROUTED="2001:470:1f0f:dead::" # Routed /64
SERVER_IP="216.218.224.42" # Server IPv4 Address

#Save data for debug
echo "My side of Tunnel address:" $MY_TUNNEL_ADDR >> /tmp/startup.debug
echo "HE side of Tunnel address:" $MY_ROUTED_ADDR >> /tmp/startup.debug
echo "My Routed /64:" $MY_ROUTED >> /tmp/startup.debug
echo "WAN IP:" $WANIP >> /tmp/startup.debug
echo "Server IP:" $SERVER_IP >> /tmp/startup.debug

if [ -n $WANIP ]
then
echo "configuring tunnel" >> /tmp/startup.debug

# Setup Tunnel using the IPv4 addresses
ip tunnel add he-ipv6 mode sit remote $SERVER_IP local $WANIP ttl 255
ip link set he-ipv6 up

# Configure the Tunnel
ip -6 addr add $MY_TUNNEL_ADDR/64 dev he-ipv6
ip -6 route add default via $MY_ROUTED_ADDR dev he-ipv6

# These commands aren't on HE's website, but they're necessary for the tunnel to work
ip -6 addr add $MY_ROUTED_ADDR/64 dev he-ipv6
ip -6 addr add $MY_ROUTED/64 dev br0

ip route add ::/0 dev he-ipv6 metric 1

echo "starting radvd" >> /tmp/startup.debug
radvd -C /tmp/radvd.conf &
fi

The firewall script.

iptables -I INPUT 2 -p ipv6 -i vlan2 -j ACCEPT


For RADVD you will need to change the prefix value to your routed block address.
RADVD:

interface br0 {
        AdvSendAdvert on;
        prefix 2001:470:1f0f:dead::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
        };
};

Make sure you use the routed /64 prefix here NOT the tunnel prefix. If you get strange
intermittent ping and IPv6 access double check the address prefix. Many thanks to everyone who's
scripts I used to get this working.

jmillner

This seems to be working (sort of?), but wouldn't it be easier to just make a script to get the WAN address and then update your tunnel as well? (in case the address changes?)

I'm sorry to reply to an old topic, but I think it's of value to let other people know this does in fact work.

jason404

#2
I was watching this topic, as I have the same router and was wondering what the best way to do this was.

I have not actually got around to diving into IPv6 properly yet, but could you keep me updated if you find any better way.  

Thanks.

docbill

Quote from: jason404 on January 31, 2011, 01:45:38 AM
I was watching this topic, as I have the same router and was wondering what the best way to do this was.

I have not actually got around to diving into IPv6 properly yet, but could you keep me updated if you find any better way.  

Thanks.

http://www.dd-wrt.com/wiki/index.php/IPv6#Another_approach

jason404


Llama

You're awesome, this is the first explanation  that works right away. Someone should post it on the DD-WRT wiki ;D