Internet only vlan with IPv6

Started by lancable, November 19, 2026, 09:37:07 AM

Previous topic - Next topic
Hey all,

I have setup an internet only vlan for some IOT devices. The goal is self explanatory; the devices are only allowed to communicate with the internet. There are some exceptions with specific firewallrules.

I've added IPv6 into the mix, but the way I block access to other subnets feels a bit cumbersome. I created a rule that blocks all other "nets". Beneath that I've added a rule to allow IPv6. It works, but it feels stil cumbersome.

Is there something that I am missing, or is this the only way to create a Internet Only vlan with IPv6? Maybe some secret button I can push or firewall rule I can enable?

Thanks in advance!

You can use a destination invert in a single rule.

"allow to anything but my local network"
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

November 19, 2026, 09:48:38 AM #2 Last Edit: November 19, 2026, 09:50:36 AM by OPNenthu
If you have dynamic GUAs (not sure if that's your situation) the problem is that you cannot define "my local network" in IPv6.

Until we get this: https://github.com/opnsense/core/issues/7000

I'm really hoping for this one to finally land in 27.1 so that I can move away from NPTv6 and define proper GUA boundaries.
N5105 | 8/250GB | 4xi226-V | Community

November 19, 2026, 09:50:42 AM #3 Last Edit: November 19, 2026, 09:53:18 AM by lancable
both thanks for your replies!

@patrick what would that rule look like? I don't know how tot define my local network with GUA addresses.

At this moment I'm using the aliases for my other networks, that end with "network". It works, but is this the best way?

A different approach is using policy routing. Create an "allow IOT IPv6 to any" rule with the gateway set to your IPv6 WAN gateway. Then add higher priority rules without a gateway for local services / subnets you want to make accessible.

A little crude, but works.

Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Quote from: Maurice on November 19, 2026, 06:53:16 PMA different approach is using policy routing. Create an "allow IOT IPv6 to any" rule with the gateway set to your IPv6 WAN gateway. Then add higher priority rules without a gateway for local services / subnets you want to make accessible.

A little crude, but works.

Cheers
Maurice

Thank you for your answer Maurice! This seems easy and elegant enough!
I dont have much experience with policy routing. Can you tell me why / how this works?

Thanks!

He already wrote that - just as I did for my suggestion.

In your allow rule explicitly set the gateway. There's a "gateway" field in the options.
Just like there is a "destination invert" field in the rule options that you could use with an alias containing your other local networks.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Patrick explained how to configure it. Why / how it works: A firewall rule with a gateway directs all matching packets to this gateway, ignoring the routing table (hence "policy routing" - the firewall rule is the policy which makes the routing decision). So all packets coming from the IoT network get sent to your WAN gateway, even if their destination address is in one of your private networks. The upstream gateway then either drops them or sends them back to OPNsense, in which case they get treated like any other packet coming in on the WAN.

Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).