What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Adventures in ipv6 subnetting in SDN

thesilence

New Around Here
Hi. After installing Merlin 3006.102.5 on my new rt-be92u I was trawling through the menus and found Network>(network)>Advanced Settings>IPV6. As I have a /48 via 'native' I thought I'd give it a test, immediately breaking ipv6 SLAAC. A quick ssh into the router saw that the switch had sliced the main network's /64 into a /72 instead of subnetting another 64 from /48, not good. Does this work for anyone with "native" ipv6? I understand that the SDN stuff is considered 'beta' here.

The TLDR is that I got this working, automatically providing separate /64's to the main and any guest networks I choose, entirely from the GUI. I needed to tweak the bridges via ssh to remove eth1.(vlan#) to stop windows machines on the LAN getting confused with multiple ULA routing, but all other devices seem to work immediately.
If someone can point me to where the subnetting calculations take place in the code that would be great, because my success is a hack and I don't fully understand why LAN prefixes are not always /64 here, it feels like a typo someplace has calculations on LAN prefix length instead of the delegation size, at least.

If anyone is interested in testing, for this recipe you'll need:
- an ISP who provides a _static_ /56 or /48
- at least 1 guest network that does not use the same network as the main network
- Network>(guest network)>Advanced Settings>IPV6

1. configure static ipv6 with a /56 LAN prefix length. If you have a /48 it still needs to be /56 to work.
2. apply. This will give /56 subnets on the main network, breaking ipv6 until the next step.
3. enable Network>(network)>Advanced Settings>IPV6
4. apply. This will nibble away at the /56 subnet, and ta-da, all /64's, with the main network and any guest networks each getting their own /64 out of the /56 delegation.

Any ideas why this works and 'native' doesn't?
 
I'm seeing the same issue. When I set IPv6 mode to Native, my WAN prefix length is /56, and the LAN prefix shows as /64 as long as there are no IPv6 SDNs enabled.

But as soon as I enable IPv6 for any SDN, the LAN prefix is truncated to /72, and all SDNs also get /72, which breaks SLAAC.

@RMerlin is it possible to fix this? With a /56 prefix from the ISP, there should be enough space for 256 × /64 subnets, so the current logic of slicing into /72 looks wrong.
 
I'm not making any changes to the SDN code. It's insanely complex, spread all over the entire firmware, probably has pieces that are within the closed source components, and any change may break at any time that Asus decides to make changes to it.
 
The delegated prefix size is supposed to be saved in ipv6_prefix_len_wan variables, but SDN only refers to the ipv6_prefix_length variables which always get set to 64:
Maybe a side effect of this earlier commit (not saying it’s wrong):
 
I'm not making any changes to the SDN code. It's insanely complex, spread all over the entire firmware, probably has pieces that are within the closed source components, and any change may break at any time that Asus decides to make changes to it.
Got it. I will probably double-check this behavior on the stock firmware and report the issue to Asus.
 
I'm not making any changes to the SDN code.
Can't say that I blame you :) it's a can of worms I don't think I'll open now that @dave14305 has gone to all the effort of investigating what is going on (sorry dave14305). If I wanted to knock up a script to setup the effect while using 'native' ipv6 without gui involvement, would I be right in thinking:
- on wan-start (or assume its static?):
- get the real prefix len from ipv6_prefix_len_wan
- calculate a new /64 subnet based on the current ipv6_prefix/len
- add/change ip6tables rules for the associated bridge in SDN_FI (via firewall-start?)
- add/change an ipv6 addr to the bridge (via? is lan-start a thing?)
- add a route for the calculated subnet via the bridge
- add ipv6 related bits to dnsmasq-IDX.conf.add
- restart dnsmasq
I guess I have a little work to do... :)
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top