openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
162 stars 98 forks source link

Ambiguity in router preference advertised in RA #80

Open SeSeKenny opened 8 years ago

SeSeKenny commented 8 years ago

I have deleted all previous submissions to make it crystal clear with a wireshark packet capture in clear text of an RA. No. Time Source Destination Protocol Length Info 980 60.676184 router link local client link local ICMPv6 262 Router Advertisement from router mac

Frame 980: 262 bytes on wire (2096 bits), 262 bytes captured (2096 bits) on interface 0 Ethernet II, Src: (mac), Dst: (client mac) Internet Protocol Version 6, Src: link local router, Dst: link local client Internet Control Message Protocol v6 Type: Router Advertisement (134) Code: 0 Checksum: 0xec03 [correct] Cur hop limit: 64 Flags: 0xc8 1... .... = Managed address configuration: Set .1.. .... = Other configuration: Set ..0. .... = Home Agent: Not set ...0 1... = Prf (Default Router Preference): High (1) .... .0.. = Proxy: Not set .... ..0. = Reserved: 0 Router lifetime (s): 65535 Reachable time (ms): 0 Retrans timer (ms): 0 ICMPv6 Option (Source link-layer address : mac) ICMPv6 Option (MTU : 1480) ICMPv6 Option (Prefix information : 2001:XXXX:eb3e::/64) ICMPv6 Option (Prefix information : 2001:XXXX:b2d1::/64) ICMPv6 Option (Route Information : High 2001:XXXX:eb3e::/48) ICMPv6 Option (Route Information : High 2001:XXXX:b2d1::/48) ICMPv6 Option (Recursive DNS Server 2001:XXXX:eb3e::10) ICMPv6 Option (DNS Search List Option dom.tld) ICMPv6 Option (Advertisement Interval : 1800000) So wheres the problem? Due to the single link local address assignment by openwrt by default a single RA compresses all potential addresses assignments to a single default gateway. While this seems right in theory as a single device should equal a single gateway, without NAT to process traffic in a traditional sense it leaves (public IP) source address selection up to the OS as both public prefixes share the same gateway. I'd suggest the following. Create additional link local addresses (lan side) for each public prefix (continues to allow for simple prefix changes, utilizing some sort of +1 mech for the link local so that each wan can be tracked and if one changes it can be decommissioned easily) and submit RA's for each prefix using the configured metric values on the ipv6 wan interfaces to determine high medium or low default router (not route) preference bits. From what I've seen this will take quite a significant overhaul of the way this program works, but I am going to start picking at it as it would better reflect needs of any multi wan user.

PS- also having individual ra's would allow mtu's to be calculated properly for different wan types, such as the 1480 for he.net tunnels or 1492 for dsl pppoe links, etc etc