OPNsense Forum

English Forums => General Discussion => Topic started by: iTheMask on August 16, 2025, 12:23:54 PM

Title: Assigning Global IPv6 to LAN behind OPNsense as down-stream router
Post by: iTheMask on August 16, 2025, 12:23:54 PM
I'm trying to assign global IPv6 addresses to the LAN side of my OPNsense VM, but I could use some guidance for my unusual setup.

My setup:

Challenges:

I've already tried to use ISC DHCPv6 and Kea DHCPv6 without any success as it seems both will require static IPv6 (and even if dynamic prefix is supported I will need /64 subnet which I wasn't able to get)

What I want to achieve:
1. To use the ISP-provided /56 prefix to get out a second /64 subnet for the VMs LAN, leaving the main network untouched:
A. LAN VMs to get global IPv6 addresses via DHCPv6 with static MAC assignments
B. or SLAAC if thae DHCPv6 server is not possible
2. Worst case to get IPv6 connectivity via the /128 of OPNsense as NAT connection

Is any of these possible in OPNsense? (even if it require scripting) or is there a built-in way to handle this kind of dynamic prefix delegation?

Thanks in advance for any advice!
Title: Re: Assigning Global IPv6 to LAN behind OPNsense as down-stream router
Post by: Monviech (Cedrik) on August 16, 2025, 12:32:03 PM
I maintain a plugin that can do something for you, but its rather hacky in its nature, and if it doesnt work I cannot really help as its quite hard to troubleshoot.

If you want something generally stable, use this:

https://docs.opnsense.org/manual/ndproxy.html#offering-services-behind-nat-cloud-setup

If you want something more hacky look at the other example :)
Title: Re: Assigning Global IPv6 to LAN behind OPNsense as down-stream router
Post by: iTheMask on August 16, 2025, 12:38:21 PM
Quote from: Monviech (Cedrik) on August 16, 2025, 12:32:03 PMI maintain a plugin that can do something for you, but its rather hacky in its nature, and if it doesnt work I cannot really help as its quite hard to troubleshoot.

If you want something generally stable, use this:

https://docs.opnsense.org/manual/ndproxy.html#offering-services-behind-nat-cloud-setup

If you want something more hacky look at the other example :)
Thanks, I would love to hear about your plugin

I will keep ndproxy in mind as last resort to just establish outward connections only
Title: Re: Assigning Global IPv6 to LAN behind OPNsense as down-stream router
Post by: Monviech (Cedrik) on August 16, 2025, 12:56:28 PM
Well ndproxy is that plugin. Sorry I dont have anything else xD

This here also works but your prefix is very unstable:
https://docs.opnsense.org/manual/ndproxy.html#simple-setup-for-home-users

The one with NPTv6 in my post before is generally stable and you can NAT inbound and outbound just fine with it.
Title: Re: Assigning Global IPv6 to LAN behind OPNsense as down-stream router
Post by: Maurice on August 19, 2025, 06:33:32 PM
Quote from: iTheMask on August 16, 2025, 12:23:54 PM
  • My main router (not OPNsense) only delegates a single /64 subnet and provides addresses via SLAAC only.

If it actually delegates a /64, set the OPNsense WAN IPv6 configuration type to DHCPv6 and the prefix delegation size to 64. "Track interface" should then work on the LAN interface.

Quote from: iTheMask on August 16, 2025, 12:23:54 PM
  • Currently, OPNsense itself gets a /128 via SLAAC from the main router.

A /128 WAN address actually indicates that is was assigned via DHCPv6 - SLAAC addresses are /64. But even if your main router provides addresses via SLAAC only, prefix delegation is independent from address assignment and always uses DHCPv6.

Quote from: iTheMask on August 16, 2025, 12:23:54 PM2. Worst case to get IPv6 connectivity via the /128 of OPNsense as NAT connection

Ugly, but possible. Works the same as IPv4 NAT: Assign a static address to the LAN interface and create an outbound NAT rule.

Cheers
Maurice