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

OS X: manually added gif(4) routes with route(8) are removed after 24 hours?

Started by cnst, February 22, 2012, 12:34:37 PM

Previous topic - Next topic

cnst

I'm using IPv6 from AT&T through 6rd on my OS X 10.5 as per http://www.dslreports.com/forum/r26898965-6rd-just-works-indeed-Even-when-your-OS-doesn-t-support-it-, and it seems like my manually added routes seem to be disappearing about exactly 24 hours after being added.

This is how I set it up:


% printf "%02x%02x:%02x%02x\n" 99 124 XXX XXX
637c:YYYY
% printf "%02x%02x%02x%02x" 99 124 xxx xxx | awk '{print "2602:30" substr($1,1,1) ":" substr($1,2,4) ":" substr($1,6) "0::/60"}'
2602:306:37cY:YYY0::/60


sudo ifconfig gif0 tunnel 99.124.xxx.xxx 12.83.49.81
sudo ifconfig gif0 inet6 2602:306:37cY:YYY0::1 prefixlen 60
sudo route add -inet6 default -interface gif0


Also tried doing the following route instead, but it still gets nuked after 24 hours:


sudo route add -inet6 2000:: -prefixlen 3 -interface gif0


When the routes are in place, they show up like this with `netstat -rn`:


Internet6:
Destination                             Gateway                         Flags      Netif Expire
default                                 link#2                          ULSc       gif0
2000::/3                                link#2                          ULSc       gif0


Any idea how to make it stop from disappearing?  I only have en0 (GigE) enabled, with "Configure IPv4: Manually", and I even tried disabling IPv6 on en0 ("Configure IPv6: Off"), although there wasn't any IPv6 there in the first place.

Any idea who is removing my routes?

Best regards,
Constantine.

kcochran

24 hours sounds suspiciously like a typical DHCP lease time.  Might be the renewal of that is nuking your config.

Check /var/db/dhcpclient/leases/$ifname-.... see when your lease is supposed to be up, and if your routes poof at that time.

cnst

That's the thing — checked dhcp leases already (mentioned in my DSL Reports post), but here it is again:

% sudo ls -la /var/db/dhcpclient/leases/; date
total 16
drwx------  4 root  wheel  136 15 Feb 11:53 .
drwx------  3 root  wheel  102  5 Jan  2009 ..
-rw-r--r--  1 root  wheel  937 12 Aug  2010 en0-1,0:23:32:XX:XX:XX
-rw-r--r--  1 root  wheel  925 15 Feb 11:53 en1-1,0:23:12:XX:XX:XX
Thu 23 Feb 2012 08:59:54 PST


Note that these routes are being deleted 24 hours after being added, e.g. if I set it up in the morning, it's gone about the same time next morning, or if I set it up in the evening (e.g. I came up with the 2000::/3 route in the evening), it's gone at about the same time next evening (in other words, it doesn't just happen at a certain point during the day every day).

Maybe routes that lack an explicit IP address of the gateway automatically expire in 24 hours?  But do note that the "Expire" field is seemingly empty for both routes.

cnst

OK, I think adding an explicit IP address of the gateway (IPv6 of gif0) seems to have solved it:  yesterday morning, I added "default — gif0" and "2000::/3 — 2602:306:37cY:YYY0::1", and only the route with the implicit IP address (gif0) has disappeared.  I have now re-added "default" with an explicit gif0 IPv6, too.

So, the solution seems to be: explicitly specify your 6rd IPv6 address (of gif(4)) as the default gateway.

Either one of these should do (I think doing "default" instead of "2000::/3" is more correct, but it's basically about the same, as per http://www.iana.org/assignments/ipv6-address-space and http://www.iana.org/assignments/ipv6-unicast-address-assignments):

sudo route add -inet6 default 2602:306:36cY:YYY0::1
sudo route add -inet6 2000:: -prefixlen 3 2602:306:36cY:YYY0::1


Doing both rules results in the following `netstat -rn` (only relevant parts shown):

Internet6:
Destination                             Gateway                         Flags      Netif Expire
default                                 2602:306:36cY:YYY0::1           UGSc       gif0
2000::/3                                2602:306:36cY:YYY0::1           UGSc       gif0


Notice that flags for the routes in question are now different (UGSc instead of ULSc), but, based on the docs within netstat(1) itself, it's unclear why implicit IP addresses cause the route to be disappearing 24 hours after being added.