6rd + Kea DHCPv6-PD with dynamic prefixes woes.

Started by HiTekRedNek, Today at 03:07:29 AM

Previous topic - Next topic
My ISP only provides IPv6 via 6rd. I was attempting to use Identity Association plus Kea's IPv6 to pass a dynamic /60 PD to my core switch.

The problem is that my WAN interface doesn't have an IPv6 address or prefix. That's the wan_stf interface. But the code doesn't seem to look there for dynamic prefix option in Kea -> DHCPv6

It just passes "dead:beef:x:x:x" as the prefix, never the actual prefix given to me via 6rd.

Today at 06:05:28 AM #1 Last Edit: Today at 06:29:18 AM by Monviech (Cedrik)
The code only cares for a prefix existing in this file:

https://github.com/opnsense/core/blob/8b88393932c94b7dafea941803ae0fe34f966888/src/opnsense/mvc/app/library/OPNsense/Interface/Autoconf.php#L41

So if in your case there is no delegated prefix with a file like "/tmp/igc1_prefixv6" (-dont know the exact name right now, also depends on your interface name-) containing your prefix it will fall back to dead:beef so kea doesnt crash.

Please say where in your case the delegated prefix is written to.

6rd does not necessarily provide a DHCPv6-delegated prefix. The available prefix may instead be derived from the 6rd configuration and the WAN IPv4 address.
Can you show your 6rd configuration and where OPNsense exposes the resulting IPv6 prefix? We currently consume the prefix made available through the normal interface prefix file mechanism.
Hardware:
DEC740

6RD/6to4 was never that well integrated to begin with when it comes to tracking changes from a WAN. ISC-DHCP may have accommodated that more adequately and you can still use it, but it's unlikely that the integration in Kea will ever be extended since 6RD is so rare to begin with and we don't have a test setup at hand.


Cheers,
Franco

Quote from: Monviech (Cedrik) on <strong>Today</strong> at 06:05:28 AMPlease say where in your case the delegated prefix is written to.

$ ifconfig wan_stf
wan_stf: flags=1004041<UP,RUNNING,LINK2,LOWER_UP> metric 0 mtu 1280
        options=0
        inet6 2602:43:9289:1e00:: prefixlen 24
        groups: stf
        v4net 0.0.0.0/32 -> tv4br 205.171.2.64
        nd6 options=101<PERFORMNUD,NO_DAD>
$


Is that not the prefix?

LAN certainly seems to think so:
ix0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        description: LAN (lan)
        options=4800028<VLAN_MTU,JUMBO_MTU,HWSTATS,MEXTPG>
        ether a0:36:9f:d2:c5:60
        inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::a236:9fff:fed2:c560%ix0 prefixlen 64 scopeid 0x1
        inet6 2602:43:9289:1e20::1 prefixlen 64
        media: Ethernet autoselect (10Gbase-Twinax <full-duplex,rxpause,txpause>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

Thanks, looks like this is outside of what was implemented for KEA.

KEA integration only works if the prefix came via DHCPv6-PD.

Anything more is @franco, I don't know enough about the other possibilities.
Hardware:
DEC740

In theory we could fake a prefix file for 6RD... you could even do so yourself by issuing:

# ifctl -p6 -i wan_sft -a 2602:43:9289:1e00::/56

(or whatever the effective prefix is)

I'm not sure about prefix lifetime management and recycle, but OTOH the prefix doesn't shift in these setups to my knowledge.

It would also take care of https://github.com/opnsense/core/issues/11208 adding the missing null route.


Cheers,
Franco

If the prefix doesnt change in these setups using dynamic prefix delegation is kinda moot anyway.

Static prefix delegation would be the way to go in KEA then.

https://docs.opnsense.org/manual/kea.html#static-prefix
Hardware:
DEC740

Fair point.  ;)

If, however, the fix is that small we can do it.


Cheers,
Franco

Ive got no objections in that case :)
Hardware:
DEC740