VLAN trunk misconfiguration prevents IoT VLAN from accessing internet while management VLAN is fine
Environment
Home lab: Ubiquiti EdgeRouter X (firmware v2.0.9) as router with two configured VLANs (VLAN10 management, VLAN20 IoT). Access switch is an unmanaged TP-Link TL-SG108 with one physical uplink to router. IoT devices are ESP32 sensors obtaining DHCP from the router; router uses masquerade NAT for LAN-to-WAN.
Symptoms
IoT devices on VLAN20 obtain DHCP addresses in 192.168.20.0/24 but cannot reach the Internet. Devices on VLAN10 (192.168.10.0/24) have normal Internet access. A laptop configured with VLAN20 tags also shows no Internet but can ping the router's VLAN20 IP.
Observations
From an IoT device ping to gateway 192.168.20.1 succeeds; traceroute to 8.8.8.8 shows packets reach the router then stop. Router NAT table (iptables -t nat -L -n) shows MASQUERADE only for source 192.168.10.0/24, no rule for 192.168.20.0/24. Switch is unmanaged, so VLAN tagging on the uplink port is expected to be handled by router but physical uplink currently configured as untagged on VLAN10 only.
Already attempted
Rebooted router and switch. Tested laptop by configuring untagged access port physically on switch to an IoT device and assigning static IP on VLAN20 — gateway reachable but no WAN. Added a temporary iptables MASQUERADE rule for 192.168.20.0/24 on router which restored Internet for VLAN20 until router reboot. No changes made to firewall zones.
Question
What are the most likely configuration mistakes that cause one VLAN's traffic to be NATed/forwarded while another VLAN gets DHCP/gateway but no WAN, and what safe, reversible steps can I take to permanently restore connectivity for the IoT VLAN with minimal downtime?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags