dslreports logo
 
    All Forums Hot Topics Gallery
spc
uniqs
2996

koitsu
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

3 edits

koitsu

MVM

Re: TomatoUSB and Comcast IPv6 -- bugs found

I wrote the following workaround which I've confirmed as 100% reliably working on my RT-N16 running Toastman's firmware (specifically tomato-K26USB-1.28.7499MIPSR2Toastman-RT-VPN.trx). TomatoUSB users can put this in their Administration - Scripts - WAN Up section:

#
# Workaround for modifying /etc/dhcp6c.conf to work with Comcast IPv6,
# requiring IA-NA DHCP option bit set.
#
# Note that this workaround intentionally messes up the spacing of
# the send ia-pd option; this is to ensure that if if the sed command
# is run multiple times it won't continue to append the send ia-na entry
# over and over.
#
# http://www.dslreports.com/forum/r27234575-TomatoUSB-and-Comcast-IPv6-bugs-found
#
sed -i -e's/ send ia-pd 0;/send ia-pd 0;\n send ia-na 0;/' /etc/dhcp6c.conf
kill `cat /var/run/dhcp6c.pid` && dhcp6c -T LL `nvram get wan_iface`
#
# Workaround for TomatoUSB bug where a spurious default IPv6 route is
# added for no justified reason, resulting in packets getting forwarded
# effectively to /dev/null.
#
# http://www.dslreports.com/forum/r27234575-TomatoUSB-and-Comcast-IPv6-bugs-found
#
route -A inet6 del default gw :: metric 1024 `nvram get wan_iface`
 

You can then test to make sure its working by rebooting your router or pasting the commands in to a shell (telnet/ssh) window directly. Afterwards, your WAN interface (in my case vlan2) should have an IPv6 address assigned to it labelled Scope:Global. Do not get confused by the Scope:Link entry; that's not the important one.

After that, ping6 ipv6.google.com should work and you should see ICMP responses.

A couple important things:

1. The above may not work correctly for users with complex routing environments (such as individuals using VPN tunnels or doing complex VLANing). In this case, the ping6 test may not work depending on your configuration.

To verify the above WAN Up script is working, all you need to look at is your WAN interface (in my case vlan2) and make sure there is an IPv6 address assigned labelled Scope:Global. If there is, then the WAN Up script I provided is working correctly. If there isn't, then something is amiss with the dhcp6c configuration, or Comcast hasn't deployed IPv6 to your area. See below for further verification.

2. One should copy-paste the WAN Up script into the WAN Up script window; there are backticks used to run subcommands (not apostrophes!) and so on. I hope anyone even reading this thread would know that though. :-)

Validation:

root@gw:/tmp/home/root# uptime
 15:19:26 up 0 min, load average: 0.15, 0.05, 0.01
root@gw:/tmp/home/root# ping6 ipv6.google.com
PING ipv6.google.com (2001:4860:4001:803::1010): 56 data bytes
64 bytes from 2001:4860:4001:803::1010: seq=0 ttl=56 time=56.647 ms
64 bytes from 2001:4860:4001:803::1010: seq=1 ttl=56 time=46.848 ms
64 bytes from 2001:4860:4001:803::1010: seq=2 ttl=56 time=14.746 ms
64 bytes from 2001:4860:4001:803::1010: seq=3 ttl=56 time=64.740 ms
64 bytes from 2001:4860:4001:803::1010: seq=4 ttl=56 time=15.879 ms
64 bytes from 2001:4860:4001:803::1010: seq=5 ttl=56 time=16.359 ms
 
--- ipv6.google.com ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 14.746/35.869/64.740 ms
 

Verifying the dhcp6c.conf changes are working -- note the line with Scope:Global in it:

root@gw:/tmp/home/root# ifconfig vlan2
vlan2      Link encap:Ethernet  HWaddr E0:CB:4E:C0:00:C5
           inet addr:67.180.84.87  Bcast:67.180.87.255  Mask:255.255.252.0
HERE -->   inet6 addr: 2001:558:6045:9b:114c:a6be:d64d:520c/128 Scope:Global
           inet6 addr: fe80::e2cb:4eff:fec0:c5/64 Scope:Link
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:270068 errors:0 dropped:0 overruns:0 frame:0
           TX packets:88814 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:33258559 (31.7 MiB)  TX bytes:9207877 (8.7 MiB)
 

LMoreland
join:2010-07-28
Littleton, CO

1 edit

LMoreland

Member

Didn't work for me. I am running an E4200 with Tomato Firmware v1.28.0499 MIPSR2Toastman-RT-N K26 USB VPN
and I have my IPv6 settings to DHCPv6 with prefix delegation with only the accept RA from WAN ticked.

Morac
Cat god
join:2001-08-30
Riverside, NJ

1 edit

Morac to koitsu

Member

to koitsu
Just a FYI, but you should be able to replace this line:

kill `cat /var/run/dhcp6c.pid`

with

killall dhcp6c

You might want to also add a check to make sure dhcp6c is even running before just starting it.

Oh and if the WAN connection goes down, the script will run again and add another "send ia-na 0;" line to the dhcp6c.conf file, even if that line is already there. Though I think that file gets generated on WAN UP so that might be okay.

koitsu
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

1 recommendation

koitsu

MVM

said by Morac:

Just a FYI, but you should be able to replace this line:

kill `cat /var/run/dhcp6c.pid`

with

killall dhcp6c

No. There are repercussions in that case; this is a very, very bad habit to get into in shell scripting in general. Been doing this stuff since 1991. :-)
said by Morac:

You might want to also add a check to make sure dhcp6c is even running before just starting it.

I can do that. It would be as simple as:

kill `cat /var/run/dhcp6c.pid` && dhcp6c -T LL `nvram get wan_iface`
 

Checking to see if dhcp6c is already running is more or less pointless given the scope of who would be using this WAN Up script. TomatoUSB users who aren't using an IPv6 firmware and who have not enabled IPv6 would not need this script (nor should they use it). I thought this was implied, but oh well. I would rather not have to add if [ -r /var/run/dhcp6c.pid ]; then ... ; fi statements around things.
said by Morac:

Oh and if the WAN connection goes down, the script will run again and add another "send ia-na 0;" line to the dhcp6c.conf file, even if that line is already there.

Incorrect. Please take the time to read the comment that precedes the sed statement. The sed statement is written very carefully.
koitsu

1 edit

koitsu to LMoreland

MVM

to LMoreland
said by LMoreland:

Didn't work for me. I am running an E4200 with Tomato Firmware v1.28.0499 MIPSR2Toastman-RT-N K26 USB VPN and I have my IPv6 settings to DHCPv6 with prefix delegation with only the accept RA from WAN ticked.

I need output from the following commands on the router:

* ifconfig -a
* ip -6 route show
* nvram get wan_iface
* nvram get script_wanup
* tail -100 /var/log/messages

Thanks.

EDIT: I'm working with LMoreland See Profile on this. We're discussing it privately via Email.

LMoreland
join:2010-07-28
Littleton, CO

1 edit

LMoreland

Member

can you send me your email address and I will send all of that to you. You can pm it to me from this or the linksys forum. I have replied to your thread pointing here in the linksys forum.

Thanks