OPNsense VLAN Planner
Define your segments and the traffic you allow between them. Get aliases, the rule order for every interface and the overlaps with Docker and Podman networks.
| VLAN ID | Segment | OPNsense interface | IPv4 CIDR | Internet | Remove |
|---|---|---|---|---|---|
The Internet box adds a final Pass to any rule, so the segment can reach the internet. Without it the OPNsense default deny applies.
| From | To | Protocol | Destination port | Remove |
|---|---|---|---|---|
List ports with commas or give a range: 443, 8443, 20000-20100. ICMP needs no port.
If Docker has bip set, its subnet is checked. An overlap with a pool is a potential conflict: the pool hands out a subnet from there only once it gets that far. Compare with the host routes.
For every rule: Direction In, TCP/IP Version IPv4, Quick on, Source port any. Pass rules use normal state tracking.
Put the allow rules above the blocks. Move an existing broad Pass below the blocks or replace it. Floating, interface group and automatic rules are evaluated earlier and can change the result.
The This Firewall block closes DNS, NTP, gateway ping and the OPNsense web UI. Allow whatever the segment needs from the firewall itself with a flow to This Firewall.
Pass to any lets through all remaining IPv4, including internal routes that are not in the blocks. IPv6, DHCP, NAT and routes are configured separately.
Aliases
| Name | Type | Content |
|---|---|---|
PHL_RFC1918 | Network(s) | 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 |
PHL_VLAN_10_NET | Network(s) | 192.168.10.0/24 |
PHL_VLAN_20_NET | Network(s) | 192.168.20.0/24 |
PHL_VLAN_30_NET | Network(s) | 192.168.30.0/24 |
PHL_PORTS_1 | Port(s) | 443, 8443 |
Rules per interface
VLAN10_LAN · VLAN 10 · LAN
| # | Action | Protocol | Source | Destination | Destination port | Description |
|---|---|---|---|---|---|---|
| 1 | Pass | TCP/UDP | PHL_VLAN_10_NET | This Firewall | 53 | Allowed flow |
| 2 | Pass | TCP | PHL_VLAN_10_NET | 192.168.20.15 | PHL_PORTS_1 | Allowed flow |
| 3 | Block | any | PHL_VLAN_10_NET | This Firewall | any | Block access to firewall addresses |
| 4 | Block | any | PHL_VLAN_10_NET | PHL_RFC1918 | any | Block RFC1918 networks |
| 5 | Pass | any | PHL_VLAN_10_NET | any | any | Internet access |
VLAN20_APP · VLAN 20 · APP
| # | Action | Protocol | Source | Destination | Destination port | Description |
|---|---|---|---|---|---|---|
| 1 | Block | any | PHL_VLAN_20_NET | This Firewall | any | Block access to firewall addresses |
| 2 | Block | any | PHL_VLAN_20_NET | PHL_RFC1918 | any | Block RFC1918 networks |
VLAN30_IOT · VLAN 30 · IoT
| # | Action | Protocol | Source | Destination | Destination port | Description |
|---|---|---|---|---|---|---|
| 1 | Pass | TCP/UDP | PHL_VLAN_30_NET | This Firewall | 53 | Allowed flow |
| 2 | Block | any | PHL_VLAN_30_NET | This Firewall | any | Block access to firewall addresses |
| 3 | Block | any | PHL_VLAN_30_NET | PHL_RFC1918 | any | Block RFC1918 networks |
Everything is calculated in your browser. Nothing you enter is sent or stored.
How to use it
The planner follows the usual OPNsense segmentation pattern: on every VLAN the specific allow rules come first, then a block to the firewall itself and to all private networks, and last, if needed, internet access. Traffic between segments is closed by default; only the flows you describe are open.
Enter your segments, tick the ones that need the internet and add flows, for example from LAN to a server in APP on TCP 443, or from IoT to DNS on This Firewall. The plan below updates as you type. Create the aliases in Firewall → Aliases, then the rules on each interface in Firewall → Rules in the same order.
The address check comes next. If a VLAN subnet matches a Docker or Podman network on some host, that host sends its replies into its own bridge instead of the network. Paste your daemon.json or the subnets from docker network inspect and podman network inspect.
Questions and answers
Which VLAN ID should I pick?
Anything from 2 to 4094. VLAN 1 is the default VLAN on many switches, so keep it out of your own segments. Matching the ID to the third octet helps: VLAN 20 and 192.168.20.0/24 are easy to spot in logs.
Why does the private network block come before Pass to any?
OPNsense evaluates interface rules top to bottom and, with Quick on, stops at the first match. If Pass to any sits above the block, traffic to other segments goes through it.
Why block This Firewall separately?
This Firewall means every address of OPNsense itself, on every interface. Without the block, any segment can reach the firewall web UI and SSH. That is why DNS to the gateway is allowed with its own flow above the block; without it name resolution in the segment stops.
Why does Docker break access to a segment?
Docker takes subnets for its networks from 172.17.0.0/16 and the ranges after it, and from 192.168.0.0/16 once those run out. If one of them matches your VLAN, the host treats those addresses as local and never answers clients in that segment. The fix is default-address-pools.
Is IPv6 covered?
No, the plan is IPv4 only. Add IPv6 rules separately; otherwise, with IPv6 enabled, segments can talk to each other around the blocks.
Related articles
- How my OPNsense firewall is set upVLANs, the base rule template in every segment and the specific allow rules.
- Docker default-address-poolsHow to move Docker networks off addresses your LAN already uses.
- Kea DHCP in OPNsenseHanding out addresses in every segment after moving off ISC DHCP.