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).

Quote from: Maurice on <strong>Today</strong> at 12:10:21 AMSo 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.
Isn't that a bit "Polluting your ISP's network" so to speak ?!
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

Quote from: nero355 on <strong>Today</strong> at 04:40:08 PMIsn't that a bit "Polluting your ISP's network" so to speak ?!

Quote from: Maurice on November 19, 2026, 06:53:16 PMA little crude, but works.

Only if a device from the IoT network actually tries to access something forbidden in one of your private networks, which shouldn't normally happen. So we're not talking about a significant amount of traffic. And it typically won't get further than the ISP's first hop. Not a big deal imho.
OPNsense virtual machine images
OPNsense aarch64 firmware repository

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

Quote from: Maurice on <strong>Today</strong> at 04:51:11 PMOnly if a device from the IoT network actually tries to access something forbidden in one of your private networks, which shouldn't normally happen.
I forgot to ask : Can the 'NULL Route configuration' mentioned some time ago prevent that ?
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

Quote from: nero355 on <strong>Today</strong> at 05:14:46 PMI forgot to ask : Can the 'NULL Route configuration' mentioned some time ago prevent that ?

Prevent what?

For packets handled by policy routing, a null route does nothing since the routing table is ignored.

And a null route by itself cannot prevent access from one LAN to another. It just blackholes packets to destinations which don't exist.
OPNsense virtual machine images
OPNsense aarch64 firmware repository

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

Quote from: Maurice on <strong>Today</strong> at 12:10:21 AMSo 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.
I hope you are right. I have seen otherwise with the other sense and IPv6, so I will not count on that policy route with the gateway set alone.