Runbook: Add a VLAN
1 · Prerequisites
Confirm every item is in place before any state change.
- OPNsense 25.x with at least one spare physical NIC or LAG that will carry the trunk
- Switch port on the OPNsense side configured as a trunk with the planned VLAN ID allowed
- VLAN ID, IP/CIDR, and zone name approved in the change record
2 · Pre-checks
Read-only diagnostic commands. If any of these don't match expected output, stop and investigate further.
- · Capture a fresh encrypted config backup before any change
- · Confirm the parent NIC supports 802.1Q (essentially all modern NICs do)
- · Confirm the switch port OPNsense is connected to is set as a trunk and the VLAN ID is allowed on it
- · Confirm no IP overlap with existing subnets on OPNsense
- · Have console access ready in case the management interface is accidentally put on the new VLAN
3 · Procedure
Execute each step in order. Verify the expected output of a step before moving to the next.
- 1Connect to the GUI over a non-VLAN management path (the LAN interface or a separate management VLAN that is not being modified).
- 2Navigate to Interfaces > Other Types > VLAN and click
+. - 3Set
Parent interfaceto the physical NIC or LAG that will carry the trunk (e.g.igc1orlagg0). - 4Set
VLAN tagto the planned 802.1Q VLAN ID (1–4094; avoid 1 unless you really mean the native VLAN). - 5Set
VLAN priorityto 0 unless QoS design specifies otherwise. - 6Set
Descriptionto a human-readable name (e.g.guest,dmz_servers,mgmt); this becomes part of the interface name. - 7Save the VLAN; OPNsense creates a new interface (e.g.
igc1.100for VLAN 100). - 8Navigate to Interfaces > Assignments, find the new VLAN in the dropdown, click
+, and save. - 9Edit the new OPT interface: enable it, set IPv4 configuration to
Static IPv4, set the IP/CIDR (e.g.10.30.0.1/24). - 10Set the MTU to 1500 for ordinary VLANs; do not lower unless the upstream network explicitly requires it.
- 11Save and Apply changes.
- 12Add a management allow rule first: Firewall > Rules > [new VLAN interface], allow from your
mgmt_hostsalias tothis firewall. - 13Add the zone-appropriate baseline: trusted LAN-type zones get a default allow from the subnet; DMZ and guest zones get a default deny plus a narrow allow list.
- 14If DHCP is needed, install the ISC DHCP service and create a scope on Services > ISC DHCPv4 > [interface].
- 15On the upstream switch, configure the OPNsense-facing port as a trunk, allow the new VLAN ID, and set the native VLAN to a stable, non-data VLAN.
- 16On the user-facing access ports, configure them as access ports for the new VLAN ID and reboot or bounce the port to apply.
4 · Verification
Confirm the procedure actually fixed the problem.
- ✓A device on the new VLAN receives the expected IP from the DHCP scope (or has the expected static IP)
- ✓The device can ping the VLAN interface IP at OPNsense (
ping 10.30.0.1) - ✓
ifconfig <vlan_if>at the OPNsense shell shows the configured address andstatus: active - ✓Packet capture on the parent interface (
tcpdump -nei <parent> vlan <vlan_id>) shows tagged frames for the new VLAN - ✓Live View (Firewall > Log Files > Live View) filtered to the VLAN interface shows expected pass/block decisions
5 · Rollback
If verification fails, undo the procedure in reverse order.
- ↶Disable the OPT interface and remove its assignment from Interfaces > Assignments; apply.
- ↶Delete the VLAN from Interfaces > Other Types > VLAN; apply.
- ↶Restore the pre-change encrypted config backup if alias or other related changes were made.
- ↶Revert the switch port configuration to the prior trunk/access state.
- ↶Verify the parent NIC and any other VLANs on it remain functional.
6 · Escalation
When the runbook isn't enough, contact:
- · Escalate to the network team if the switch port is not trunking the VLAN; suspect VLAN allowed list mismatch, native VLAN mismatch, or trunk disabled.
- · Escalate to the platform team if the parent NIC does not show the VLAN at all; check NIC driver support for 802.1Q (rare on supported hardware).
- · Escalate if you accidentally placed the management interface on the new VLAN and lost GUI access; use the OPNsense console menu option to reset web GUI access or to assign the management VLAN explicitly.
- · Escalate to security if the new VLAN carries traffic that crosses trust boundaries; require a documented firewall ruleset before allowing inter-VLAN routing.
Purpose
This runbook creates an 802.1Q VLAN on OPNsense, tags it on the parent NIC and upstream switch, and brings the new segment online with sane defaults. It is the runbook to reach for whenever a new logical segment needs to share a physical NIC with the rest of the firewall’s traffic.
When to use this runbook
Use this runbook when a new VLAN needs to exist on the network (guest, server, DMZ, IoT, voice, management, etc.) and OPNsense is the Layer-3 boundary for it. If you also need to add the corresponding physical or LAG interface first, see opnsense-rb-add-interface.
Pre-checks
- Capture a fresh encrypted config backup before any change.
- Confirm the parent NIC supports 802.1Q (essentially all modern NICs do; this is a FreeBSD
vlandriver feature). - Confirm the switch port OPNsense is connected to is set as a trunk and the planned VLAN ID is on the allowed list.
- Confirm no IP overlap with existing subnets configured on OPNsense.
- Have console access ready in case the management interface is accidentally placed on the new VLAN.
Procedure
- Stay on a safe management path. Connect to the GUI over a non-VLAN management path (the LAN interface or a separate management VLAN that is not being modified).
- Create the VLAN. Navigate to Interfaces > Other Types > VLAN and click
+. - Configure the VLAN. Set Parent interface to the physical NIC or LAG that will carry the trunk. Set VLAN tag to the planned 802.1Q VLAN ID (1–4094; avoid 1 unless you really mean the native VLAN). Set VLAN priority to 0 unless QoS design specifies otherwise. Set Description to a human-readable name; this becomes part of the interface name.
- Save the VLAN. OPNsense creates a new interface (e.g.
igc1.100for VLAN 100 on parentigc1). - Assign the VLAN interface. Navigate to Interfaces > Assignments, find the new VLAN in the dropdown, click
+, and save. - Configure the new OPT interface. Click the new OPT entry. Check Enable interface. Set IPv4 configuration type to
Static IPv4and enter the IP/CIDR (e.g.10.30.0.1/24). Leave IPv6 atNoneunless there is a concrete IPv6 plan. - Set the MTU. Keep 1500 for ordinary VLANs; do not lower it unless the upstream network explicitly requires it.
- Apply. Click Save and then Apply changes.
- Add a management allow rule first. Navigate to Firewall > Rules > [new VLAN interface] and add a pass rule from your
mgmt_hostsalias tothis firewall. This guarantees GUI access if subsequent ruleset work goes wrong. - Add the zone-appropriate baseline. For a trusted LAN-type VLAN, add a pass from the subnet to
any. For a DMZ, guest, or IoT VLAN, add a default deny plus a narrow allow list referencing only the upstream and downstream subnets that must be reachable. - Add DHCP if needed. Install the ISC DHCP service and create a scope on Services > ISC DHCPv4 > [interface]. Point DNS at the OPNsense Unbound resolver.
- Configure the upstream switch. Set the OPNsense-facing port as a trunk with the new VLAN ID allowed. On the user-facing access ports, set them as access ports for the new VLAN ID and bounce the port to apply.
- Confirm tagging with packet capture. At the OPNsense shell, run
tcpdump -nei <parent_if> vlan <vlan_id> -c 20. You should see 802.1Q-tagged frames for the new VLAN arriving from the trunk.
Verification
- A device on the new VLAN receives the expected IP from the DHCP scope (or has the expected static IP).
- The device can ping the VLAN interface IP at OPNsense (
ping 10.30.0.1). ifconfig <vlan_if>at the OPNsense shell shows the configured address andstatus: active.- Packet capture on the parent interface confirms tagged frames for the new VLAN (
tcpdump -nei <parent> vlan <vlan_id>). - Live View (Firewall > Log Files > Live View) filtered to the VLAN interface shows expected pass/block decisions.
Rollback
- Disable the OPT interface and remove its assignment from Interfaces > Assignments; apply.
- Delete the VLAN from Interfaces > Other Types > VLAN; apply.
- Restore the pre-change encrypted config backup if alias or other related changes were made.
- Revert the switch port configuration to the prior trunk/access state.
- Verify the parent NIC and any other VLANs on it remain functional.
Escalation
- Escalate to the network team if the switch port is not trunking the VLAN: suspect VLAN allowed list mismatch, native VLAN mismatch, or trunk disabled on the port.
- Escalate to the platform team if the parent NIC does not show the VLAN at all; check NIC driver support for 802.1Q (rare on supported hardware).
- Escalate if you accidentally placed the management interface on the new VLAN and lost GUI access: use the OPNsense console menu option to reset web GUI access or to assign the management VLAN explicitly.
- Escalate to security if the new VLAN carries traffic that crosses trust boundaries; require a documented firewall ruleset before allowing inter-VLAN routing.