Hurricane Electric's IPv6 Tunnel Broker Forums

Advanced search  

News:

Welcome to Hurricane Electric's Tunnelbroker.net forums!

Pages: [1] 2

Author Topic: DD-WRT v24sp2 (build 13972) config  (Read 22058 times)

sgoudelis

  • Newbie
  • *
  • Posts: 15
DD-WRT v24sp2 (build 13972) config
« on: March 11, 2010, 04:04:38 AM »

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:

Code: [Select]
#!/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 :

Code: [Select]
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 :

Code: [Select]
# 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
Code: [Select]
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

Code: [Select]
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.
Logged

cholzhauer

  • Hero Member
  • *****
  • Posts: 2715
Re: DD-WRT v24sp2 (build 13972) config
« Reply #1 on: March 11, 2010, 05:03:37 AM »

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

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #2 on: March 11, 2010, 08:29:00 AM »

No idea what you just said. Clarify ?
Logged

cholzhauer

  • Hero Member
  • *****
  • Posts: 2715
Re: DD-WRT v24sp2 (build 13972) config
« Reply #3 on: March 11, 2010, 08:55:32 AM »

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.
Logged

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #4 on: March 11, 2010, 09:27:28 AM »

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

Here it is

Code: [Select]
#!/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
Logged

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #5 on: March 11, 2010, 09:29:43 AM »

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.
Logged

cholzhauer

  • Hero Member
  • *****
  • Posts: 2715
Re: DD-WRT v24sp2 (build 13972) config
« Reply #6 on: March 15, 2010, 08:07:39 PM »

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

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #7 on: March 16, 2010, 12:30:51 PM »

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

cholzhauer

  • Hero Member
  • *****
  • Posts: 2715
Re: DD-WRT v24sp2 (build 13972) config
« Reply #8 on: March 16, 2010, 12:40:15 PM »

Would you post your configs so I can compare?
Logged

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #9 on: March 16, 2010, 03:18:30 PM »

Code: [Select]
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.
Logged

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #10 on: March 16, 2010, 03:23:46 PM »

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.
Logged

cholzhauer

  • Hero Member
  • *****
  • Posts: 2715
Re: DD-WRT v24sp2 (build 13972) config
« Reply #11 on: March 16, 2010, 03:26:16 PM »

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?
Logged

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #12 on: March 16, 2010, 03:38:08 PM »

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.
Logged

cholzhauer

  • Hero Member
  • *****
  • Posts: 2715
Re: DD-WRT v24sp2 (build 13972) config
« Reply #13 on: March 16, 2010, 07:19:55 PM »

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;
     };
 };
Logged

sgoudelis

  • Newbie
  • *
  • Posts: 15
Re: DD-WRT v24sp2 (build 13972) config
« Reply #14 on: March 17, 2010, 03:01:56 AM »

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.
Logged
Pages: [1] 2