VLAN, Trunk, Router-on-a-Stick, and Firewall Rule Lab

Key Takeaways

  • A VLAN design is incomplete until trunks, access ports, gateways, DHCP scopes, and security rules all agree.
  • IEEE 802.1Q trunks carry multiple tagged VLANs between switches, routers, firewalls, and access points.
  • Router-on-a-stick uses subinterfaces with matching 802.1Q tags to route between VLANs over one physical link.
  • Firewall policy should be written as source, destination, service, action, and logging, evaluated top-down.
  • PBQ troubleshooting compares symptoms against VLAN membership, trunk allowed lists, native VLAN, gateways, and rule order.
Last updated: June 2026

VLAN and Firewall Design Lab

This lab combines Layer 2 segmentation, Layer 3 gateways, and security policy. In a PBQ you may place switchports into VLANs, mark a trunk, choose subinterfaces, and build firewall rules that allow only required traffic. CompTIA exam objective 2.3 (VLANs and trunking) and 4.x (security) both surface here, so a single scenario can test multiple objectives at once.

A VLAN (Virtual Local Area Network) is a Layer 2 broadcast domain defined in switch software. Devices in different VLANs cannot talk without a Layer 3 device (router or firewall) routing between them.

Scenario

A small office has one router or firewall connected to a switch. The switch also connects to access points, phones, users, and servers.

VLANNameSubnetGatewayPurpose
10Users172.20.10.0/24172.20.10.1Employee workstations
20Voice172.20.20.0/24172.20.20.1IP phones
30Servers172.20.30.0/24172.20.30.1File, print, application servers
40Guest172.20.40.0/24172.20.40.1Internet-only wireless guests
99Management172.20.99.0/24172.20.99.1Switches, APs, firewall management

Switch Port Plan

Port typeExample portsRequired setting
User access1-20Access VLAN 10
Phone plus PC21-28Data VLAN 10, voice VLAN 20
Server access29-34Access VLAN 30
AP uplink35-38Trunk allowing VLANs 10, 40, 99
Router/firewall uplink48802.1Q trunk allowing 10, 20, 30, 40, 99

An access port carries one untagged data VLAN (a phone-plus-PC port adds a tagged voice VLAN). A trunk port carries multiple tagged VLANs. The frame format adds a 4-byte 802.1Q tag containing a 12-bit VLAN ID (1-4094). A trunk allowed list that omits VLAN 40 explains why the guest SSID broadcasts but clients cannot reach the guest gateway.

Router-on-a-Stick Map

SubinterfaceEncapsulationIP address
g0/0.10802.1Q VLAN 10172.20.10.1/24
g0/0.20802.1Q VLAN 20172.20.20.1/24
g0/0.30802.1Q VLAN 30172.20.30.1/24
g0/0.40802.1Q VLAN 40172.20.40.1/24
g0/0.99802.1Q VLAN 99172.20.99.1/24

If the physical interface is up but one VLAN cannot route, focus on that VLAN's tag, the trunk allowed list, the subinterface IP, and the host default gateway. The native VLAN (untagged on the trunk) must match on both ends or you see a mismatch and inter-switch leakage.

Firewall Rule Table

Most firewalls and access control lists evaluate rules top-down and stop at the first match. Order is therefore part of the answer.

OrderSourceDestinationServiceActionLog
1UsersServersSMB, HTTPS, DNS as requiredAllowYes
2VoiceCall manager / voice gatewaySIP, RTP, DHCP, DNS, NTPAllowYes
3GuestInternetHTTP, HTTPS, DNSAllowYes
4GuestInternal RFC1918AnyDenyYes
5ManagementNetwork devicesSSH, HTTPS, SNMP, syslogAllowYes
6AnyAnyAnyDeny (implicit)Yes

A broad deny above an allow breaks a service; a broad allow above a deny defeats segmentation. The final implicit deny should log so you can audit what was dropped.

Troubleshooting Matrix

SymptomLikely check
User gets an APIPA (169.254.x.x) addressDHCP scope, DHCP relay, access VLAN, trunk path
Guest can browse but also reaches a file serverGuest-to-internal deny missing or ordered too low
Voice phones boot but cannot registerVoice VLAN, DHCP option 150, call manager reachability
AP management unreachableAP mgmt VLAN tag, trunk allowed list, mgmt gateway
Only one VLAN works across a trunkNative VLAN or allowed-VLAN mismatch, missing subinterface

An APIPA address (169.254.0.0/16) means the client found no DHCP server - a strong signal that the DHCP relay (IP helper) or trunk path is wrong, not that DHCP itself crashed.

DHCP Relay Detail

DHCP discovery is a broadcast that does not cross a router by default. When the DHCP server sits in VLAN 30 but clients are in VLAN 10, configure an IP helper-address on the VLAN 10 gateway pointing to the server. Without it, VLAN 10 clients self-assign APIPA while VLAN 30 clients (same broadcast domain as the server) lease normally.

Common PBQ Traps

  • Marking the router uplink as an access port instead of a trunk.
  • Allowing the guest VLAN to reach internal RFC1918 networks.
  • Forgetting DHCP relay when the server is in a different VLAN.
  • Setting a host gateway to an address from the wrong subnet.
  • Allowing a VLAN on the trunk but never creating the matching routed subinterface.
  • Writing firewall rules without a final deny, or without logging where auditing is required.
Test Your Knowledge

A router-on-a-stick design must route VLAN 30. Which interface component is required?

A
B
C
D
Test Your Knowledge

VLAN 10 users receive 169.254.x.x APIPA addresses while VLAN 30 users (same broadcast domain as the DHCP server) lease normally. What is the most likely fix?

A
B
C
D
Test Your Knowledge

Guest wireless clients can reach internal file servers. Which firewall rule is most directly missing or misordered?

A
B
C
D
Test Your KnowledgeMulti-Select

Which items must align for a VLAN to route across a trunk to a router or firewall? Select three.

Select all that apply

The VLAN is allowed on the trunk
The routed subinterface uses the correct 802.1Q tag
The client default gateway is in the correct subnet
The client uses the same MAC address as the gateway
The VLAN number equals the TCP port number