CNPE study materials
CNPE study resources

CNPE: Routing and Switching

CNPE · Work through your exam, one topic at a time.

All guide sections

Routing and Switching

The Routing and Switching domain tests the actual forwarding decision - why a frame or packet leaves a particular interface - plus the control-plane protocols that build the tables behind that decision.

Layer 2

  • MAC learning: unknown unicast is flooded inside the VLAN; broadcast reaches every port in the VLAN, including trunk ports carrying it.
  • 802.1Q inserts a 4-byte tag; native VLAN frames travel untagged. A native VLAN mismatch puts untagged frames in the wrong VLAN and breaks CDP and spanning-tree consistency.
  • Spanning tree picks the root by lowest bridge ID - priority first in 4096 steps (default 32768), then MAC. RSTP adds alternate and backup roles plus edge ports; MSTP maps groups of VLANs to instances.
  • EtherChannel: LACP passive/passive never forms; use active/active or active/passive. Members need matching speed, duplex, allowed VLANs and trunk settings.

Layer 3

  • Longest prefix match always wins first. Administrative distance only breaks ties between routes to the same prefix.
  • AD: connected 0, static 1, eBGP 20, EIGRP 90, OSPF 110, RIP 120, iBGP 200.
  • OSPF elects a DR/BDR per multiaccess segment by interface priority then router ID; LSA 1 router, 2 network, 3 summary, 5 external, 7 NSSA.
  • BGP best path: highest weight, highest local preference, locally originated, shortest AS_PATH, lowest origin, lowest MED, eBGP over iBGP, lowest IGP metric to next hop, lowest router ID.

Worked example

The table holds 10.0.0.0/8 via A, 10.1.0.0/16 via B, 10.1.5.0/24 via C and a default via D. A packet to 10.1.5.7 matches all four - longest prefix wins, so it goes to C. If that /24 is a static route while an OSPF copy of 10.1.5.0/24 also exists, the prefix lengths tie and AD decides: static (1) beats OSPF (110). No other entry in the table is consulted.

Traps that cost marks

Believing a lower AD beats a longer prefix. Forgetting OSPF cost uses a 100 Mbps reference bandwidth, so 1 Gbps and 10 Gbps links look equal until you change it. Assuming a VLAN alone isolates broadcast domains across a routed boundary. Confusing the allowed-VLAN list with the native VLAN on a trunk.