Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Can OPNsense delegate an IPv6 prefix to another router/firewall?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Can OPNsense delegate an IPv6 prefix to another router/firewall? (Read 2044 times)
Patrick M. Hausen
Hero Member
Posts: 6812
Karma: 572
Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
on:
September 01, 2023, 12:03:32 am »
Hi all,
subject says it. Most threads here and the docs are concerned with OPNsense getting a proper prefix delegation from an ISP or an upstream router. Question is: can OPNsense server as an upstream router and delegate an e.g. /62 to another router behind it?
Thanks,
Patrick
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #1 on:
September 01, 2023, 07:24:35 am »
Yep, DHCPv6 can do that (below pool setting). In fact in the automatic mode (from tracked interface) it tries to also make available a prefix depending on the prefix size constraints on the WAN.
Usually the biggest prefix to delegate is the WAN prefix + 1. So if you want to delegate one /62 you need a /61 on WAN. If you need two /62 it has to be a /60 etc.
Cheers,
Franco
Logged
robgnu
Full Member
Posts: 122
Karma: 8
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #2 on:
September 01, 2023, 08:40:53 am »
Yes, it works very well.
Here are our settings:
- RA set to "Assisted"
- DHCPv6 enabled:
- Range from :: to ::ffff:ffff:ffff:ffff
- Prefix Delegation Range from ::d0 to ::f0
- Prefix Delegation Size: 60
- Firewall rules on your needs. :-)
Best regards
Rob
Logged
Maurice
Hero Member
Posts: 1213
Karma: 158
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #3 on:
September 01, 2023, 02:13:40 pm »
It works, but has a few caveats (at least it did last time I tried it):
The downstream router also needs to request an address via DHCPv6, not just a prefix. Reason is that OPNsense uses this address for routing the prefix, not the downstream router's link-local address as one might expect.
Firewall rules for the prefix(es) delegated to downstream need to be configured statically, which can be an issue if you get a dynamic PD from upstream.
Cheers
Maurice
Logged
OPNsense virtual machine images
OPNsense aarch64 firmware repository
Commercial support & engineering available. PM for details (en / de).
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #4 on:
September 05, 2023, 09:09:11 am »
Both true but one comment:
> The downstream router also needs to request an address via DHCPv6, not just a prefix. Reason is that OPNsense uses this address for routing the prefix, not the downstream router's link-local address as one might expect.
Nowadays you can use a static mapping as well:
https://github.com/opnsense/core/commit/a73813684721
Cheers,
Franco
Logged
Maurice
Hero Member
Posts: 1213
Karma: 158
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #5 on:
September 06, 2023, 04:30:51 pm »
Hi Franco,
Neat, thanks for the hint! Not dynamic yet, but definitely an improvement.
Could we make this work with link-local addresses in the static DHCPv6 mappings? Then you wouldn't have to add ULAs.
Cheers
Maurice
Logged
OPNsense virtual machine images
OPNsense aarch64 firmware repository
Commercial support & engineering available. PM for details (en / de).
Patrick M. Hausen
Hero Member
Posts: 6812
Karma: 572
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #6 on:
September 06, 2023, 04:55:35 pm »
Thanks for the interesting discussion. For my small home lab I finally decided to just route a /64 statically, but interoperability is always a good thing. As is feature complete IPv6 support.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #7 on:
September 06, 2023, 09:31:04 pm »
> Could we make this work with link-local addresses in the static DHCPv6 mappings? Then you wouldn't have to add ULAs.
Sounds useful. Was wondering the same while replying earlier. You want to take a stab at it? Potentially we'd have to throw out the link-locals to make sure DHCPv6 doesn't complain about it.
Cheers,
Franco
Logged
Maurice
Hero Member
Posts: 1213
Karma: 158
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #8 on:
September 14, 2023, 02:42:47 am »
@franco I played around with link-locals in static mappings. dhcpd6 isn't bothered at all. But we have to add the scope when adding the route. What do you think about this approach? Seems to work fine.
https://github.com/maurice-w/core/commit/3b17bd4
Cheers
Maurice
Logged
OPNsense virtual machine images
OPNsense aarch64 firmware repository
Commercial support & engineering available. PM for details (en / de).
allan
Newbie
Posts: 45
Karma: 11
Re: Can OPNsense delegate an IPv6 prefix to another router/firewall?
«
Reply #9 on:
September 16, 2023, 04:56:38 pm »
One thing that tripped me up was the Prefix Delegation Range "to" value. Unlike DHCP pools, this is the
last network block
available to delegate - not the last address.
I am delegating /62 and I have the following networks available. I was entering "2603:3018:xxxx:xx3f:ffff:ffff:ffff:ffff" instead of "2603:3018:xxxx:xx3c::", and this prevented dhcpd from starting.
2603:3018:xxxx:xx30::/62
2603:3018:xxxx:xx34::/62
2603:3018:xxxx:xx38::/62
2603:3018:xxxx:xx3c::/62
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Can OPNsense delegate an IPv6 prefix to another router/firewall?