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

DD-WRT v24sp2 (build 13972) config

Started by sgoudelis, March 11, 2010, 04:04:38 AM

Previous topic - Next topic

sgoudelis

Hello,

I would like some feedback on my setup. Currently in my home lan I have a dd-wrt (as described in the subject) and I use this script to bring the ipv6 setup online:


#!/bin/sh

MY_TUNNEL_ADDR="2001:470:XXXX:103e::2" # change me
MY_ROUTED_ADDR="2001:470:XXXX:103e::1" # change me
TIP="216.66.80.30"
LOG_OUTPUT_FILE="/mnt/ipv6-startup.debug"

insmod ipv6
insmod sit

sleep 5

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding

trap 'echo 0' 1
while [ true ]
do
    IPV4=`ifconfig ppp0 | grep "inet addr" | sed -e "s+inet addr:++" -e "s+Bcas.*++" -e "s+ *++" | cut -d ' ' -f 1`

if [ "$IPV4" != "$OLDIP" ]
then
  sh /mnt/updateipv4.sh > $LOG_OUTPUT_FILE
  echo "Configuring tunnel, remote $TIP local $IPV4" >> $LOG_OUTPUT_FILE

  ip tunnel add he-ipv6 mode sit remote $TIP local $IPV4 ttl 255
  ip link set he-ipv6 up
  ip addr add $MY_TUNNEL_ADDR/64 dev he-ipv6
  ip route add ::/0 dev he-ipv6 metric 256

  # Not strictly necessary, but sometimes handy
  ip addr add $MY_ROUTED_ADDR/64 dev br0
 
  # 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_ADDR/64 dev br0
  #ip route add 2000::/3 dev he-ipv6 metric 1
 
  echo "Starting radvd" >> $LOG_OUTPUT_FILE
  killall radvd
  radvd -C /mnt/radvd.conf &
  iptables -I INPUT 2 -p ipv6 -i ppp0 -j ACCEPT
fi

OLDIP="$IPV4"
sleep 60

done


This is merged from several scripts I found online.


My radvd.conf is :


interface br0 {
       AdvSendAdvert on;
       prefix 2001:470:XXXX:103e::/64
       {
               AdvOnLink on;
               AdvAutonomous on;
       };
};


My internal lan boxes get an ipv6 address. But when I try to do a ping on ipv6.google.com I get this :


# ping6 ipv6.google.com
PING6(56=40+8+8 bytes) 2001:470:xxxx:103e:223:32ff:fe91:7931 --> 2a00:1450:8006::69
Request timeout for icmp_seq=0
Request timeout for icmp_seq=1


At the same time, when I ping at 2001:470:XXXX:103e::1 the above ping starts to work! Weird.

Right now nothing works. I dont know what the cause is. Everything was fine yesterday (if you take out the above behavior).

Some extra info on this from the router

root@gw:/mnt# ip -6 addr
1: lo: <LOOPBACK,MULTICAST,UP>
   inet6 ::1/128 scope host
3: eth0: <BROADCAST,MULTICAST,PROMISC,UP>
   inet6 fe80::21d:60ff:feb6:5c2a/64 scope link
4: eth1: <BROADCAST,MULTICAST,UP>
   inet6 fe80::21d:60ff:feb6:5c2b/64 scope link
5: eth2: <BROADCAST,MULTICAST,PROMISC,UP>
   inet6 fe80::21d:60ff:feb6:5c2c/64 scope link
8: br0: <BROADCAST,MULTICAST,ALLMULTI,PROMISC,UP>
   inet6 2001:470:xxxx:103e::1/64 scope global
   inet6 fe80::21d:60ff:feb6:5c2a/64 scope link
11: he-ipv6: <POINTOPOINT,NOARP,UP>
   inet6 fe80::5549:5d17/128 scope link
   inet6 2001:470:xxxx:103e::2/64 scope global



root@gw:/mnt# ip -6 route
2001:470:xxxx:103e::/64 via :: dev he-ipv6  metric 256  mtu 1472 advmss 1412
2001:470:xxxx:103e::/64 dev br0  metric 256  mtu 1500 advmss 1440
fe80::/64 dev eth0  metric 256  mtu 1500 advmss 1440
fe80::/64 dev eth2  metric 256  mtu 1500 advmss 1440
fe80::/64 dev br0  metric 256  mtu 1500 advmss 1440
fe80::/64 dev eth1  metric 256  mtu 1500 advmss 1440
fe80::/64 via :: dev he-ipv6  metric 256  mtu 1472 advmss 1412
ff00::/8 dev eth0  metric 256  mtu 1500 advmss 1440
ff00::/8 dev eth2  metric 256  mtu 1500 advmss 1440
ff00::/8 dev br0  metric 256  mtu 1500 advmss 1440
ff00::/8 dev eth1  metric 256  mtu 1500 advmss 1440
ff00::/8 dev he-ipv6  metric 256  mtu 1472 advmss 1412
default dev he-ipv6  metric 1  mtu 1472 advmss 1412


Currently I cannot install ping6 and ip6tables in the router and I cannot look into this further.

Any comments would be greatly appreciated.

cholzhauer

I assume you're using your routed /64 in your RA configuration?

sgoudelis

No idea what you just said. Clarify ?

cholzhauer

You are assigned two different IPv6 ranges when you get your tunnel.

2001:1d8:xxxx:xxxx:/64 and 2001:1d8:xxxy:xxxx::/64

one is called your routed /64 in which the "y" bit from the second example above will be an odd value.  The range that's assigned to your tunnel (where your ::1 and ::2 come from for your endpoints) will have an even value; you should not use that one.

If you would remove the xxxx's from your config, I could tell you more easily.

sgoudelis

1f0a is the P-t-P link
1f0b is the Routed /64

Here it is


#!/bin/sh

MY_TUNNEL_ADDR="2001:470:1f0a:103e::2" # change me
MY_ROUTED_ADDR="2001:470:1f0b:103e::1" # change me
TIP="216.66.80.30"
LOG_OUTPUT_FILE="/mnt/ipv6-startup.debug"

insmod ipv6
insmod sit

sleep 5

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding

trap 'echo 0' 1
while [ true ]
do
     IPV4=`ifconfig ppp0 | grep "inet addr" | sed -e "s+inet addr:++" -e "s+Bcas.*++" -e "s+ *++" | cut -d ' ' -f 1`

if [ "$IPV4" != "$OLDIP" ]
then
   sh /mnt/updateipv4.sh > $LOG_OUTPUT_FILE
   echo "Configuring tunnel, remote $TIP local $IPV4" >> $LOG_OUTPUT_FILE

   ip tunnel add he-ipv6 mode sit remote $TIP local $IPV4 ttl 255
   ip link set he-ipv6 up
   ip addr add $MY_TUNNEL_ADDR/64 dev he-ipv6
   ip route add ::/0 dev he-ipv6 metric 1

   # Not strictly necessary, but sometimes handy
   ip addr add $MY_ROUTED_ADDR/64 dev br0
   
   # 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_ADDR/64 dev br0
   #ip route add 2000::/3 dev he-ipv6 metric 1
   
   echo "Starting radvd" >> $LOG_OUTPUT_FILE
   killall radvd
   radvd -C /mnt/radvd.conf &
   iptables -I INPUT 2 -p ipv6 -i ppp0 -j ACCEPT
fi

OLDIP="$IPV4"
sleep 60

done

sgoudelis

I just made the connection. I was using the "a" P-t-P addr for my RA in radvd.conf. Changed now. Checking the rest now.

cholzhauer

Did you ever get this to work?  I just flashed the v24 firmware to a router and am trying to troubleshoot

sgoudelis

Yeap everything works fine. I am trying to make the router use ipv6 only when ipv6 is available right now.

cholzhauer

Would you post your configs so I can compare?

sgoudelis


root@gw:/mnt# more startipv6.sh
#!/bin/sh

MY_TUNNEL_ADDR="2001:470:1f0a:103e::2" # change me
MY_ROUTED_ADDR="2001:470:1f0b:103e::1" # change me
TIP="216.66.80.30"
LOG_OUTPUT_FILE="/mnt/ipv6-startup.debug"

insmod ipv6
insmod sit

sleep 5

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding

trap 'echo 0' 1
while [ true ]
do
     IPV4=`ifconfig ppp0 | grep "inet addr" | sed -e "s+inet addr:++" -e "s+Bcas.*++" -e "s+ *++" | cut -d ' ' -f 1`

if [ "$IPV4" != "$OLDIP" ]
then
   sh /mnt/updateipv4.sh > $LOG_OUTPUT_FILE
   echo "Configuring tunnel, remote $TIP local $IPV4" >> $LOG_OUTPUT_FILE

   ip tunnel del he-ipv6
   ip tunnel add he-ipv6 mode sit remote $TIP local $IPV4 ttl 255
   ip link set he-ipv6 up
   ip addr add $MY_TUNNEL_ADDR/64 dev he-ipv6
   ip route add ::/0 dev he-ipv6 metric 1

   # Not strictly necessary, but sometimes handy
   ip addr add $MY_ROUTED_ADDR/64 dev br0
   
   # 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_ADDR/64 dev br0
   #ip route add 2000::/3 dev he-ipv6 metric 1
   
   echo "Starting radvd" >> $LOG_OUTPUT_FILE
   killall radvd           
   radvd -C /mnt/radvd.conf &
   iptables -I INPUT 2 -p ipv6 -i ppp0 -j ACCEPT
fi

OLDIP="$IPV4"
sleep 60

done


If you need radvd.conf and anything else just tell me.

sgoudelis

Oh, and remember that this is an endless loop, so put it in the background with "&". The reason for that is to re-enable the ipv6 tunnel when your dynamic ip changes.

cholzhauer

Did you enter that script from the command line (telnet or ssh) or from the webgui?

I'm assuming from the "&" you listed, you used the command line?

sgoudelis

In v24 sp2 you can mount a usb stick. I put everything there and created a startup.sh script which is executed on mount. That script starts up everything.

cholzhauer

This is what I have for my radvd.conf

interface br0 {
     AdvSendAdvert on;
     AdvHomeAgentFlag on;
     AdvLinkMTU 1280;
     MinRtrAdvInterval 3;
     MaxRtrAdvInterval 10;
     prefix [2001:470:1f11:ed::/64 {
         AdvOnLink on;
         AdvAutonomous on;
         AdvRouterAddr on;
     };
};

sgoudelis

Is this correct ?

prefix [2001:470:1f11:ed::/64 {

There is a '[' there.

And make sure that the subnet is the one the HE given you. Meaning: you are using the Routed /64 subnet.