Octet

Switching and VLANs

0 of 36 nailed

Core15

  1. How does a switch learn MAC addresses and decide where to send a frame?

    Say this first

    It learns from the source MAC of every frame, recording MAC, VLAN and ingress port. To forward, it looks up the destination MAC in that VLAN. A known unicast goes out one port. Unknown unicast, broadcast and multicast (without IGMP snooping) are flooded to every port in the VLAN except the one the frame came in on. Entries age out after 300 seconds of silence on Cisco by default.

    Go deeper

    The four actions

    • Learn. Source MAC plus VLAN maps to the ingress port. If the same MAC shows up on another port, the entry moves.
    • Forward. Destination known and on another port: send it out that one port.
    • Filter. Destination known and on the same port it arrived on: drop it. You only see this behind a hub or another unmanaged switch.
    • Flood. Unknown unicast, broadcast, and multicast the switch has no snooping state for: send to every port in the VLAN, trunks included, except the ingress port.

    Aging

    The default is 300 seconds on Cisco IOS (mac address-table aging-time). Every frame from that MAC resets the timer. Topology changes flush or shorten it, which is why a busy spanning tree causes flooding.

    Looking at it

    Output
    SW1# show mac address-table dynamic vlan 10
              Mac Address Table
    -------------------------------------------
    
    Vlan    Mac Address       Type        Ports
    ----    -----------       --------    -----
      10    0050.56a1.0101    DYNAMIC     Gi1/0/1
      10    0050.56a1.0202    DYNAMIC     Gi1/0/48
    Total Mac Addresses for this criterion: 2

    The table is keyed on VLAN plus MAC, so the same MAC can live in two VLANs at once.

    Traps

    • Saying a switch learns from destination addresses. It learns only from source addresses.
    • Confusing MAC aging (300 seconds) with the ARP timeout (4 hours on Cisco IOS). They are different tables at different layers.
    How did you do?Book 3.2 Switched EthernetOwn page
  2. What is the difference between store-and-forward and cut-through switching?

    Say this first

    Store-and-forward receives the whole frame, checks the FCS, then sends it, so corrupt frames die at the first switch and latency grows with frame size. Cut-through starts sending once it has read the destination (and usually the VLAN tag), which cuts latency to well under a microsecond on modern ASICs, but it forwards corrupt frames. Catalyst campus switches are store-and-forward; many low-latency data center switches support cut-through.

    Go deeper

    The latency math

    A store-and-forward switch must receive the full frame before sending. A 1500-byte frame at 1 Gbps takes 1500 x 8 / 10^9 = 12 microseconds to arrive; at 10 Gbps it takes 1.2 microseconds. That cost is paid at every hop. For a campus user it is noise; for trading, HPC and some storage it matters.

    When cut-through falls back

    • The egress port is busy, so the frame has to be queued anyway.
    • The egress port is faster than the ingress port (10G in, 40G out). Starting early would run out of data mid-frame, so the switch buffers the whole frame first.

    Error behavior

    A cut-through switch has already sent most of a frame when it sees a bad FCS. It cannot drop it, so it ends the frame with a deliberately invalid FCS (Nexus calls this stomping). The bad frame is then counted as a CRC error on every hop downstream, and you have to trace it back to the port where it starts.

    Fragment-free

    A historic middle ground: wait for the first 64 bytes, which covers a collision fragment on half-duplex Ethernet, then cut through.

    Traps

    • Saying cut-through checks the FCS before forwarding. It cannot; the frame is already leaving.
    How did you do?Book 3.1 Switching BasicsBook 3.5 ImplementationOwn page
  3. Walk me through the fields of an Ethernet frame.

    Say this first

    On the wire: preamble (7 bytes) and SFD (1), then destination MAC (6), source MAC (6), an optional 802.1Q tag (4), EtherType or length (2), payload (46 to 1500) and FCS (4, a CRC-32). The frame counted from destination MAC to FCS is 64 to 1518 bytes, or up to 1522 with one VLAN tag.

    Go deeper

    Field by field

    FieldBytesNotes
    Preamble7Alternating 1s and 0s for clock sync
    SFD110101011, marks the start of the frame
    Destination MAC6First so a switch can start the lookup early
    Source MAC6What the switch learns from
    802.1Q tag4Optional. TPID 0x8100 plus PCP, DEI, VLAN ID
    EtherType / length20x0600 (1536) and up is an EtherType; 1500 and below is an 802.3 length
    Payload46 to 1500Padded up to 46 if shorter
    FCS4CRC-32 over the frame; bad FCS means drop

    After every frame there is a 12-byte interframe gap. So a 64-byte frame really occupies 84 bytes of wire time, which is why 1 Gbps line rate is 1,488,095 frames per second at minimum size.

    EtherTypes worth knowing

    0x0800 IPv4, 0x86DD IPv6, 0x0806 ARP, 0x8100 802.1Q, 0x88A8 802.1ad outer tag, 0x8847 MPLS, 0x88CC LLDP, 0x8809 slow protocols (LACP).

    Address bits

    The lowest bit of the first byte is the I/G bit: 1 means group (multicast or broadcast). The next bit is U/L: 1 means locally administered. ffff.ffff.ffff is broadcast; IPv4 multicast maps to 0100.5exx.xxxx and IPv6 multicast to 3333.xxxx.xxxx.

    Traps

    • Counting the preamble in the 64-byte minimum. The minimum runs from destination MAC to FCS.
    • Forgetting that a 4-byte tag pushes a full-size frame to 1522 bytes.
    How did you do?Book 2.3 FramingBook 2.6 Multi-Access NetworksOwn page
  4. PC1 and PC2 are in VLAN 10 on two switches joined by a trunk. Walk me through what happens when PC1 pings PC2.

    Say this first

    PC1 sees PC2 is in its own subnet, so it ARPs for PC2's MAC. The broadcast is learned and flooded by SW1, crosses the trunk tagged with VLAN 10, is learned and flooded by SW2, and PC2 answers with a unicast ARP reply. Now both switches know both MACs, and the ICMP echo and reply are forwarded port to port with no flooding. No MAC is rewritten and no TTL is decremented: nothing is routed.

    Go deeper

    Setup: PC1 10.10.0.11 (0050.56a1.0011) on SW1 Gi1/0/1, PC2 10.10.0.12 (0050.56a1.0012) on SW2 Gi1/0/2, trunk on Gi1/0/48 at both ends.

    1. PC1 ANDs 10.10.0.12 with its /24 mask: same subnet, so deliver directly. Its ARP cache has no entry for PC2.
    2. PC1 sends an ARP request: destination ffff.ffff.ffff, source 0050.56a1.0011.
    3. SW1 learns 0050.56a1.0011 on Gi1/0/1 in VLAN 10 and floods the broadcast to its other VLAN 10 ports and out Gi1/0/48 with an 802.1Q tag, VLAN ID 10.
    4. SW2 learns PC1's MAC on Gi1/0/48 in VLAN 10, strips the tag and floods to its VLAN 10 access ports.
    5. PC2 recognizes its IP and replies with a unicast ARP reply to 0050.56a1.0011.
    6. SW2 learns PC2 on Gi1/0/2, already knows PC1 is behind Gi1/0/48, and sends the reply tagged. SW1 learns PC2 on Gi1/0/48 and forwards to Gi1/0/1.
    7. PC1 caches the ARP entry and sends the ICMP echo request as unicast. Both switches forward it without flooding, and the reply comes back the same way.

    Each switch recomputes the FCS when it adds or removes the tag, because the frame contents change.

    Traps

    • Saying the switch answers the ARP. A plain layer 2 switch only floods it; PC2 answers.
    How did you do?Book 3.2 Switched EthernetBook 3.3 Internet (IP)Own page
  5. A port shows err-disabled. What does that mean and how do you bring it back?

    Say this first

    The switch shut the port in software because a protection feature tripped: BPDU guard, port security, UDLD, EtherChannel misconfig guard, link flap, storm control and others. I read the reason first, remove the cause, then shutdown and no shutdown. Automatic recovery exists (errdisable recovery cause ..., 300 seconds by default) but is off until you enable it per cause.

    Go deeper

    Find the reason

    Output
    SW1# show interfaces status err-disabled
    
    Port         Name               Status       Reason               Err-disabled Vlans
    Gi1/0/5      Desk 3.12          err-disabled bpduguard

    The log line at the moment it happened is just as useful:

    Output
    %SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Gi1/0/5 with BPDU Guard enabled. Disabling port.
    %PM-4-ERR_DISABLE: bpduguard error detected on Gi1/0/5, putting Gi1/0/5 in err-disable state

    Common reasons

    ReasonTrigger
    bpduguardA BPDU arrived on a port with BPDU guard
    psecure-violationPort security in shutdown mode saw a disallowed MAC
    udldUDLD found a unidirectional link
    channel-misconfigEtherChannel bundled on one side only
    link-flapThe link went up and down too often
    storm-controlStorm control with action shutdown
    dhcp-rate-limit, arp-inspectionDHCP snooping or DAI rate limit exceeded

    Automatic recovery

    Cisco IOS
    errdisable recovery cause bpduguard
    errdisable recovery cause psecure-violation
    errdisable recovery interval 300

    show errdisable recovery lists enabled causes and the time left per port.

    Traps

    • Bouncing the port without reading the reason. It trips again, or the loop it stopped comes back.
    How did you do?Own page
  6. What are CDP and LLDP, and how do they differ?

    Say this first

    Both are one-way layer 2 discovery protocols: a device advertises its name, port, platform, addresses and capabilities, and each neighbor caches it. CDP is Cisco proprietary, sent every 60 seconds with a 180-second holdtime to 0100.0ccc.cccc. LLDP is IEEE 802.1AB, sent every 30 seconds with a 120-second TTL to 0180.c200.000e, EtherType 0x88CC. I use LLDP in multi-vendor networks and turn both off on untrusted ports.

    Go deeper

    Side by side

    CDPLLDP
    StandardCiscoIEEE 802.1AB
    Timer / hold60 s / 180 s30 s / 120 s (4 x 30)
    Destination MAC0100.0ccc.cccc0180.c200.000e
    Default on Cisco IOSOnOff until lldp run
    PhonesVoice VLAN, powerLLDP-MED: network policy, power, location

    LLDP has four mandatory TLVs (chassis ID, port ID, TTL, end) and optional ones such as system name, port description, capabilities and management address. CDPv2 also carries native VLAN and duplex, and logs %CDP-4-NATIVE_VLAN_MISMATCH and %CDP-4-DUPLEX_MISMATCH when neighbors disagree.

    Defaults elsewhere

    NX-OS runs CDP by default and needs feature lldp. Arista EOS and Junos on EX switches run LLDP by default.

    Configuration

    Cisco IOS
    lldp run
    interface GigabitEthernet1/0/1
     no cdp enable
    Output
    SW1# show cdp neighbors
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                      D - Remote, C - CVTA, M - Two-port Mac Relay
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    SW2              Gig 1/0/48        157              S I   C9300-48P Gig 1/0/48

    Traps

    • Saying LLDP needs a reply from the neighbor. Neither protocol has requests or acknowledgments.
    • Assuming LLDP is on by default on Cisco IOS. It is off until lldp run.
    How did you do?Own page
  7. What is a VLAN and why would you use one?

    Say this first

    A VLAN is a separate layer 2 broadcast domain carved out of shared switch hardware. Ports in VLAN 10 and VLAN 20 cannot talk at layer 2, even on the same switch; traffic between them must be routed. We use VLANs to keep broadcast domains small, to separate groups like users, phones, cameras and guests for security and policy, and to group devices by role instead of by where they are plugged in.

    Go deeper

    What you get

    • Smaller broadcast domains. ARP, DHCP and other broadcasts stay inside the VLAN.
    • A policy point. Traffic between VLANs has to cross a router, layer 3 switch or firewall, which is where ACLs and inspection happen.
    • Per-group treatment. Voice gets its own VLAN and QoS; guests get a VLAN that only reaches the internet.
    • Flexibility. Two people on different floors can share a VLAN, two people at adjacent desks can be in different ones.

    Conventions

    One VLAN maps to one IP subnet. Hosts decide "local or via the gateway" by subnet, so mixing subnets in a VLAN or splitting one subnet across VLANs causes confusing failures.

    The cost

    A VLAN stretched across a whole campus is one large failure domain: a loop or broadcast storm in it reaches every switch. Modern campus designs keep VLANs inside one access block and route above it.

    Traps

    • Saying VLANs split collision domains. Every switch port already is its own collision domain; VLANs split broadcast domains.
    How did you do?Book 3.2 Switched EthernetOwn page
  8. What are the VLAN ranges, and where does a Cisco switch store its VLAN configuration?

    Say this first

    The VLAN ID is 12 bits, so 0 to 4095; 0 and 4095 are reserved, leaving 1 to 4094. On Cisco, 1 to 1005 is the normal range (VLAN 1 is the default and cannot be deleted, 1002 to 1005 are reserved for FDDI and Token Ring) and 1006 to 4094 is the extended range. Normal-range VLANs live in vlan.dat in flash, not in the running config, unless the switch runs VTP transparent or off mode.

    Go deeper

    RangeUse
    0Reserved (priority-tagged frames carry VLAN 0)
    1Default VLAN, cannot be deleted
    2 to 1001Normal range, VTP versions 1 and 2 can advertise them
    1002 to 1005Reserved legacy FDDI and Token Ring VLANs
    1006 to 4094Extended range: needs VTP transparent or off, or VTPv3
    4095Reserved

    The vlan.dat trap

    write erase clears the startup config but not vlan.dat. A switch "reset to defaults" still boots with its old VLANs, VTP domain and revision number. To really clear it:

    Cisco IOS
    SW1# write erase
    SW1# delete flash:vlan.dat
    SW1# reload

    In the running config or not

    In VTP server or client mode, show running-config does not list VLANs; back up vlan.dat or use show vlan brief. In transparent or off mode, VLANs appear in the running config and are saved with it.

    Traps

    • Saying there are 4096 usable VLANs. There are 4094.
    • Assuming write erase clears VLANs on a Catalyst switch.
    How did you do?Book 3.2 Switched EthernetOwn page
  9. What is the difference between an access port and a trunk port?

    Say this first

    An access port belongs to one VLAN and sends and receives untagged frames; end hosts plug in there. A trunk carries many VLANs over one link and marks each frame with an 802.1Q tag, except frames in the native VLAN. Trunks connect switches to switches, routers, firewalls, hypervisors and some APs. A port with a voice VLAN is still an access port, with one extra tagged VLAN for the phone.

    Go deeper

    Configuration

    Cisco IOS
    interface GigabitEthernet1/0/1
     description PC
     switchport mode access
     switchport access vlan 10
     spanning-tree portfast
    !
    interface GigabitEthernet1/0/48
     description Uplink to DSW1
     switchport mode trunk
     switchport trunk allowed vlan 10,20,30
     switchport trunk native vlan 999
     switchport nonegotiate

    Checking what a port really is

    Output
    SW1# show interfaces GigabitEthernet1/0/1 switchport
    Name: Gi1/0/1
    Switchport: Enabled
    Administrative Mode: static access
    Operational Mode: static access
    Administrative Trunking Encapsulation: dot1q
    Operational Trunking Encapsulation: native
    Negotiation of Trunking: Off
    Access Mode VLAN: 10 (USERS)
    Trunking Native Mode VLAN: 1 (default)

    Administrative mode is what you configured; operational mode is what it actually became. A port in dynamic mode can show "dynamic auto" and "trunk" at the same time.

    Who needs a trunk

    A hypervisor host with VMs in several VLANs, a firewall with one subinterface per VLAN, an AP that switches several SSIDs locally to their VLANs. An AP that tunnels all client traffic to a controller only needs an access port.

    Traps

    • Saying a trunk carries no untagged traffic. The native VLAN crosses untagged unless you tag it.
    How did you do?Book 3.2 Switched EthernetOwn page
  10. What is inside an 802.1Q tag?

    Say this first

    Four bytes inserted after the source MAC. A 2-byte TPID of 0x8100 says "tagged frame", then a 2-byte TCI: 3 bits of priority (PCP, the CoS value 0 to 7), 1 bit DEI (drop eligible, once called CFI) and 12 bits of VLAN ID. The original EtherType follows the tag, the FCS is recalculated, and the largest frame grows from 1518 to 1522 bytes.

    Go deeper

    Output
    | Dest MAC 6 | Src MAC 6 | TPID 0x8100 (2) | PCP 3b | DEI 1b | VID 12b | EtherType 2 | Payload | FCS 4 |

    The fields in practice

    • PCP / CoS. Layer 2 priority. Voice media is usually CoS 5, call signaling CoS 3. It only exists while the frame is tagged, which is why QoS designs carry the marking in DSCP at layer 3 as well.
    • DEI. Marks a frame as a candidate to drop first under congestion. Rarely used in enterprise.
    • VID. 0 means priority-tagged (a CoS value with no VLAN; the port's VLAN applies). 4095 is reserved.

    ISL, for history

    Cisco's older trunking protocol encapsulated the whole frame with a 26-byte header and a 4-byte CRC, 30 bytes in all. It is proprietary and gone from current platforms; Catalyst 9000 supports only 802.1Q.

    Traps

    • Placing the tag before the destination MAC. It sits between the source MAC and the EtherType.
    How did you do?Book 3.2 Switched EthernetOwn page
  11. What is DTP, and which port modes form a trunk?

    Say this first

    DTP is Cisco's protocol for negotiating whether a link becomes a trunk. access never trunks. trunk always trunks and still sends DTP. dynamic desirable actively asks to trunk. dynamic auto trunks only if the other side asks. switchport nonegotiate stops DTP frames. Auto plus auto stays access. Most current Catalyst switches default to dynamic auto, so I set every port to access or trunk explicitly and add nonegotiate on trunks.

    Go deeper

    Result for each pair

    accesstrunkdesirableauto
    accessaccessmismatchaccessaccess
    trunkmismatchtrunktrunktrunk
    desirableaccesstrunktrunktrunk
    autoaccesstrunktrunkaccess

    "Mismatch" means one side tags frames and the other does not: only untagged traffic works, and STP may flag inconsistencies. A side set to trunk with nonegotiate against a dynamic side gives the same mismatch, because the dynamic side never hears DTP.

    Details interviewers like

    • Dynamic trunking fails when the two switches have different VTP domain names; the switch logs %DTP-5-DOMAINMISMATCH.
    • In show interfaces trunk, an encapsulation of n-802.1q means the trunk was negotiated.
    • Older platforms such as the Catalyst 2950 and 3550 defaulted to dynamic desirable.
    • NX-OS and most other vendors do not run DTP. Against them, set the Cisco side to trunk.
    Output
    SW1# show interfaces GigabitEthernet1/0/24 switchport | include Administrative Mode|Operational Mode
    Administrative Mode: dynamic auto
    Operational Mode: static access

    Traps

    • Assuming switchport mode trunk alone disables DTP.
    • Leaving user ports in dynamic auto. That is exactly what switch spoofing needs.
    How did you do?Own page
  12. What is VTP and what do its modes do?

    Say this first

    VTP is Cisco's protocol for syncing the VLAN database (IDs and names, never port assignments) across the switches of one domain, over trunks. A server creates, changes and deletes VLANs and advertises them. A client takes VLANs from the servers and cannot change them locally. Transparent keeps its own local VLANs and only relays advertisements. Off ignores VTP and does not relay it. Catalyst switches default to server mode with no domain name.

    Go deeper

    Modes

    ModeCreate VLANs locallyFollows the domainRelays adverts
    ServerYesYesYes
    ClientNoYesYes
    TransparentYes, local onlyNoYes
    OffYes, local onlyNoNo

    In server and client mode the VLANs are not in the running config. In transparent and off mode they are, and they are saved with it.

    Versions

    • v1: the original.
    • v2: adds consistency checks, and a transparent switch relays advertisements without checking the domain name.
    • v3: adds a primary server, extended VLANs, private VLANs, MST region sync and a hidden password.

    Mechanics

    Advertisements go to 0100.0ccc.cccc on trunks only: a summary every 5 minutes and right after every change. Every change on a server raises the configuration revision number. VTP pruning, if enabled, stops flooding a VLAN over a trunk toward switches with no ports in it.

    Many networks run every switch transparent or off and push VLANs with automation instead.

    Traps

    • Thinking a client cannot overwrite the domain. In versions 1 and 2, a client with a higher revision number can.
    How did you do?Own page
  13. What is the difference between router-on-a-stick and SVIs for inter-VLAN routing?

    Say this first

    Router-on-a-stick routes between VLANs with one router interface split into 802.1Q subinterfaces over a trunk. It is cheap and simple, but every inter-VLAN packet crosses that one link twice and the router's forwarding rate is the ceiling. A layer 3 switch gives each VLAN an SVI and routes in hardware at line rate with no hairpin. Campus networks use SVIs; router-on-a-stick fits a small branch or a lab.

    Go deeper

    Side by side

    Router-on-a-stickSVI on a layer 3 switch
    Gateway lives onRouter subinterfaceinterface VlanN
    ForwardingRouter CPU or network processorSwitch ASIC
    Path between VLANsUp the trunk and back downInside the switch
    BottleneckTrunk bandwidth and router throughputRarely the switch
    Extra features in the pathNAT, firewall, VPN on the routerUsually only ACLs

    Configurations

    Cisco IOS
    ! Router-on-a-stick
    interface GigabitEthernet0/0/0.10
     encapsulation dot1Q 10
     ip address 10.10.0.1 255.255.255.0
    Cisco IOS
    ! Layer 3 switch
    ip routing
    interface Vlan10
     ip address 10.10.0.1 255.255.255.0

    The hairpin

    A packet from VLAN 10 to VLAN 20 goes up the trunk tagged 10 and comes back down tagged 20. The trunk carries all inter-VLAN traffic plus everything headed to the WAN, so it saturates early.

    Traps

    • Thinking the subinterface number must match the VLAN. Only the VLAN in encapsulation dot1Q matters.
    How did you do?Book 3.3 Internet (IP)Own page
  14. What is EtherChannel, and how do LACP, PAgP and static mode differ?

    Say this first

    EtherChannel bundles 2 to 8 parallel links into one logical link, so spanning tree sees one port and all links carry traffic. LACP (IEEE 802.3ad, now 802.1AX) negotiates with active and passive modes and works with any vendor. PAgP is Cisco only, with desirable and auto. Static on negotiates nothing. LACP forms with active plus active or active plus passive, never passive plus passive. I use LACP active on both ends.

    Go deeper

    Mode combinations

    Side ASide BResult
    activeactive or passiveLACP bundle
    passivepassiveNo bundle
    desirabledesirable or autoPAgP bundle
    autoautoNo bundle
    ononStatic bundle
    onanything elseBroken: one side bundled, the other not

    Why not static

    on cannot see the far end. If the neighbor is not bundled or is cabled to the wrong switch, on still bundles, and you get MAC flapping, blackholed traffic or a loop. LACP only bundles a port after exchanging LACPDUs with the same partner.

    LACP basics

    LACPDUs go to 0180.c200.0002 (EtherType 0x8809), every 30 seconds by default or every second with fast rate. Up to 8 members are active; many platforms allow up to 8 more as hot-standby.

    Cisco IOS
    interface range GigabitEthernet1/0/47 - 48
     switchport mode trunk
     channel-group 1 mode active
    interface Port-channel1
     switchport mode trunk
     switchport trunk allowed vlan 10,20,30

    Traps

    • Choosing on because it is simpler. It is the one mode that cannot detect a far end that is not bundled.
    How did you do?Own page
  15. How does a voice VLAN work on an access port with a phone and a PC behind it?

    Say this first

    The phone learns the voice VLAN from the switch through CDP or LLDP-MED. It tags its own voice frames with that VLAN and CoS 5, and passes the PC's frames through untagged, so they land in the access (data) VLAN. The port is still an access port; it just accepts one extra tagged VLAN. Voice and data get separate subnets, separate policy and separate QoS on one cable.

    Go deeper

    Configuration

    Cisco IOS
    vlan 10
     name DATA
    vlan 110
     name VOICE
    !
    interface GigabitEthernet1/0/5
     switchport mode access
     switchport access vlan 10
     switchport voice vlan 110
     spanning-tree portfast
     trust device cisco-phone

    trust device cisco-phone (Catalyst 9000 syntax; older switches use mls qos trust device cisco-phone) trusts markings only while CDP sees a Cisco phone on the port.

    Verify

    Output
    SW1# show interfaces GigabitEthernet1/0/5 switchport | include Access Mode|Voice
    Access Mode VLAN: 10 (DATA)
    Voice VLAN: 110 (VOICE)

    show cdp neighbors shows the phone with capability P.

    Non-Cisco phones

    They read the voice VLAN from the LLDP-MED network policy TLV. Enable lldp run, and on some platforms define a network-policy profile that names the voice VLAN and apply it to the port.

    With 802.1X

    Multi-domain authentication (MDA) authenticates the phone into the voice domain and the PC into the data domain on the same port.

    Traps

    • Calling a voice VLAN port a trunk. It is an access port that also accepts one tagged VLAN.
    How did you do?Own page

Working15

  1. What is unknown unicast flooding, and what causes it in a network with no loops?

    Say this first

    A switch floods a unicast frame to the whole VLAN when it has no MAC entry for the destination. A little is normal. A lot usually means asymmetric routing where the MAC entry ages out (300 seconds) long before the router's ARP entry (4 hours), frequent topology changes flushing the table, a full MAC table, or hosts that receive but never send.

    Go deeper

    The classic case: asymmetric routing

    DSW1 and DSW2 both have an SVI in VLAN 10. Traffic to server SRV1 leaves through DSW1, but SRV1 replies through its HSRP gateway on DSW2. DSW1 never sees a frame sourced by SRV1, so its MAC entry expires after 300 seconds. Its ARP entry is still valid for hours, so DSW1 keeps routing packets to SRV1's MAC, misses in the MAC table, and floods every one of them to all of VLAN 10.

    Fixes, in order of preference:

    • Make routing symmetric (align HSRP active with the routing path).
    • Make MAC aging at least as long as the ARP timeout, or shorten ARP on the SVI below 300 seconds (arp timeout 240 under interface Vlan10).

    Other causes

    • Topology changes. 802.1D shortens aging to 15 seconds after a TCN; RSTP flushes at once. Access ports without PortFast create a topology change every time a PC boots.
    • Full MAC table, from an attack or simply too many VMs for the platform.
    • Silent receivers, such as a syslog collector that never transmits.
    • Microsoft NLB in unicast mode, which floods by design.

    How to spot it

    Look for output traffic on access ports whose hosts are idle, or capture on a quiet port and look for unicast frames to other MACs.

    Traps

    • Blaming spanning tree for every flood. Check MAC and ARP timers and routing symmetry first.
    • Raising MAC aging everywhere without thinking. Very long aging slows recovery when a host really moves.
    How did you do?Book 3.2 Switched EthernetOwn page
  2. What is the difference between CAM and TCAM in a switch?

    Say this first

    CAM is exact-match memory: give it VLAN plus MAC and it returns the port in one lookup, so it holds the MAC table. TCAM stores a value and a mask, so each bit can be 0, 1 or don't-care. That lets it do longest-prefix-match routing, ACL, QoS and PBR lookups in one parallel step. TCAM is costly, hot and small, so its size sets how many routes and ACL entries a switch can hold in hardware.

    Go deeper

    Why the mask matters

    An ACL entry permit tcp 10.10.0.0 0.0.0.255 any eq 443 becomes a TCAM row where the first 24 bits of the source must match and the last 8 are don't-care, alongside protocol and port fields. A packet is compared against every row at once and the first matching row (highest priority) wins. A route lookup works the same way, with longer prefixes placed first.

    Carving up TCAM

    Catalyst switches divide TCAM with SDM templates: more space for routes, or for ACLs, or for IPv6. show sdm prefer shows the current split, and changing it needs a reload. Nexus uses TCAM carving commands for the same idea.

    When it runs out

    The switch logs a resource error. Routes or ACL entries that do not fit are either not installed or handled by the CPU in software, which is many times slower and can push the CPU to 100%. Symptoms look random: some prefixes are slow, some ACL lines do not work.

    Traps

    • Saying the MAC table lives in TCAM. It is an exact-match table; TCAM is for masked lookups.
    How did you do?Book 3.5 ImplementationOwn page
  3. How do MTU and jumbo frames work on a switch, and what breaks when they do not match?

    Say this first

    The layer 2 MTU is the largest payload a port will carry, 1500 bytes by default. Jumbo frames raise it to about 9000 bytes for storage, vMotion and overlays. A switch drops oversized frames silently and only counts them, with no ICMP back, so a mismatch looks like small packets working while big transfers hang. Every layer 2 hop and both hosts must agree.

    Go deeper

    Layer 2 MTU and IP MTU

    • Layer 2 MTU: largest frame payload a switch port accepts and forwards.
    • IP MTU: largest IP packet a routed interface sends without fragmenting. A layer 3 switch has both: a switching MTU and an ip mtu on each SVI or routed port.
    • Only a router can fragment or send ICMP "fragmentation needed". A switch just drops.

    Syntax differs a lot by platform

    PlatformCommand
    Catalyst 9000system mtu 9198 (global)
    Catalyst 3560/3750system mtu jumbo 9000, then reload
    Nexus 9000mtu 9216 per interface
    Arista EOSmtu 9214 per interface
    Junosset interfaces xe-0/0/1 mtu 9216 (counts the Ethernet header)
    Linuxip link set dev eth0 mtu 9000

    What breaks

    • Ping works, SSH works, file copies or iSCSI stall: the handshake is small, the data is not.
    • VXLAN adds 50 bytes over IPv4, so the underlay needs at least 1550 for 1500-byte guest frames.
    • On routed links an IP MTU mismatch also blocks OSPF adjacencies in EXSTART.

    Test it properly

    Cisco IOS
    SW1# ping 10.0.0.2 size 9000 df-bit
    Shell
    ping -M do -s 8972 10.0.0.2

    8972 = 9000 minus 20 (IP header) minus 8 (ICMP header).

    Traps

    • Testing with a plain ping. Without DF and a large size, the stack fragments and the test passes on a broken path.
    • Mixing up Junos MTU, which includes the 14-byte Ethernet header, with Cisco MTU, which does not.
    How did you do?Book 2.3 FramingOwn page
  4. You see MAC flapping messages in the log. What do they mean and what causes them?

    Say this first

    The switch keeps learning the same MAC in the same VLAN on two different ports, back and forth. %SW_MATM-4-MACFLAP_NOTIF names the MAC, the VLAN and both ports. A single move is normal (a VM or a laptop moved). Constant flapping usually means a layer 2 loop, an EtherChannel bundled on one side only, server NIC teaming sending one MAC out two independent ports, or two FHRP routers both active.

    Go deeper

    Output
    %SW_MATM-4-MACFLAP_NOTIF: Host 0050.56a1.2c3d in vlan 10 is flapping between port Gi1/0/12 and port Gi1/0/47

    Read the pattern

    • Many MACs, between an uplink and some access port, high CPU, line-rate broadcast: a loop. Contain it first by shutting the access port, then find out why STP did not block.
    • One or two MACs, between two ports cabled to the same server: NIC teaming or Linux bonding in a mode that needs a port-channel (balance-rr, balance-xor, 802.3ad) against plain access ports. Fix it with LACP on both sides or switch to active-backup.
    • MACs moving between the members of what should be a bundle: the far side is not bundled.
    • The HSRP virtual MAC flapping between two uplinks: both routers think they are active, usually because their hellos do not reach each other.

    Tools

    show mac address-table address 0050.56a1.2c3d shows where it is now. Follow the MAC hop by hop toward the port where it really lives, and look at show spanning-tree and interface rates along the way.

    Traps

    • Treating the message as cosmetic. Constant flapping means frames are going the wrong way right now.
    • Rebooting the switch to stop the messages. The cause is outside the switch.
    How did you do?Book 3.2 Switched EthernetOwn page
  5. What is switch stacking, and how is it different from a chassis or a pair of switches running MLAG?

    Say this first

    A stack joins several fixed switches with dedicated stack cables into one logical switch: one control plane on the active member, a hot standby, one config and one management IP, and EtherChannels that can span members. A chassis does the same with line cards and redundant supervisors. MLAG (vPC on Nexus) keeps two separate control planes that cooperate to present one port-channel, so each switch can be upgraded on its own.

    Go deeper

    How a Catalyst stack behaves

    • Members are numbered, and the number is in the interface name: Gi2/0/1 is port 1 on member 2. A Catalyst 9300 stack holds up to 8 members.
    • Roles are active, standby and member. At stack formation the highest stack priority wins (1 to 15, default 1), with the lowest MAC as the final tie breaker. A running active is not pre-empted when you add a higher-priority switch.
    • Active and standby run SSO. Every member forwards in hardware locally, so traffic between two ports on the same member never crosses the stack ring.
    • Cross-stack EtherChannel: one uplink from each of two members, so losing a member keeps the uplink.

    Tradeoffs to say out loud

    StackChassisMLAG / vPC
    Control planes11 (dual supervisor)2
    UpgradeWhole stack, usually one reloadSupervisor by supervisor on many platformsOne switch at a time
    ConfigOneOneTwo, kept consistent
    Failure domainSoftware bug hits all membersSameSmaller

    StackWise Virtual on Catalyst 9000 joins two switches over ordinary Ethernet links into one control plane, the modern form of VSS.

    Traps

    • Saying a stack removes all single points of failure. One control plane means one bad image or bug affects every member.
    How did you do?Own page
  6. How can an attacker hop between VLANs, and how do you stop it?

    Say this first

    Two ways. Switch spoofing: the attacker's machine speaks DTP to a port left in a dynamic mode, a trunk forms, and the attacker can send into and receive from every allowed VLAN. Double tagging: from the native VLAN, the attacker sends a frame with two tags; the first switch strips the outer tag as native and forwards it, and the next switch delivers it into the inner VLAN. Static access ports with nonegotiate stop the first; an unused or tagged native VLAN stops the second.

    Go deeper

    Switch spoofing

    Tools such as Yersinia send DTP desirable frames. If the access port is dynamic auto or desirable, it becomes a trunk. The attacker then tags frames with any VLAN ID and sees broadcast and flooded traffic from all allowed VLANs.

    Double tagging

    1. The attacker is in VLAN 1, which is also the native VLAN on the uplink trunk.
    2. They send a frame with an outer tag of 1 and an inner tag of 20.
    3. SW1 accepts the frame into VLAN 1 and consumes the outer tag. VLAN 1 is native on the trunk, so SW1 sends the frame out without adding a tag, which leaves the inner tag 20 as the first tag on the wire.
    4. SW2 reads tag 20 and delivers the frame into VLAN 20.

    It is one way only: replies go back with a single tag and never reach the attacker's VLAN. It is still enough for a crafted UDP attack.

    Hardening

    Cisco IOS
    interface range GigabitEthernet1/0/1 - 44
     switchport mode access
     switchport nonegotiate
     switchport access vlan 10
    interface range GigabitEthernet1/0/45 - 46
     description unused
     switchport mode access
     switchport access vlan 998
     shutdown
    interface GigabitEthernet1/0/48
     switchport mode trunk
     switchport nonegotiate
     switchport trunk native vlan 999
     switchport trunk allowed vlan 10,20,30
    !
    vlan dot1q tag native

    VLAN 999 has no access ports; VLAN 998 is a parking lot for unused ports.

    Traps

    • Changing the native VLAN number but leaving user ports in that VLAN. The attacker just needs to be in the native VLAN.
  7. Explain the VTP revision number disaster. How does it happen and how do you prevent it?

    Say this first

    Every change on a VTP server raises the configuration revision. A switch accepts any advertisement with the same domain name and password and a higher revision, and replaces its whole VLAN database with it. Plug in an old lab switch with the same domain and a higher revision, and its VLAN list, often missing most production VLANs, overwrites the domain. Ports in deleted VLANs go inactive everywhere. Prevent it by resetting the revision before connecting any switch, or by running transparent, off or VTPv3.

    Go deeper

    How it unfolds

    1. A switch comes back from the lab or an RMA. It still has domain CORP, the same password, and revision 41 from months of lab changes. Production is at revision 12.
    2. Someone plugs it into a free port. Both sides are dynamic, so DTP forms a trunk on its own.
    3. The lab switch advertises revision 41. Every switch in CORP accepts it and replaces its VLAN list.
    4. VLANs that only existed in production vanish. Access ports in them show as inactive, SVIs go down, trunks stop carrying them. The whole site loses those VLANs at once.

    Check before connecting

    Output
    SW9# show vtp status | include Mode|Domain|Revision
    VTP Domain Name                 : CORP
    VTP Pruning Mode                : Disabled
    VTP Operating Mode                : Server
    Configuration Revision            : 41

    Reset the revision to 0

    Change the domain to a dummy name and back, or switch to transparent and back:

    Cisco IOS
    SW9(config)# vtp mode transparent
    SW9(config)# vtp mode client

    Recovery if it already happened

    Disconnect the culprit first. Recreate the missing VLANs on a real server; the revision rises again and every switch learns them back. Ports return as soon as their VLAN exists. Keep VLAN lists in backups or a source of truth so you can rebuild names quickly.

    Prevention

    Transparent or off mode everywhere, or VTPv3 with a primary server, plus switchport mode access and nonegotiate so a stray switch cannot form a trunk in the first place.

    Traps

    • Believing a brand-new switch is the risk. A factory-fresh switch has revision 0 and no domain; reused switches are the danger.
    How did you do?Own page
  8. Why does show interfaces trunk list the VLANs four times, and how is the allowed list different from pruning?

    Say this first

    The sections narrow down: VLANs allowed by config; of those, the ones that exist and are active on this switch; of those, the ones in spanning-tree forwarding state on this port and not pruned. A VLAN has to survive all of them to cross. The allowed list is static config per trunk. VTP pruning is dynamic: a switch tells its neighbor which VLANs it needs, and the neighbor stops flooding the rest over that trunk.

    Go deeper

    Output
    SW1# show interfaces trunk
    
    Port        Mode             Encapsulation  Status        Native vlan
    Gi1/0/48    on               802.1q         trunking      999
    
    Port        Vlans allowed on trunk
    Gi1/0/48    10,20,30,40
    
    Port        Vlans allowed and active in management domain
    Gi1/0/48    10,20,30
    
    Port        Vlans in spanning tree forwarding state and not pruned
    Gi1/0/48    10,20
    • VLAN 40 is allowed but does not exist in SW1's VLAN database, so it drops out of the second list.
    • VLAN 30 exists but is either blocked by spanning tree on this port or pruned. show spanning-tree vlan 30 tells you which: an Altn BLK role on Gi1/0/48 means STP.

    Editing the allowed list safely

    Cisco IOS
    interface GigabitEthernet1/0/48
     switchport trunk allowed vlan add 50
     switchport trunk allowed vlan remove 40

    Without add or remove, the command replaces the whole list.

    VTP pruning

    Enabled domain-wide with vtp pruning on a server. VLAN 1 and 1002 to 1005 are never pruned. switchport trunk pruning vlan limits which VLANs are eligible on a trunk.

    Traps

    • Typing switchport trunk allowed vlan 50 on a live trunk. It removes every other VLAN.
    How did you do?Book 3.2 Switched EthernetOwn page
  9. Hosts in one VLAN cannot reach each other across a trunk, but other VLANs work. What do you check?

    Say this first

    I walk that VLAN through every filter on both ends of the link: is the link really trunking, does the VLAN exist and is it active on both switches, is it in the allowed list on both sides, is it pruned, is spanning tree blocking it on that port only, and do the native VLANs match. Most often the VLAN is missing on one switch or an allowed list was edited without add.

    Go deeper

    Order of checks

    1. show interfaces trunk on both ends. Status trunking, and the VLAN present in all four sections.
    2. show vlan id 30 on both switches. The VLAN must exist and be active. act/lshut means someone typed shutdown under vlan 30; sus means suspended.
    3. VTP: a client that never received the VLAN, or a transparent switch where nobody created it.
    4. show spanning-tree vlan 30. Is this port blocking for this VLAN alone? Look for *ROOT_Inc, *LOOP_Inc or *PVID_Inc in the type column.
    5. Native VLAN mismatch: CDP logs %CDP-4-NATIVE_VLAN_MISMATCH, and untagged traffic lands in the wrong VLAN.
    6. If the far end is not a switch: the port group VLAN on the hypervisor, the subinterface on the firewall or router.
    7. show mac address-table vlan 30 on each switch. Do the hosts' MACs appear on the trunk port at the far end?

    Each step tells you which side to look at next, so you never change anything blind.

    Traps

    • Checking only one end. The allowed list and the VLAN database are per switch, and either side can drop the VLAN.
    How did you do?Own page
  10. What is the difference between an SVI and a routed port on a layer 3 switch, and when do you use each?

    Say this first

    An SVI (interface Vlan10) is a virtual routed interface for a whole VLAN. It serves many layer 2 ports and is the gateway for hosts. A routed port (no switchport plus an IP) turns one physical port into a plain router interface: no VLAN, no spanning tree, no DTP. I use SVIs for host gateways and routed ports for links between layer 3 switches, because a routed port goes down the moment the link fails and there is no layer 2 path that could loop.

    Go deeper

    Configuration

    Cisco IOS
    interface Vlan10
     description Users gateway
     ip address 10.10.0.1 255.255.255.0
    !
    interface GigabitEthernet1/0/48
     description Routed uplink to CORE1
     no switchport
     ip address 10.0.0.1 255.255.255.254

    Why routed uplinks converge faster

    • An SVI stays up while any port in its VLAN is up and forwarding. If an uplink in a "transit VLAN" fails but another port in that VLAN is up, the SVI never goes down and the routing protocol waits for its dead timer.
    • A routed port goes down with the link. OSPF or EIGRP drop the neighbor and reroute immediately.
    • No spanning tree runs on a routed port, so there is no blocked link and no loop risk between the layer 3 switches.

    Where SVIs still belong between switches

    A layer 2 trunk between two distribution switches that share VLANs (for HSRP and for stretched access VLANs) still needs SVIs on both. The routed uplinks go north to the core.

    Traps

    • Building every point-to-point uplink as a dedicated VLAN with SVIs. It pulls spanning tree and autostate into the routed core for nothing.
    How did you do?Own page
  11. An SVI shows up/down. Why, and what is autostate?

    Say this first

    An SVI comes up only when its VLAN exists in the VLAN database, the SVI is not shut down, and at least one layer 2 port in that VLAN is up and forwarding in spanning tree. That last rule is autostate. With no active ports the SVI shows up/down, its connected route is withdrawn and the switch stops advertising the subnet, which is what you want when nothing in the VLAN can be reached.

    Go deeper

    Output
    DSW1# show ip interface brief | include Vlan
    Vlan10                 10.10.0.2       YES NVRAM  up                    up
    Vlan30                 10.30.0.2       YES NVRAM  up                    down

    Checklist for a down SVI

    1. Does the VLAN exist? show vlan id 30. On IOS, creating interface Vlan30 does not create VLAN 30.
    2. Is any access port in VLAN 30 up? show interfaces status vlan 30.
    3. Is VLAN 30 allowed, active and forwarding on some trunk? show interfaces trunk.
    4. Is spanning tree blocking every port in VLAN 30 on this switch?
    5. Is the SVI itself shut? That shows administratively down instead.

    Excluding ports from the calculation

    switchport autostate exclude on a port stops it from counting, for example a SPAN destination or a monitoring port that should not keep a VLAN's SVI alive. NX-OS can turn autostate off per SVI with no autostate.

    Traps

    • Creating the SVI and assuming the VLAN exists. Check show vlan on the same switch.
    How did you do?Own page
  12. What is the difference between a layer 3 switch and a router?

    Say this first

    Both route IP. A layer 3 switch routes in ASICs at line rate across many Ethernet ports at a low cost per port, but with limited route and ACL tables, small buffers and a narrow feature set. A router forwards in software or a network processor and is built for the edge: WAN interfaces, full BGP tables, NAT and IPsec at scale, deep buffers and per-flow shaping. In a campus the layer 3 switch routes between VLANs; the router or firewall sits at the WAN and internet edge.

    Go deeper

    Layer 3 switchRouter
    ForwardingFixed-function ASICCPU or programmable network processor
    PortsDense EthernetFewer, mixed: Ethernet, LTE, serial, SFP
    Route scaleBounded by TCAMLarge, full internet tables on edge routers
    FeaturesACLs, basic QoS, some NAT and MPLS on newer modelsNAT, IPsec, zone firewall, hierarchical shaping, SD-WAN
    BuffersShallowDeeper
    Cost per portLowHigh

    The line is blurring. Campus switches now do VXLAN and some MPLS, data center switches hold large tables, and routers carry switch modules. The useful question is: what must this box do, at what scale, with which features in the forwarding path?

    Traps

    • Saying a layer 3 switch cannot run routing protocols. It runs OSPF, EIGRP and BGP; the limits are scale and features.
    How did you do?Book 3.5 ImplementationOwn page
  13. What must match for ports to bundle into an EtherChannel, and what happens when one does not?

    Say this first

    All members must agree with each other and with the port-channel: speed and duplex, layer 2 or layer 3, access or trunk mode, the same access VLAN or the same allowed and native VLANs, and the same channel protocol and partner. A member that disagrees is suspended (s in show etherchannel summary) with a log message giving the reason, while the rest of the bundle keeps working. I make every change on the port-channel interface, which applies it to all members.

    Go deeper

    What a suspended member looks like

    Output
    ASW2# show etherchannel summary | begin Group
    Group  Port-channel  Protocol    Ports
    ------+-------------+-----------+-----------------------------------------------
    1      Po1(SU)         LACP      Gi1/0/47(P)     Gi1/0/48(s)
    Output
    %EC-5-CANNOT_BUNDLE2: Gi1/0/48 is not compatible with Gi1/0/47 and will be suspended (vlan mask is different)

    Someone added a VLAN on Gi1/0/48 directly instead of on Po1.

    Flags worth knowing

    P bundled, s suspended, I stand-alone, H hot-standby, D down. On the port-channel, SU is layer 2 and in use, RU layer 3 and in use, SD layer 2 and down.

    Partner checks

    LACP also checks that every member reaches the same partner system ID. A member cabled to a different switch cannot join the bundle. On Catalyst 9000, a member whose far end does not run LACP logs %ETC-5-L3DONTBNDL2: Gi1/0/47 suspended: LACP currently not enabled on the remote port.

    Changing a live bundle

    Cisco IOS
    interface Port-channel1
     switchport trunk allowed vlan add 40

    Done on the port-channel, the change reaches both members at once and nothing gets suspended.

    Traps

    • Editing a member interface instead of the port-channel. The member drifts from the bundle and gets suspended.
    How did you do?Own page
  14. How does EtherChannel load balancing work, and why is one link often busier than the others?

    Say this first

    It does not spread packets round robin. Each switch hashes fields of every frame, such as MACs, IPs or layer 4 ports, into a bucket that maps to one member, so a flow always uses one link and stays in order. The spread is only as good as the variety in the hashed fields: hash on MACs toward a single router and nearly everything lands on one link. Each side hashes its own outbound traffic, so I set the method on both ends; Catalyst sets it globally with port-channel load-balance.

    Go deeper

    Choosing inputs

    MethodGood when
    src-mac, dst-mac, src-dst-macMany hosts talk across a pure layer 2 bundle
    src-dst-ipRouted traffic, or few MACs but many IPs
    Layer 4 options (src-dst-port, or mixed IP and port on newer platforms)Few hosts with many sessions, such as server to backup target

    Defaults vary by platform, and many Catalyst switches default to a MAC-based method, so check and change it.

    Cisco IOS
    DSW1(config)# port-channel load-balance src-dst-ip
    Output
    DSW1# show etherchannel load-balance
    EtherChannel Load-Balancing Configuration:
            src-dst-ip
    
    EtherChannel Load-Balancing Addresses Used Per-Protocol:
    Non-IP: Source XOR Destination MAC address
      IPv4: Source XOR Destination IP address
      IPv6: Source XOR Destination IP address
    DSW1# test etherchannel load-balance interface port-channel 1 ip 10.10.0.10 10.20.0.10
    Would select Gi1/0/48 of Po1

    Why 2, 4 or 8 links

    Many Catalyst ASICs hash into 8 buckets. With 2, 4 or 8 members each gets an equal share. With 3 members the split is 3:3:2; with 5 it is 2:2:2:1:1.

    Polarization

    If every layer in a design uses the same hash on the same fields, the second layer receives only flows that already hashed one way, and some of its links sit idle. Use different inputs at different layers, or a per-switch hash seed where the platform offers one.

    Traps

    • Expecting a 2 x 10G bundle to give one TCP session 20 Gbps.
    How did you do?Own page
  15. What is the native VLAN, and why do people say you should change it?

    Say this first

    The native VLAN is the one VLAN on an 802.1Q trunk whose frames cross untagged. It is VLAN 1 by default. I change it to an unused VLAN and tag it or prune it, because leaving user traffic in the native VLAN enables double-tagging attacks and a native VLAN mismatch quietly leaks traffic between VLANs.

    Go deeper

    What it does

    802.1Q inserts a 4-byte tag after the source MAC. Frames in the native VLAN skip the tag. A switch that receives an untagged frame on a trunk puts it in its own configured native VLAN.

    Why it matters

    • Double tagging. An attacker in the native VLAN sends a frame with two tags. The first switch strips the outer tag (it matches the native VLAN) and forwards the frame, still tagged with the inner VLAN, across the trunk. The next switch delivers it into the victim VLAN. It is one way only, but it works.
    • Mismatch. If one side uses native VLAN 1 and the other uses 99, untagged frames jump between VLAN 1 and VLAN 99. CDP logs %CDP-4-NATIVE_VLAN_MISMATCH, and STP blocks the port for PVST+ with an inconsistent state.

    What I configure

    Cisco IOS
    interface GigabitEthernet1/0/48
     switchport mode trunk
     switchport trunk native vlan 999
     switchport trunk allowed vlan 10,20,30
     switchport nonegotiate
    !
    vlan dot1q tag native

    VLAN 999 has no access ports. vlan dot1q tag native makes the switch tag even the native VLAN.

    Traps

    • Saying the native VLAN carries "management traffic". It carries whatever is untagged, nothing more.
    • Forgetting that both ends must agree. The mismatch is the most common real outage here.
    How did you do?Book 3.2 Switched EthernetOwn page

Expert6

  1. What does VTP version 3 change, and would you run it?

    Say this first

    VTPv3 adds a primary server. Only the switch promoted with vtp primary can change the database; other servers just store and relay it. A switch with a higher revision but a different primary server ID cannot take over the domain, which removes the classic disaster. It also carries extended VLANs (1006 to 4094), private VLANs and MST region config, supports a hidden password and off mode, and can be disabled per trunk. A mistake on the primary still spreads everywhere in seconds.

    Go deeper

    Setup

    Cisco IOS
    SW1(config)# vtp domain CORP
    SW1(config)# vtp version 3
    SW1(config)# vtp mode server
    SW1(config)# vtp password Str0ngSecret hidden
    SW1(config)# end
    SW1# vtp primary vlan

    vtp primary is an EXEC command, not a config line. It asks for confirmation and for the password. Other switches run vtp mode server (secondary servers) or client.

    Separate features

    The VLAN database and the MST region config are separate VTPv3 features, each with its own primary (vtp primary mst). That lets you keep the MST name, revision and VLAN-to-instance mapping identical on every switch, which is the hardest part of running MST.

    Per-port control

    no vtp on an interface stops VTP on that trunk, useful at the edge of the domain.

    Would I run it

    It is safe from the stray-switch problem, and MST sync is a real benefit. The remaining risk is human: a VLAN deleted on the primary disappears from every switch. Shops with good automation often prefer transparent or off mode plus a source of truth that pushes VLANs.

    Traps

    • Assuming VTPv3 protects you from a mistake made on the primary. It protects you from the wrong switch, not the wrong command.
    How did you do?Own page
  2. What are private VLANs and when would you use them?

    Say this first

    Private VLANs split one VLAN and one subnet into isolated pieces at layer 2. A primary VLAN holds secondary VLANs: one isolated VLAN, whose ports only talk to promiscuous ports, and any number of community VLANs, whose ports talk to each other and to promiscuous ports. The promiscuous port, usually the gateway or firewall, talks to everyone. They suit DMZs, hosting, and guest or hotel networks, where hosts share a subnet but should not reach each other.

    Go deeper

    Who can talk to whom

    From / toPromiscuousSame communityOther communityIsolated
    PromiscuousYesYesYesYes
    CommunityYesYesNoNo
    IsolatedYesNoNoNo

    Configuration on a Catalyst

    Needs VTP transparent or off mode (or VTPv3).

    Cisco IOS
    vtp mode transparent
    vlan 201
     private-vlan isolated
    vlan 202
     private-vlan community
    vlan 200
     private-vlan primary
     private-vlan association 201,202
    !
    interface GigabitEthernet1/0/10
     switchport mode private-vlan host
     switchport private-vlan host-association 200 201
    !
    interface GigabitEthernet1/0/48
     description Firewall
     switchport mode private-vlan promiscuous
     switchport private-vlan mapping 200 201,202
    !
    interface Vlan200
     ip address 10.200.0.1 255.255.255.0
     private-vlan mapping 201,202

    The SVI mapping lets hosts in the secondary VLANs reach their gateway. Across switches, secondary VLANs ride a normal trunk as ordinary VLANs, and every switch needs the same PVLAN definitions.

    Hosts going through the router

    Isolated hosts cannot ARP each other. If you want them to talk only through the gateway, where an ACL can inspect it, enable ip local-proxy-arp on the SVI.

    Traps

    • Forgetting private-vlan mapping on the SVI, which leaves secondary-VLAN hosts without a gateway.
    How did you do?Book 3.2 Switched EthernetOwn page
  3. What is QinQ and when would you use it?

    Say this first

    QinQ (802.1ad provider bridging) adds a second, outer VLAN tag in front of the customer's tag, so a provider can carry all of a customer's VLANs through its network inside one service VLAN. The standard outer tag uses EtherType 0x88A8; Cisco dot1q-tunnel ports on many Catalyst platforms use 0x8100 for both. Each tag adds 4 bytes, so a full-size customer frame becomes 1526 bytes and the core MTU has to allow it.

    Go deeper

    Where it fits

    • Metro Ethernet: one service VLAN per customer, with the customer's own VLANs untouched inside it.
    • Multi-tenant data centers and labs that need to overlap VLAN IDs between tenants.
    • Scale: 4094 outer by 4094 inner identifiers.

    Catalyst provider edge port

    Cisco IOS
    vlan 100
     name CUST-A
    !
    interface GigabitEthernet1/0/10
     description Customer A handoff
     switchport access vlan 100
     switchport mode dot1q-tunnel
     l2protocol-tunnel cdp
     l2protocol-tunnel stp
     l2protocol-tunnel vtp
    !
    system mtu 1504

    Every frame from the customer, tagged or not, gets an outer tag of 100 on the provider trunks and loses it again at the far tunnel port.

    Layer 2 protocol tunneling

    Without l2protocol-tunnel, the provider switch would process or drop the customer's CDP, STP and VTP. With it, those frames are carried across so the customer's sites see each other as directly connected.

    Traps

    • Forgetting the MTU. Two tags on a 1500-byte payload make a 1526-byte frame.
    How did you do?Book 3.2 Switched EthernetOwn page
  4. What does EtherChannel misconfig guard do, and why does configuring only one side as "on" cause trouble?

    Say this first

    With on, a switch bundles its ports without asking the neighbor. If the neighbor is not bundled, one side sees one logical link and the other sees separate links, and traffic comes back up the bundle it went down. STP's EtherChannel misconfig guard, on by default on Catalyst, detects this from the BPDUs arriving on the bundle and err-disables the members with reason channel-misconfig. With LACP on one side and on on the other, the LACP side suspends its ports while the on side believes the bundle is up.

    Go deeper

    Case 1: on against unbundled ports

    The unbundled neighbor floods a broadcast received on one link out its other link, straight back into the bundle. The bundled side relearns its own hosts' MACs on the port-channel and starts sending their traffic the wrong way. The guard catches it:

    Output
    %SPANTREE-2-CHNL_MISCFG: Detected loop due to etherchannel misconfiguration of Gi1/0/47
    %PM-4-ERR_DISABLE: channel-misconfig (STP) error detected on Gi1/0/47, putting Gi1/0/47 in err-disable state
    %PM-4-ERR_DISABLE: channel-misconfig (STP) error detected on Gi1/0/48, putting Gi1/0/48 in err-disable state

    Case 2: on against LACP

    The LACP side never hears a partner. On Catalyst 9000 it suspends its members:

    Output
    %ETC-5-L3DONTBNDL2: Gi1/0/47 suspended: LACP currently not enabled on the remote port.

    The on side shows Po1(SU) with both members (P) and keeps sending flooded traffic into links the neighbor drops. Redundancy is gone and nothing on the on side says so.

    Recovery

    Make both ends match, ideally LACP active, then bounce the port-channel to clear the err-disable:

    Cisco IOS
    DSW1(config)# interface Port-channel1
    DSW1(config-if)# shutdown
    DSW1(config-if)# no shutdown

    The guard itself is spanning-tree etherchannel guard misconfig, enabled by default.

    Traps

    • Clearing the err-disable before fixing both ends. The guard trips again, or worse, it does not and the misdirected traffic returns.
    How did you do?Own page
  5. How does LACP decide which links are active when you have more than eight, and what are LACP rate and priority for?

    Say this first

    Many platforms allow 16 ports in an LACP bundle: 8 active and up to 8 hot-standby. The switch with the better system ID (lower system priority, then lower MAC) decides which ports are active, choosing the lowest port priority and then the lowest port number. Hot-standby ports (H) replace a failed active member. Rate slow sends LACPDUs every 30 seconds with a 90-second timeout; fast sends every second with a 3-second timeout. Priorities default to 32768.

    Go deeper

    Controls

    Cisco IOS
    lacp system-priority 100
    !
    interface GigabitEthernet1/0/1
     lacp port-priority 100
     lacp rate fast
     channel-group 1 mode active
    !
    interface Port-channel1
     lacp max-bundle 4
     port-channel min-links 2
    • lacp max-bundle caps active members; the rest wait in hot-standby.
    • port-channel min-links takes the whole bundle down when fewer members are up, so routing moves traffic to another path instead of squeezing it into half the bandwidth.
    • lacp rate fast catches a member that stays up but stops passing frames, for example through a media converter, in about 3 seconds instead of 90.

    Reading the neighbor

    Output
    DSW1# show lacp 1 neighbor
    Flags:  S - Device is requesting Slow LACPDUs
            F - Device is requesting Fast LACPDUs
            A - Device is in Active mode       P - Device is in Passive mode
    
    Channel group 1 neighbors
    
                         LACP port                      Admin  Oper   Port    Port
    Port          Flags  Priority  Dev ID          Age  key    Key    Number  State
    Gi1/0/47      SA     32768     aabb.cc00.0500  12s  0x0    0x1    0x130   0x3D
    Gi1/0/48      SA     32768     aabb.cc00.0500   9s  0x0    0x1    0x131   0x3D

    Same Dev ID on both members means both reach the same partner. State 0x3D means active, aggregatable, in sync, collecting and distributing.

    Traps

    • Assuming more than 8 members can forward at once. The extra members are hot-standby.
    How did you do?Own page
  6. How does a layer 3 switch route a packet between two VLANs in hardware?

    Say this first

    The host sends the frame to its gateway's MAC, the SVI's MAC. The switch sees its own router MAC as the destination, so it routes instead of bridging: a longest-prefix lookup in the FIB (held in TCAM) returns an adjacency with the rewrite information. The ASIC swaps the source MAC to the SVI's and the destination MAC to the host's, decrements the TTL, fixes the IP checksum and recomputes the FCS, then sends it out the right port in the egress VLAN, all at line rate. Only exceptions go to the CPU.

    Go deeper

    Step by step

    PC1 10.10.0.10 in VLAN 10 sends to PC2 10.20.0.10 in VLAN 20. Both gateways are SVIs on DSW1.

    1. PC1 sends the frame to the MAC of interface Vlan10, with PC2's IP as destination.
    2. DSW1 receives it in VLAN 10. The destination MAC is its router MAC, so the frame goes to the layer 3 lookup instead of the MAC table.
    3. The FIB returns the host entry for 10.20.0.10, learned from ARP, pointing at an adjacency on Vlan20.
    4. The adjacency holds the new header: destination MAC of PC2, source MAC of the Vlan20 SVI, VLAN 20.
    5. The MAC table for VLAN 20 gives the egress port. TTL goes from 128 to 127 and the frame leaves.

    What goes to the CPU (punted)

    • No ARP entry yet for PC2: the glean adjacency sends the packet to the CPU, which ARPs.
    • TTL expiring (traceroute), packets addressed to the switch itself, IP options.
    • Features the hardware cannot do on that platform.

    Commands

    show ip cef 10.20.0.10 detail shows the FIB entry, show adjacency vlan 20 detail the rewrite, and show ip arp vlan 20 the ARP entries the adjacencies are built from.

    Traps

    • Saying the switch looks up the destination MAC in the MAC table and floods. A frame addressed to the router MAC is routed, not bridged.
    How did you do?Book 3.5 ImplementationBook 3.3 Internet (IP)Own page