Switching and Layer 2
netverdict models Layer 2 as deterministic forwarding state. The goal is to make access-layer labs, loop-prevention checks, trunk mistakes, and neighbour visibility reproducible, not to emulate a particular switching ASIC.
For narrower pages, see VLAN, STP, EtherChannel, Discovery, and Layer-2 Security.
Support level
Section titled “Support level”| Area | Level | What this means |
|---|---|---|
| Ethernet MAC learning | Supported | Source MAC learning, unknown-unicast flooding, known-unicast forwarding, and ageing-style state. |
| VLAN access ports | Supported | Access VLAN assignment and per-VLAN broadcast domains. |
| 802.1Q trunks | Supported | Allowed VLAN lists, native VLAN handling, tagged forwarding, and trunk show output. |
| SVIs and routed VLANs | Supported | interface VlanX can provide a routed gateway for a VLAN. |
| Router subinterfaces | Supported | Dot1Q subinterfaces participate in VLAN-aware routing. |
| STP / PVST+ | Supported | Real BPDU exchange, root election, forward-delay ladder, TCN. PVST+ runs one tree per VLAN. |
| RSTP / MST | Supported | Proposal/agreement handshake and MST per-instance trees. Every MST switch is in one region; see STP. |
| BPDU guard / inconsistent state | Behaviour model | Edge-protection and blocked/error state can affect forwarding. |
| EtherChannel | Supported | Port-channel interfaces and member selection. |
| LACP | Behaviour model | Active/passive eligibility and bundled/suspended member state. LACPDUs are on the wire in a capture (Packet Lens), decoded by Wireshark. |
| PAgP | Behaviour model | Auto/desirable bundle outcome. PAgP bundles only with PAgP. |
| CDP | Behaviour model | Neighbour discovery and IOS-style show output. |
| LLDP | Behaviour model | Standards-style neighbour discovery and show output. |
| VTP | Behaviour model | Server/client/transparent, domain and revision decide VLAN propagation. |
| UDLD | Behaviour model | UDLD shutdown/reset-style behaviour in supported scenarios. |
| Port security | Supported | Static/sticky MACs, maximum, and violation actions. |
| DHCP snooping | Behaviour model | Trusted ports and binding table state used by security labs. |
| 802.1X | Behaviour model | Port authorization from RADIUS reachability and credentials, with MAB and the guest and auth-fail VLANs. See Layer-2 security. |
| Q-in-Q (802.1ad) | Supported | switchport mode dot1q-tunnel carries the customer tag inside an S-tag. |
| Voice VLAN | Supported | A phone port carries the data VLAN and the voice VLAN. |
| MACsec | Behaviour model | Matching pre-shared keys protect the link; a mismatch drops frames. No MKA. |
| MLAG / vPC | Partial | Dual-homing rides the LAG model. On NX-OS a flood that crossed the peer-link does not leave by a vPC whose member is up on the other peer, so a dual-homed host hears a broadcast once. The peer control plane is not modelled. |
Standards coverage
Section titled “Standards coverage”| Standard / feature family | Coverage | Notes |
|---|---|---|
| IEEE 802.3 behaviour | Supported | Ethernet frame forwarding outcome, MAC learning, and flooding. |
| IEEE 802.1Q | Supported | VLAN tags, access/trunk membership, native VLAN, and SVI/subinterface interactions. |
| IEEE 802.1D / PVST+ | Supported | BPDU exchange, port roles, forward delay, TCN/TCA. |
| IEEE 802.1w / RSTP | Supported | Proposal/agreement and topology-change propagation. |
| IEEE 802.1s / MST | Partial | MSTIs and PVST+ interop at the region boundary. Region name and revision change nothing. |
| IEEE 802.1AX / LACP | Behaviour model | Bundle negotiation outcome and member eligibility. |
| IEEE 802.1AB / LLDP | Behaviour model | Neighbour table and selected TLV-style state. |
| Cisco CDP / VTP / UDLD / PAgP | Behaviour model | Vendor-specific access-layer behaviour where supported by labs and command tree. |
| Cisco port security | Supported | Sticky/static MACs, max count, violation actions, and show output. |
| DHCP snooping / DAI family | Supported | Bindings learned from DHCP ACKs on untrusted ports; DAI and IP Source Guard drop against them. See Layer-2 Security. |
| IEEE 802.1X | Behaviour model | Port authorization rather than a byte-level EAPOL supplicant. |
| IEEE 802.1ad | Supported | Q-in-Q S-tag over C-tag. |
Feature matrix
Section titled “Feature matrix”| Feature | Status | Notes |
|---|---|---|
| MAC address table | Supported | Learns and resolves per-switch forwarding state. |
| Broadcast flooding | Supported | Flooding is scoped to VLAN membership and STP state. |
| Unknown unicast flooding | Supported | Unknown destination MACs flood within the VLAN domain. |
| STP network ports and legacy switches | Supported | spanning-tree portfast network / port type network with Bridge Assurance; UplinkFast and BackboneFast on access switches (see STP). spanning-tree etherchannel guard misconfig and optimize bpdu transmission have no effect. |
| VLAN database | Supported | VLAN IDs and names are stored and emitted. On IOS and EOS an access port creates a missing VLAN (IOS prints % Access VLAN does not exist. Creating vlan N); NX-OS does not. no vlan N leaves its access ports inactive; no vlan 1 is refused. Enforced where the configuration states a database (vlan / no vlan lines or VTP); a switch from a topology document carries what its ports say. |
| Access VLAN | Supported | Untagged ingress maps to the configured access VLAN. |
| Trunk allowed list | Supported | VLANs not allowed on a trunk are filtered. |
| Native VLAN | Supported | Untagged trunk traffic maps to the native VLAN. |
| SVI gateway | Supported | VLAN interfaces can route traffic from the L2 domain, also over a trunk (tagged, or untagged on the native VLAN). Traffic bridged to an SVI enters L3 on the SVI, so an ACL bound to the SVI filters it. |
| Interface templates | Supported | IOS-XE template blocks apply to every port with source template. A line the port states itself wins. The running config writes the template and the source template line. |
| NX-OS FEX | Supported | switchport mode fex-fabric with fex associate N brings FEX N’s host ports (EthernetN/1/x) up as the parent’s ports. |
NX-OS system default switchport | Supported | Decides a port’s default mode, and with shutdown whether a port without no shutdown is up. |
| LACP min-links | Partial | NX-OS lacp min-links N: with fewer members bundled, the port-channel has no link. IOS port-channel min-links is not read; Junos minimum-links is accepted and has no effect. |
| Non-routing switch default route | Supported | ip default-gateway is the switch’s default route when ip routing is off. |
| Dot1Q subinterfaces | Supported | Router-on-a-stick scenarios are represented. |
| STP root election | Supported | Priority and bridge ID decide the root, per VLAN under PVST+. |
| STP blocked ports | Supported | Blocked links are removed from forwarding paths. |
| Loop guard / BPDU filter | Supported | A silent port blocks; a filtered port leaves the tree. |
| PortFast / edge intent | Supported | Stored and reflected in STP/access-layer state. |
| BPDU guard | Behaviour model | Edge-protection failures can block/shutdown forwarding. |
| EtherChannel static bundle | Supported | Port-channel participates as a logical interface. |
| LACP / PAgP member selection | Behaviour model | Bundle eligibility is calculated from configured mode. |
| CDP / LLDP neighbours | Behaviour model | Neighbour tables are derived from topology and config. |
| VTP VLAN propagation | Behaviour model | Supported modes can propagate VLAN state in labs. |
| UDLD failure | Behaviour model | Supported scenarios can represent a unidirectional-link shutdown. |
| Port security sticky MAC | Supported | Learns/stores sticky MAC intent and enforces maximum where modelled. |
| DHCP snooping trust | Supported | Server replies are allowed only on trusted ports. |
| 802.1X authorization | Behaviour model | The port is placed in its access, auth-fail or guest VLAN. An unauthorized port drops all frames (dot1x.unauthorized). |
Vendor command matrix
Section titled “Vendor command matrix”| Command | IOS-style | Junos-style | VyOS-style | Notes |
|---|---|---|---|---|
vlan 10 | Supported | Partial | Partial | VLAN creation. |
name USERS | Supported | Supported | Supported | VLAN metadata. |
switchport mode access | Supported | Supported | Partial | Access-port mode. Junos: family ethernet-switching interface-mode access. VyOS: a bridge member with native-vlan. |
switchport access vlan 10 | Supported | Supported | Partial | Access VLAN membership. Junos: vlan members. |
switchport mode trunk | Supported | Supported | Partial | Trunk-port mode. VyOS: a bridge member with allowed-vlan. |
switchport trunk allowed vlan 10,20 | Supported | Supported | Partial | Allowed VLAN filtering. |
switchport trunk native vlan 99 | Supported | Supported | Partial | Native VLAN intent. |
interface Vlan10 | Supported | Supported | Partial | SVI routed interface. |
encapsulation dot1q 10 | Supported | Partial | Supported | Router subinterface VLAN tag. VyOS: ethernet ethN vif 10. |
spanning-tree vlan 10 priority 4096 | Supported | Supported | Supported | STP root influence. Junos via VSTP. VyOS: bridge priority. |
spanning-tree mode rapid-pvst | Supported | Supported | Partial | STP mode selection. Junos: protocols rstp|stp|mstp|vstp. VyOS: bridge stp (classic STP only). |
spanning-tree portfast | Supported | Supported | Not modelled | Edge-port intent. Junos edge. |
spanning-tree bpduguard enable | Supported | Supported | Not modelled | BPDU guard. Junos: bpdu-block-on-edge. |
channel-group 1 mode active | Supported | Supported | Partial | LACP bundle membership. Junos: gigether-options 802.3ad aeN. VyOS: ethernet ethN bond-group bondN. |
channel-group 1 mode desirable | Supported | n/a | n/a | PAgP bundle membership. |
cdp enable / no cdp enable | Supported | n/a | n/a | CDP interface control. |
lldp transmit / lldp receive | Supported | Supported | Not modelled | LLDP interface control. Junos: protocols lldp interface all|IF [disable]. |
vtp mode server/client/transparent | Supported | n/a | n/a | VTP mode surface. |
udld port aggressive | Supported | n/a | n/a | Err-disables a port whose peer is not there. |
switchport mode dot1q-tunnel | Supported | n/a | n/a | Q-in-Q customer edge. |
switchport port-security | Supported | n/a | n/a | Port-security enablement. |
switchport port-security mac-address sticky | Supported | n/a | n/a | Sticky MAC learning. |
ip dhcp snooping trust | Supported | Supported | n/a | DHCP snooping trusted port. Junos: dhcp-security; see Layer-2 Security. |
authentication port-control auto | Supported | Not modelled | n/a | 802.1X interface control. |
source template NAME | Supported | n/a | n/a | IOS-XE interface template. |
vpc N / vpc peer-link | NX-OS: Supported | n/a | n/a | vPC loop avoidance. |
vlan members / port-mode | n/a | Supported | n/a | Junos EX ports by VLAN name, range or all; also vlans NAME interface and interface-range. |
show mac address-table | Supported | Vendor-shaped view | Vendor-shaped view | Learned MAC state: each entry’s VLAN, MAC address, type and port. |
show vlan brief | Supported | Partial | Partial | VLAN membership. |
show interfaces trunk | Supported | Partial | Partial | Trunk state. |
show spanning-tree | Supported | Partial | Partial | Model-derived STP state. |
show etherchannel summary | Supported | Partial | Partial | Bundle state. |
show cdp neighbors | Supported | n/a | n/a | CDP neighbours. |
show lldp neighbors | Supported | Supported | n/a | LLDP neighbours. VyOS LLDP is not read. |
Behaviour notes
Section titled “Behaviour notes”Layer-2 forwarding is VLAN-scoped. A frame is first classified into a VLAN from access, trunk, subinterface, or native-VLAN context. Forwarding then uses the MAC table and the active STP/EtherChannel state for that VLAN.
STP is a distributed protocol. Every switch sends BPDUs from its designated ports every 2 seconds, stores the best BPDU per port, and elects its root and port roles locally. New ports climb the forward-delay ladder; RSTP ports use proposal/agreement instead. A legacy change sends a TCN up to the root. The result is deterministic: the same topology converges the same way.
EtherChannel is represented as a logical forwarding interface when member ports are eligible. LACP and PAgP decide bundling from the two ends’ modes. LACPDUs, DTP and VTP advertisements are on the wire in a capture (Packet Lens), decoded by Wireshark.
CDP and LLDP neighbours are learned from advertisements and age out. The frames are on the wire in a capture (Packet Lens), decoded by Wireshark. Version and duplex TLVs are not sent.
Examples
Section titled “Examples”Access VLAN with SVI gateway
configure terminalvlan 10 name USERSinterface GigabitEthernet0/1 switchport mode access switchport access vlan 10interface Vlan10 ip address 10.0.10.1 255.255.255.0 no shutdownendshow vlan briefshow mac address-tableVendor styles
IOS-style
vlan 10 name USERSinterface GigabitEthernet0/1 switchport mode access switchport access vlan 10interface Vlan10 ip address 10.0.10.1 255.255.255.0Junos-style
set vlans USERS vlan-id 10set interfaces ge-0/0/1 unit 0 family ethernet-switching interface-mode accessset interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members USERSset interfaces irb unit 10 family inet address 10.0.10.1/24set vlans USERS l3-interface irb.10VyOS-style
set interfaces bridge br0 member interface eth1set interfaces bridge br0 member interface eth2set interfaces bridge br0 address 10.0.10.1/24Trunk with native VLAN
configure terminalinterface GigabitEthernet0/24 switchport mode trunk switchport trunk allowed vlan 10,20,30 switchport trunk native vlan 99endshow interfaces trunkEtherChannel with LACP
configure terminalinterface range GigabitEthernet0/1 - 2 channel-group 1 mode activeinterface Port-channel1 switchport mode trunk switchport trunk allowed vlan 10,20endshow etherchannel summaryPort security on an access port
configure terminalinterface GigabitEthernet0/3 switchport mode access switchport access vlan 10 switchport port-security switchport port-security maximum 2 switchport port-security mac-address sticky switchport port-security violation restrictendshow port-security interface GigabitEthernet0/3Known limits
Section titled “Known limits”UDLD, DHCP snooping, and 802.1X are represented at the behaviour-outcome level. UDLD frames and the EAPOL exchange are not sent. 802.1X and MAB decide once, at settle; the critical VLAN, CoA and re-authentication are not modelled.
EtherChannel bundling checks only the channel modes and link state; speed and VLAN mismatches between members are not checked.
Private VLANs are not modelled. Switch ASIC behaviours such as CAM resource limits and hardware errata are outside the current model.