VLAN
Cheat sheet · https://pcornel.dk/topic.php?topic=2783
Answer
A Linux VLAN interface (e.g. eth0.20 or vlan20) tags traffic with an 802.1Q VLAN ID on a parent interface, so one physical port can carry several VLANs to a switch trunk.
Remember
The switch port must be a trunk that allows the VLAN; the parent interface must be up. Create persistently with nmcli (type vlan), netplan (vlans:) or a networkd .netdev. Untagged traffic stays on the parent.
First checks
ip -d link show <if>— link details incl. VLAN idip -br addr— interfaces and addressesip route— routing table and default routeip neigh— ARP/neighbour cacheip route get <dest>— route, interface and source chosen for a destinationnmcli device status / networkctl— which tool manages each interface
Commands
ip link add ... type vlantcpdump -e
Verify in this order
VLAN interface created on the parent → tags frames with the ID → switch trunk accepts the VLAN → replies tagged back → delivered to the VLAN interface
Where it usually breaks
First mismatch in link/interface → address/namespace → route/neighbor → firewall/policy → socket/daemon → DNS/TLS/SSH/application peer path; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2783