Skip to content

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.

AreaLevelWhat this means
Ethernet MAC learningSupportedSource MAC learning, unknown-unicast flooding, known-unicast forwarding, and ageing-style state.
VLAN access portsSupportedAccess VLAN assignment and per-VLAN broadcast domains.
802.1Q trunksSupportedAllowed VLAN lists, native VLAN handling, tagged forwarding, and trunk show output.
SVIs and routed VLANsSupportedinterface VlanX can provide a routed gateway for a VLAN.
Router subinterfacesSupportedDot1Q subinterfaces participate in VLAN-aware routing.
STP / PVSTBehaviour modelRoot election and blocked/forwarding state are deterministic.
RSTP / MSTBehaviour modelCommon lab outcomes are represented; not a full BPDU timer replay.
BPDU guard / inconsistent stateBehaviour modelEdge-protection and blocked/error state can affect forwarding.
EtherChannelSupportedPort-channel interfaces and member selection.
LACPBehaviour modelActive/passive eligibility and selected/unselected member state.
PAgPBehaviour modelAuto/desirable-style bundle outcome.
CDPBehaviour modelNeighbour discovery and IOS-style show output.
LLDPBehaviour modelStandards-style neighbour discovery and show output.
VTPBehaviour modelVLAN propagation/status surfaces for supported modes.
UDLDBehaviour modelUDLD shutdown/reset-style behaviour in supported scenarios.
Port securitySupportedStatic/sticky MACs, maximum, and violation actions.
DHCP snoopingBehaviour modelTrusted ports and binding table state used by security labs.
802.1X / MABBehaviour modelPort authorization from fixture users and fallback policy.
Standard / feature familyCoverageNotes
IEEE 802.3 behaviourSupportedEthernet frame forwarding outcome, MAC learning, and flooding.
IEEE 802.1QSupportedVLAN tags, access/trunk membership, native VLAN, and SVI/subinterface interactions.
IEEE 802.1D / PVST-style STPBehaviour modelDeterministic root and port-state selection.
IEEE 802.1w / RSTPBehaviour modelRapid-STP mode and common state outcomes.
IEEE 802.1s / MSTBehaviour modelMST configuration surface and lab-level outcomes.
IEEE 802.1AX / LACPBehaviour modelBundle negotiation outcome and member eligibility.
IEEE 802.1AB / LLDPBehaviour modelNeighbour table and selected TLV-style state.
Cisco CDP / VTP / UDLD / PAgPBehaviour modelVendor-specific access-layer behaviour where supported by labs and command tree.
Cisco port securitySupportedSticky/static MACs, max count, violation actions, and show output.
DHCP snooping / DAI familyBehaviour modelBinding/trust model for supported security checks.
IEEE 802.1XBehaviour modelPort authorization rather than a byte-level EAPOL supplicant.
FeatureStatusNotes
MAC address tableSupportedLearns and resolves per-switch forwarding state.
Broadcast floodingSupportedFlooding is scoped to VLAN membership and STP state.
Unknown unicast floodingSupportedUnknown destination MACs flood within the VLAN domain.
VLAN databaseSupportedVLAN IDs/names are stored and emitted.
Access VLANSupportedUntagged ingress maps to the configured access VLAN.
Trunk allowed listSupportedVLANs not allowed on a trunk are filtered.
Native VLANSupportedUntagged trunk traffic maps to the native VLAN.
SVI gatewaySupportedVLAN interfaces can route traffic from the L2 domain.
Dot1Q subinterfacesSupportedRouter-on-a-stick scenarios are represented.
STP root electionBehaviour modelPriority and bridge ID influence the deterministic root.
STP blocked portsBehaviour modelBlocked links are removed from forwarding paths.
PortFast / edge intentSupportedStored and reflected in STP/access-layer state.
BPDU guardBehaviour modelEdge-protection failures can block/shutdown forwarding.
EtherChannel static bundleSupportedPort-channel participates as a logical interface.
LACP / PAgP member selectionBehaviour modelBundle eligibility is calculated from configured mode.
CDP / LLDP neighboursBehaviour modelNeighbour tables are derived from topology and config.
VTP VLAN propagationBehaviour modelSupported modes can propagate VLAN state in labs.
UDLD failureBehaviour modelSupported scenarios can represent a unidirectional-link shutdown.
Port security sticky MACSupportedLearns/stores sticky MAC intent and enforces maximum where modelled.
DHCP snooping trustBehaviour modelTrusted/untrusted port state feeds binding/security checks.
802.1X / MAB authorizationBehaviour modelInterface authorization controls forwarding for supported clients.
CommandIOS-styleJunos-styleVyOS-styleNotes
vlan 10SupportedPartialPartialVLAN creation.
name USERSSupportedSupportedSupportedVLAN metadata.
switchport mode accessSupportedn/aPartialAccess-port mode.
switchport access vlan 10Supportedn/aPartialAccess VLAN membership.
switchport mode trunkSupportedn/aPartialTrunk-port mode.
switchport trunk allowed vlan 10,20Supportedn/aPartialAllowed VLAN filtering.
switchport trunk native vlan 99SupportedSupportedPartialNative VLAN intent.
interface Vlan10SupportedSupportedPartialSVI routed interface.
encapsulation dot1q 10Supportedn/aPartialRouter subinterface VLAN tag.
spanning-tree vlan 10 priority 4096Supportedn/aPartialSTP root influence.
spanning-tree mode rapid-pvstSupportedn/an/aSTP mode selection.
spanning-tree portfastSupportedn/aPartialEdge-port intent.
spanning-tree bpduguard enableSupportedn/aPartialBPDU guard.
channel-group 1 mode activeSupportedn/aPartialLACP bundle membership.
channel-group 1 mode desirableSupportedn/an/aPAgP bundle membership.
cdp enable / no cdp enableSupportedn/an/aCDP interface control.
lldp transmit / lldp receiveSupportedSupportedSupportedLLDP interface control.
vtp mode server/client/transparentSupportedn/an/aVTP mode surface.
udld port aggressiveSupportedn/an/aUDLD protection intent.
switchport port-securitySupportedn/aPartialPort-security enablement.
switchport port-security mac-address stickySupportedn/aPartialSticky MAC learning.
ip dhcp snooping trustSupportedn/aPartialDHCP snooping trusted port.
authentication port-control autoSupportedPartialn/a802.1X interface control.
show mac address-tableSupportedVendor-shaped viewVendor-shaped viewLearned MAC state.
show vlan briefSupportedPartialPartialVLAN membership.
show interfaces trunkSupportedPartialPartialTrunk state.
show spanning-treeSupportedPartialPartialModel-derived STP state.
show etherchannel summarySupportedPartialPartialBundle state.
show cdp neighborsSupportedn/an/aCDP neighbours.
show lldp neighborsSupportedSupportedSupportedLLDP neighbours.

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 deterministic solver. It decides stable root and forwarding/blocking state from the configured topology. It does not replay every BPDU, proposal, agreement, or timer transition. This is deliberate: labs should test the final network outcome, not timing noise.

EtherChannel is represented as a logical forwarding interface when member ports are eligible. LACP and PAgP are modelled at the selection/outcome level, not as full packet exchanges.

Discovery protocols are topology and configuration views. They are useful for show-command reasoning, audits, and lab tasks, but the simulator does not try to emit every vendor TLV variant.

Access VLAN with SVI gateway
configure terminal
vlan 10
name USERS
interface GigabitEthernet0/1
switchport mode access
switchport access vlan 10
interface Vlan10
ip address 10.0.10.1 255.255.255.0
no shutdown
end
show vlan brief
show mac address-table

Vendor styles

IOS-style
vlan 10
name USERS
interface GigabitEthernet0/1
switchport mode access
switchport access vlan 10
interface Vlan10
ip address 10.0.10.1 255.255.255.0
Junos-style
set vlans USERS vlan-id 10
set interfaces ge-0/0/1 unit 0 family ethernet-switching interface-mode access
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members USERS
set interfaces irb unit 10 family inet address 10.0.10.1/24
set vlans USERS l3-interface irb.10
VyOS-style
set interfaces ethernet eth1 vif 10 address 10.0.10.1/24
set interfaces ethernet eth2 bridge-group bridge br10
set interfaces bridge br10 vif 10
Trunk with native VLAN
configure terminal
interface GigabitEthernet0/24
switchport mode trunk
switchport trunk allowed vlan 10,20,30
switchport trunk native vlan 99
end
show interfaces trunk
EtherChannel with LACP
configure terminal
interface range GigabitEthernet0/1 - 2
channel-group 1 mode active
interface Port-channel1
switchport mode trunk
switchport trunk allowed vlan 10,20
end
show etherchannel summary
Port security on an access port
configure terminal
interface 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 restrict
end
show port-security interface GigabitEthernet0/3

STP, RSTP, and MST are solver models. They are stable and useful for topology outcomes, but they do not emulate every transient timer or per-vendor state transition.

LACP, PAgP, VTP, UDLD, DHCP snooping, and 802.1X/MAB are represented at the configuration and behaviour-outcome level. Full packet exchanges and every vendor TLV/state variant are not modelled.

Switch ASIC behaviours such as platform-specific hashing, CAM resource limits, storm-control counters, QoS queueing, and hardware errata are outside the current model.