Create an 802.1Q VLAN on a parent NIC in pfSense, assign it as an interface and give it a static IP address that clients can use as their gateway. Enable DHCP if clients need leases. Tag the VLAN on the switch trunk and add pass rules on the new interface to allow the traffic it needs. Netgate VLAN configuration, additional LAN setup, switch VLAN recipe
Verification was limited to Netgate’s pfSense documentation and the command reference manuals, checked on November 21, 2026. Netgate’s release notes cover pfSense Plus 26.07.2 and CE 2.9.2. Release notes
For edition differences, see pfSense CE vs pfSense Plus.
How does a VLAN work inside pfSense?
A pfSense VLAN is a virtual interface on a physical parent NIC. The 4-byte 802.1Q tag identifies the VLAN on the trunk, using an ID from 1 to 4094. Once assigned, the VLAN can have its own IP address, DHCP scope and firewall rules. VLAN overview, VLAN terminology, VLAN configuration
When a device connects to a host in another VLAN, pfSense routes between the assigned interfaces. Put the pass rule on the tab for the VLAN that initiates the connection. The firewall tracks the connection and permits reply traffic automatically. Firewall fundamentals, rule methodology
VLAN Tag Type selects the tag protocol identifier. Use C-Tag (0x8100) for ordinary single-tagged VLANs. S-Tag (0x88a8) is used as the outer tag in 802.1ad QinQ. VLAN configuration options
Dedicate the parent interface to carrying tagged VLANs and avoid using VLAN 1 on the trunk. Give switch management its own VLAN in this example and physically secure trunk ports. VLAN terminology, VLAN security
What does VLAN Priority do in pfSense?
VLAN Priority sets the 802.1p Priority Code Point (PCP) in the VLAN tag. The field accepts values from 0 to 7 and can be left blank, as in Netgate’s GUI example. VLAN configuration, VLAN priority
Use the interface setting to mark traffic for the VLAN. To match or mark specific traffic, use VLAN Priority (Match and Set) in the advanced options of a firewall rule. The upstream device must support 802.1p for the marking to affect priority there. Firewall rule options
What do you need before configuring VLANs?
Use a managed switch with 802.1Q trunking and a VLAN-capable network adapter. The tag can bring a full-size Ethernet frame to 1522 bytes. Hardware VLAN tagging or long-frame support helps avoid a reduction in MTU. Netgate VLAN requirements
A four-VLAN plan for a home network
This example uses IPv4 subnets from the private block 10.0.0.0/8. The third octet matches each VLAN ID. The example parent NIC is igb1. Use the physical port that carries your VLAN trunk. RFC 1918, VLAN terminology
| VLAN | Name | CIDR | Gateway | DHCP range | IPv4 policy |
|---|---|---|---|---|---|
| 10 | MGMT | 10.0.10.0/24 | 10.0.10.1 | .100–.199 | Can initiate traffic to all VLANs and administer the firewall |
| 20 | TRUSTED | 10.0.20.0/24 | 10.0.20.1 | .100–.199 | Can reach IOT, the firewall’s DNS service and the internet |
| 30 | IOT | 10.0.30.0/24 | 10.0.30.1 | .100–.199 | Can use the firewall’s DNS service and reach the internet. Block access to other example VLANs. |
| 40 | GUEST | 10.0.40.0/24 | 10.0.40.1 | .100–.199 | Can use the firewall’s DNS service and reach the internet. Block access to other example VLANs. |
How do you create a VLAN in the pfSense GUI?
Use your existing LAN management connection while making changes. The steps below build VLAN 30 (IOT). Repeat with the other IDs, names and addresses from the plan. Netgate’s anti-lockout rule
- Interfaces > Assignments > VLANs. Click Add. Set Parent Interface to
igb1, VLAN Tag Type to C-Tag, VLAN Tag to30, and Description toIOT. Leave VLAN Priority blank and click Save. VLAN configuration - Interfaces > Assignments > Interface Assignments. Select the new VLAN under Available network ports and click Add. pfSense assigns the next available OPT interface. VLAN assignment example, additional LAN setup
- Interfaces > OPTx. Enable the interface and set its Description to
IOT. Choose Static IPv4 and set the address and mask to10.0.30.1/24. Leave IPv4 Upstream Gateway unset. Clear Block private networks and Block bogon networks, then click Save and Apply Changes. Additional LAN setup, IPv4 configuration types - Services > DHCP Server > IOT. Enable DHCP and set the pool from
10.0.30.100to10.0.30.199. Click Save. Leave the gateway and DNS fields blank when pfSense is the gateway and runs the DNS Resolver. Additional LAN setup, DHCPv4 server options - Firewall > Rules > IOT. Click Add for each rule below, then Save. After the rules are in order, click Apply Changes. Additional LAN firewall rules
For internet access, check Firewall > NAT > Outbound. In Automatic or Hybrid mode, verify that the new subnet is listed as a source under Automatic Rules. In Manual mode, add a rule with WAN as the interface, IPv4 as the address family and Any as the protocol. Use the VLAN subnet as the source, Any as the destination and WAN Address as the translation. Save and apply changes. Additional LAN outbound NAT
Use the GUI on an existing installation. The console’s Assign Interfaces VLAN setup warns that proceeding clears all existing VLANs. Console VLAN configuration
What firewall rules does a pfSense VLAN need?
A new VLAN interface needs pass rules for client traffic. Interface rules are evaluated in order, with the first match deciding what happens. Put DNS access and other intended exceptions before the broader blocks. Additional LAN firewall rules, firewall fundamentals
In Firewall > Aliases, click Add and create a Network(s) alias called RFC1918. Add 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, then save. Add the following rules in order on the IOT tab of Firewall > Rules, using IPv4 as the address family throughout. Isolated LAN example, firewall rule options
| Order | Action | Protocol | Source | Destination | Destination port | Purpose |
|---|---|---|---|---|---|---|
| 1 | Pass | TCP/UDP | IOT subnets | This Firewall (self) | DNS (53) | Allow DNS to pfSense |
| 2 | Block | Any | IOT subnets | This Firewall (self) | Any | Block other firewall services |
| 3 | Block | Any | IOT subnets | RFC1918 | Any | Block other private IPv4 subnets |
| 4 | Pass | Any | IOT subnets | Any | Any | Permit remaining IPv4 traffic, including internet access |
Use the same order on GUEST with GUEST subnets as the source. For TRUSTED, use TRUSTED subnets as the source and insert a pass to IOT subnets before the RFC1918 block. On MGMT, add a pass from MGMT subnets to any destination. These are example rules for the four IPv4 networks above. Additional LAN firewall rules, firewall rule options
This Firewall (self) covers every firewall interface address, including its WAN IP. Rule 2 protects non-DNS services on those addresses before the final pass. Stateful filtering lets IOT hosts reply to connections initiated on TRUSTED. Firewall rule options, rule methodology
Rule-shadowing risks
- If rule 4 is above rule 3, its broad pass also permits traffic to private subnets.
- If rule 2 is above rule 1, DNS queries to the firewall hit the block first.
- Floating rules and interface group rules are evaluated before interface rules. Check for a matching group block if a pass on the VLAN tab appears to have no effect. Rule methodology
Enable Log on the block rules you want to check, then look under Status > System Logs > Firewall. Firewall rule options, viewing the firewall log
If you plan to run an IPS on VLAN interfaces, see Snort vs Suricata on pfSense.
How should the switch and access points be configured?
Define the VLANs on the switch. Configure the port facing pfSense as a trunk that tags VLANs 10, 20, 30 and 40. Configure wired client ports as untagged members of one VLAN, and set the matching Port VLAN ID (PVID) where the switch requires it. Netgate switch VLAN recipe
| Example port | Connected device | Mode | VLAN membership |
|---|---|---|---|
| p1 | pfSense igb1 | Trunk | Tagged 10, 20, 30, 40 |
| p2 | VLAN-capable access point | Trunk | Tag each VLAN used for tagged traffic on the AP |
| p3 | Management computer | Access | Untagged 10, PVID 10 |
| p4 | Desktop | Access | Untagged 20, PVID 20 |
| p5 | IoT hub | Access | Untagged 30, PVID 30 |
| p6 | Wired guest device | Access | Untagged 40, PVID 40 |
On the access point, match each SSID’s VLAN ID to the switch trunk. Use the AP’s own settings to determine which VLANs it expects tagged, including how it handles management traffic. Trunk and access port terminology
How do you get mDNS discovery working across VLANs?
Use an mDNS reflector between TRUSTED and IOT if devices need to discover each other. mDNS names are link-local, so discovery stays within each VLAN by default. The Avahi package can reflect those messages across the two networks. Leave GUEST out of the reflector. RFC 6762, Avahi package, Netgate’s bridging guide
With UDP Broadcast Relay, select TRUSTED and IOT as the interfaces and use UDP port 5353 with multicast group 224.0.0.251. Choose one service for mDNS because the relay cannot bind that port when Avahi is already using it. Discovery and the connection to the discovered device are separate. Keep the pass rule from TRUSTED to IOT for the connection itself. UDP Broadcast Relay configuration, rule methodology
What should you test before calling it done?
Start on an IOT client. Check that it receives a lease in the IOT pool and uses 10.0.30.1 as its gateway. If your DNS Resolver has custom interface bindings, verify that Network Interfaces includes IOT. By default the resolver listens on all available interfaces. DHCPv4 server options, DNS Resolver configuration
Use nslookup with the name first and the DNS server second. Run the pings from a client with BSD-style ping, where -c 4 sets the count. Choose an active TRUSTED test host that answers pings from an allowed network. BIND 9 nslookup manual, FreeBSD ping manual
nslookup pfsense.org 10.0.30.1 # expect a DNS answer (rule 1)
ping -c 4 10.0.20.1 # expect no replies from the firewall (rule 2)
ping -c 4 10.0.20.50 # expect no replies from the TRUSTED host (rule 3)
Check the firewall log to confirm the matching block rule when a ping receives no reply. Repeat the policy checks from GUEST. From TRUSTED, ping -c 4 10.0.30.50 should receive replies if the IoT test host answers ICMP. Viewing the firewall log, FreeBSD ping manual
Open a public website from IOT to check internet access. On a Debian client with mtr installed, mtr -r -w -c 20 9.9.9.9 generates a wide report after 20 cycles using one of Quad9’s public addresses. Use the report to inspect the route. Debian mtr manual, Quad9 service addresses
To measure routed throughput, run iperf3 -s on the IoT test host at 10.0.30.50. Allow the TRUSTED client to reach the server’s TCP port 5201 in the IoT host’s firewall. Run the commands below from TRUSTED. The first sends traffic toward IOT for 30 seconds, and -R reverses the direction of the data flow. ESnet iperf3 manual
iperf3 -c 10.0.30.50 -t 30
iperf3 -c 10.0.30.50 -t 30 -R
For hardware sizing and slow transfers, see pfSense workload sizing and finding the pfSense bottleneck.
To check the trunk, run the capture from the pfSense shell on the physical parent while an IoT client requests a lease. Here -i selects the interface, -n disables reverse DNS, -e displays the link-layer header and VLAN tag information, and -c 20 stops after 20 matching packets. The vlan 30 filter selects frames tagged with VLAN 30. Netgate tcpdump guide, Wireshark VLAN capture filter
tcpdump -n -e -i igb1 -c 20 vlan 30
If the capture shows no matching traffic during the lease request, verify the parent NIC, the access port’s VLAN and the trunk’s tagged membership. Netgate switch VLAN recipe
FAQ
Do VLANs slow down pfSense?
Adapters that require a lower MTU to carry tagged frames can send less data per packet. Netgate recommends adapters with long-frame support or hardware VLAN tagging for better efficiency. Netgate VLAN requirements