From point A to point B
Point A: You connect switches and PCs and you know "there are VLANs and there are cables", but it is not clear why a trunk comes up by itself, why an interface shows err-disabled or why three cables between two switches do not add up to three gigabits. Point B: You pick the right cable for each pair of devices, read the MAC table and the ARP table, secure access with SSH, interpret an interface status, configure and harden a trunk, avoid the VTP revision number disaster and predict which switch becomes the root bridge and which ports end up blocked.
This chapter covers Part 5 of Day 1. It mixes topics from several exam domains (cabling and addressing in 1.0, secure access in 5.0), but its core is 2.0 Network Access: trunking, Spanning Tree and EtherChannel. VTP is not in the exam blueprint, although you will meet it in any real network.
Traffic, duplex and UTP cabling
An Ethernet network carries three types of traffic. Telling them apart explains almost everything a switch does.
| Type | Destination | Example |
|---|---|---|
| Unicast | A single device (its MAC) | An HTTP session between a PC and a server |
| Broadcast | Every device in the VLAN: FF:FF:FF:FF:FF:FF at layer 2 | ARP request, DHCP Discover |
| Multicast | A group of devices: MAC 01:00:5E:xx:xx:xx for IPv4 and 33:33:xx:xx:xx:xx for IPv6 | OSPF (224.0.0.5), video traffic, Neighbor Discovery |
IGMP exists only for IPv4 multicast: hosts announce which group they want to join and the switch, with IGMP snooping, sends the traffic only to those ports. It does not control broadcast. To limit excess broadcast you use features such as storm-control on the interface; DHCP snooping and Dynamic ARP Inspection solve a different problem (DHCP and ARP spoofing).
Duplex describes how the medium is used. In simplex communication goes one way only (radio, television). In half duplex both directions are possible but not at the same time, like a walkie-talkie, and collisions are handled with CSMA/CD. In full duplex a device sends and receives simultaneously with no collisions: it is what you should use on any switch link.
interface GigabitEthernet0/1
speed auto
duplex auto
mdix auto
!
SW1#show interfaces GigabitEthernet0/1 status
Port Name Status Vlan Duplex Speed Type
Gi0/1 connected 1 a-full a-1000 10/100/1000BaseTX
Speed and duplex autonegotiation and how to verify it (a-full and a-1000 mean negotiated values)
UTP cable has four pairs and is terminated with two color standards, T568A and T568B. A straight-through cable uses the same standard at both ends; a crossover cable uses T568A at one end and T568B at the other. The reason is in the pins: in Fast Ethernet, PC and router NICs (MDI) transmit on pins 1 and 2 and receive on 3 and 6, while switch ports (MDI-X) do the opposite. If you connect two devices of the same type their transmitters would clash, so the pairs must be crossed.
| Connection | Cable |
|---|---|
| PC – switch | Straight-through |
| Router – switch | Straight-through |
| PC – router (Ethernet port) | Crossover |
| Switch – switch | Crossover (or straight-through with Auto-MDIX) |
| PC – PC, router – router | Crossover |
A PC and a router look like different devices, but both are MDI on their Ethernet ports, so they need a crossover. With Auto-MDIX (mdix auto, enabled by default on current Catalyst switches) the port detects the polarity and crosses internally, so a straight-through cable also works between switches.
A router or switch is a computer without a screen: it has CPU, RAM, NVRAM, flash holding the IOS and ROM. To see it you use the console cable (rollover, RJ-45 to serial or USB) and a terminal program set to 9600 baud, 8 data bits, no parity, 1 stop bit and no flow control. Over the network you reach it with Telnet or SSH.
MAC addresses, ARP and the MAC table
A MAC address is 48 bits, written in hexadecimal. The first 24 are the OUI (it identifies the manufacturer) and the last 24 are assigned by the manufacturer to each interface. To communicate over an IP network you need two addresses: the IP (layer 3) and the MAC (layer 2); without an association between them there is no traffic.
In IPv6 the MAC is used to build the interface identifier with EUI-64: the MAC is split in half, FFFE is inserted in the middle and bit 7 of the first byte (the U/L bit) is flipped. The solicited-node multicast addresses also come from the MAC: the prefix FF02::1:FF00:0/104 plus the last 24 bits of the unicast address.
! EUI-64 from MAC 001A.2B3C.4D5E
! 00 becomes 02 (bit 7 is flipped) and FFFE is inserted in the middle
Interface ID : 021A:2BFF:FE3C:4D5E
Solicited-node : FF02::1:FF3C:4D5E
SW1#show mac address-table dynamic
Mac Address Table
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 001a.2b3c.4d5e DYNAMIC Fa0/1
1 001c.5f6a.7b8c DYNAMIC Fa0/2
R1#show ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.10.10.1 - 0001.4321.AAAA ARPA GigabitEthernet0/0
Internet 10.10.10.12 3 001c.5f6a.7b8c ARPA GigabitEthernet0/0
EUI-64, solicited-node address, switch MAC table and router ARP table
ARP resolves layer 3 to layer 2: you know the destination IP and you need its MAC. PC1 sends an ARP request as a broadcast ("who has 10.10.10.12?"); only the owner of that IP answers with a unicast ARP reply, and PC1 stores the IP–MAC pair in its ARP table. Routers also keep an ARP table per interface.
IPv6 has no ARP because it has no broadcast. Neighbor Discovery replaces it, using ICMPv6 messages: Neighbor Solicitation (type 135) and Neighbor Advertisement (136) resolve addresses, with the solicitation sent to the solicited-node multicast address; Router Solicitation (133) and Router Advertisement (134) discover the router; and Duplicate Address Detection checks that an address is not already in use. The equivalent table is shown with show ipv6 neighbors.
The switch builds its MAC table without anyone configuring it. Out of the box it is empty and all ports are in VLAN 1:
- A frame arrives: the switch learns the source MAC and associates it with the ingress port (with an aging time of 300 seconds by default).
- It looks up the destination MAC in the table. If found, it sends the frame only out that port (forwarding).
- If unknown (unknown unicast), or if it is broadcast or multicast, it sends the frame out every port in the VLAN except the one it arrived on (flooding).
- PC1's ARP request is a broadcast, so it is flooded; PC2's reply comes back as unicast and the switch learns its MAC too.
- From then on, the conversation between the two is no longer flooded.
Secure access to the switch
You enter a switch through the console or, over the network, through Telnet or SSH (vty lines). If the line asks for no credentials, whoever arrives lands in user mode (Switch>), types enable and, if there is no enable password either, reaches privileged mode and from there configure terminal. The first security task is to close that door.
Each step is a barrier you can secure: the line, the user and the enable.
There are three ways to authenticate access to a line: a password directly on the line (login), local users (login local) or an AAA server (authentication, authorization and accounting) using RADIUS or TACACS+. TACACS+ is a Cisco-originated protocol running over TCP 49; RADIUS is an open standard that uses UDP. With AAA, accounts, permissions and logs are managed in one place.
| Command | How it is stored | Note |
|---|---|---|
| enable password | Plain text (type 0); with service password-encryption, type 7, reversible | Legacy; do not use |
| enable secret | MD5 hash (type 5) by default | If both exist, the secret wins |
| enable algorithm-type scrypt secret | scrypt hash (type 9); sha256 is type 8 | Recommended when the IOS supports it |
Telnet (TCP 23) travels in clear text: anyone on the path can read the username and password. SSH (TCP 22) encrypts the session; use version 2. To enable it the switch needs a hostname, a domain name and an RSA key pair. The management IP address goes on a VLAN interface (SVI).
hostname SW1
ip domain-name thehouseofrouting.com
!
enable algorithm-type scrypt secret Cl4ve-Larga-2021
username admin privilege 15 algorithm-type scrypt secret Otra-Cl4ve-Larga
service password-encryption
!
crypto key generate rsa modulus 2048
ip ssh version 2
!
line con 0
login local
logging synchronous
line vty 0 15
login local
transport input ssh
exec-timeout 5 0
!
interface Vlan99
ip address 192.168.99.2 255.255.255.0
no shutdown
ip default-gateway 192.168.99.1
!
SW1#show ip ssh
SW1#show users
SSH access with a local user, hashed enable and management on VLAN 99
transport input ssh and limit session time with exec-timeout.Interface status
Every interface has two states: line (physical layer: cable, signal) and protocol (layer 2: encapsulation, keepalives). The protocol depends on the line: if the line is down, the protocol cannot be up. That is why the down/up combination does not exist.
| Line / protocol | Meaning | Common causes |
|---|---|---|
| administratively down / down | Turned off by configuration | shutdown was applied |
| down / down (notconnect) | No physical link | Missing or damaged cable, wrong cable type, remote end off |
| up / down | The physical layer works, layer 2 fails | Mismatched encapsulations (for example HDLC on one side and PPP on the other), no keepalives |
| up / up | Operational | Normal operation |
| down (err-disabled) | The switch shut it down as a protection | BPDU Guard, port security or another security feature |
SW1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan99 192.168.99.2 YES manual up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset down down
FastEthernet0/3 unassigned YES unset administratively down down
SW1#show interfaces status
Port Name Status Vlan Duplex Speed Type
Fa0/1 connected trunk a-full a-100 10/100BaseTX
Fa0/2 notconnect 1 auto auto 10/100BaseTX
Fa0/3 disabled 1 auto auto 10/100BaseTX
Fa0/4 err-disabled 10 auto auto 10/100BaseTX
SW1(config)#interface FastEthernet0/4
SW1(config-if)#shutdown
SW1(config-if)#no shutdown
Interface states on a switch; an err-disabled interface is recovered with shutdown and no shutdown
An err-disabled interface does not recover on its own (unless you configure errdisable recovery). First fix the cause and then apply shutdown and no shutdown; otherwise it will fall again.
802.1Q trunking and DTP
A trunk carries several VLANs over one link. The current standard is 802.1Q: it inserts a 4-byte tag in the frame with the TPID (0x8100), 3 priority bits, 1 DEI bit and the 12-bit VLAN ID. The native VLAN is the only one that travels untagged (VLAN 1 by default) and it must match at both ends. ISL, Cisco's earlier protocol, is no longer used.
DTP (Dynamic Trunking Protocol) negotiates the trunk between two Cisco switches. A port can be in access, trunk, dynamic auto (waits for the other side to ask) or dynamic desirable (actively asks) mode. On most current access Catalyst switches the default mode is dynamic auto; check it with show interfaces switchport.
| Side A | Side B | Result |
|---|---|---|
| dynamic auto | dynamic auto | Access (nobody asks) |
| dynamic auto | dynamic desirable | Trunk |
| dynamic desirable | dynamic desirable | Trunk |
| trunk | dynamic auto | Trunk |
| access | dynamic desirable | Access |
| trunk | access | Inconsistent configuration: avoid it |
The risk is operational and security-related: with default values, a device plugged into a port that negotiates DTP can end up forming a trunk without you having decided it. Basic hardening means configuring ports explicitly, disabling DTP, changing the native VLAN, limiting the allowed VLANs and shutting down unused ports.
interface GigabitEthernet0/1
switchport mode trunk
switchport nonegotiate
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,99
!
interface range FastEthernet0/10 - 24
switchport mode access
switchport access vlan 999
switchport nonegotiate
no cdp enable
shutdown
!
SW1#show interfaces trunk
SW1#show interfaces GigabitEthernet0/1 switchport
Explicit trunk without DTP and unused ports in an isolated VLAN and shut down
switchport trunk encapsulation dot1q. On a 2960 only 802.1Q exists and it is not needed.VTP and the revision number
VTP (VLAN Trunking Protocol) replicates the VLAN database between switches over trunks. Devices exchange advertisements only if they share the domain name, the password (if any) and a trunk between them. A new switch is server by default.
| Mode | Creates, modifies or deletes VLANs | Synchronizes with the domain |
|---|---|---|
| Server | Yes, and advertises them to the domain | Yes |
| Client | No | Yes, receives and forwards |
| Transparent | Yes, locally only | No; forwards other switches' advertisements |
| Off | Yes, locally only | No; does not forward them either |
Every VLAN change on a server increases the configuration revision number by one, and the higher one wins. That is the origin of a classic incident: you add to production (revision 53) a switch used in a lab (revision 200), with the same domain and server mode. The network believes the newcomer's information is the newer and replaces the VLANs on every switch with the lab's, even if they are almost empty. Result: deleted VLANs and ports with no connectivity.
vtp mode client
vtp domain HOR
vtp password S3cret
vtp version 2
!
SW1#show vtp status
VTP Version capable : 1 to 3
VTP version running : 2
VTP Domain Name : HOR
VTP Operating Mode : Client
Configuration Revision : 53
Number of existing VLANs : 10
!
! To bring the revision back to 0 on a used switch: transparent mode and back
SW1(config)#vtp mode transparent
SW1(config)#vtp mode server
Basic configuration and how to reset the revision to 0 before connecting a used switch
Before connecting a used switch, put it in transparent mode and back (or change the domain and revert it) so its revision is 0. In networks that need strict control, such as service providers, transparent or off mode is used and VLANs are created by hand on each device. VTP version 3 adds a primary server and protection against this kind of accident.
Spanning Tree: root bridge election
If you connect two switches with two cables, or three switches in a triangle, you create a layer 2 loop. Without protection there would be broadcast storms, duplicate frames and MAC table instability. Spanning Tree Protocol (STP, 802.1D) prevents this: it turns the topology into a tree by blocking redundant links. It does not matter how many physical cables there are; STP sees a single path to the root bridge. On a Catalyst, STP is on by default, with one instance per VLAN (PVST+).
Switches send each other BPDUs (Bridge Protocol Data Units) every 2 seconds. Each one carries the Bridge ID: 2 bytes of priority plus the switch MAC. Those 2 bytes hold the priority (32768 by default) added to the VLAN number, so the effective priority of VLAN 10 is 32778; priority changes in multiples of 4096. The lowest Bridge ID wins: first the priority and, on a tie, the lowest MAC.
First the root is elected; then each switch decides how to reach it.
- Root bridge: the switch with the lowest Bridge ID. All its ports are designated and forward.
- Root port: each non-root switch picks one port, the one with the lowest accumulated cost to the root.
- Designated port: on each segment, the port that offers the lowest cost to the root. It forwards.
- The remaining ports are blocked and break the loop.
The cost of each link depends on its speed. The classic 802.1D values are what you will see by default on Catalyst switches:
| Speed | Cost (short method) | Cost (long method, RSTP) |
|---|---|---|
| 10 Mbps | 100 | 2,000,000 |
| 100 Mbps | 19 | 200,000 |
| 1 Gbps | 4 | 20,000 |
| 10 Gbps | 2 | 2,000 |
When there is a tie, STP applies criteria in this order. For the root port: lowest cost to the root, lowest Bridge ID of the neighbor switch, lowest neighbor port ID (priority, 128 by default, plus the port number). For the designated port of a segment: lowest cost to the root, lowest Bridge ID, lowest port ID.
Example: SW1, SW2 and SW3 in a triangle with Fast Ethernet links and default priorities. SW1 has the lowest MAC and is the root. SW2 and SW3 pick the direct link to SW1 as their root port (cost 19, against 38 through the indirect path). On the SW2–SW3 segment both offer cost 19 to the root; it is a tie and the lowest Bridge ID wins, so SW2's port is designated and SW3's is blocked.
SW2#show spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address aaaa.0000.0001
Cost 19
Port 1 (FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address aaaa.0000.0002
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- ----
Fa0/1 Root FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
SW2: the root is aaaa.0000.0001, the root port is Fa0/1 and Fa0/2 is designated
spanning-tree vlan 1,10,20 priority 4096
! or, with the macro
spanning-tree vlan 1,10,20 root primary
!
SW1#show spanning-tree summary
SW1#show spanning-tree vlan 10
So you do not depend on the MAC, set the root yourself with a low priority
Rapid PVST+ and EtherChannel
Classic STP is slow. A port goes through blocking (up to 20 s of max age), listening (15 s) and learning (15 s) before forwarding, that is, up to about 50 seconds without traffic after a change. Rapid PVST+ (802.1w per VLAN) cuts convergence to a few seconds: it removes the listening state, replaces max age with three missed hellos (6 s) and negotiates the state of point-to-point links between neighbors.
| 802.1D (STP) | 802.1w (RSTP) | Forwards? |
|---|---|---|
| Disabled, blocking, listening | Discarding | No |
| Learning | Learning | No, learns MACs |
| Forwarding | Forwarding | Yes |
RSTP adds two roles to root and designated: alternate (blocked port that receives better BPDUs from another switch; replaces the root port if it fails) and backup (blocked port that receives BPDUs from the same switch, a backup for a designated port on the same segment). Because the alternate is already computed, switchover is immediate, without waiting for timers.
spanning-tree mode rapid-pvst
!
interface FastEthernet0/5
switchport mode access
spanning-tree portfast
spanning-tree bpduguard enable
!
interface GigabitEthernet0/2
spanning-tree guard root
!
spanning-tree portfast default
spanning-tree portfast bpduguard default
Rapid PVST+ with PortFast and BPDU Guard on user ports, and Root Guard toward external switches
- PortFast: an access port goes straight to forwarding. Only for user ports, never toward another switch.
- BPDU Guard: if a PortFast port receives a BPDU, it goes err-disabled.
- Root Guard: prevents a port from receiving a better root; it leaves the port in root-inconsistent state while those BPDUs keep arriving and recovers on its own afterwards.
Even with STP, three cables between two switches leave two blocked. EtherChannel bundles several physical links into one logical link (Port-channel); STP sees it as a single link and therefore blocks none. There are two negotiation protocols: LACP (IEEE 802.1AX standard) and PAgP (Cisco proprietary). Static mode (on) does not negotiate.
| Protocol | Modes | Channel forms when |
|---|---|---|
| LACP | active, passive | active–active or active–passive (passive–passive does not) |
| PAgP | desirable, auto | desirable–desirable or desirable–auto (auto–auto does not) |
| Static | on | on–on (not compatible with LACP or PAgP) |
interface range GigabitEthernet0/1 - 3
channel-group 1 mode active
!
interface Port-channel1
switchport mode trunk
switchport trunk native vlan 99
!
port-channel load-balance src-dst-mac
!
SW1#show etherchannel summary
SW1#show spanning-tree
SW1#show interfaces port-channel 1
A three-port Port-channel with LACP, used as a trunk
For the current exam (CCNA 200-301 v1.1, valid until February 2, 2027), the Spanning Tree protocol tested is Rapid PVST+ within domain 2.0 Network Access, together with EtherChannel (LACP) and 802.1Q trunking.
Class videos
- Day 1 · Part 5.1Traffic, duplex and cablingWatch video
- Day 1 · Part 5.2MAC addresses and ARPWatch video
- Day 1 · Part 5.3Secure switch accessWatch video
- Day 1 · Part 5.4Trunking, DTP and VTPWatch video
- Day 1 · Part 5.5Port and VTP reviewWatch video
- Day 1 · Part 5.6Introduction to STPWatch video
- Day 1 · Part 5.7STP: root electionWatch video
Recorded live in 2021; Spanish audio with Spanish, English, French and Portuguese subtitles. When you play it, the video loads from YouTube. Day 1 playlist on YouTube
Test what you learned
1. Which cable do you use to connect a PC directly to a router's Ethernet port?
Answer. A crossover cable. The PC and the router have MDI NICs: both transmit on pins 1 and 2 and receive on 3 and 6, so the pairs must be crossed. A straight-through cable works between an MDI (PC, router) and an MDI-X (switch).
2. An interface has the MAC 0010.2030.4050. What is its EUI-64 identifier?
Answer. 0210:20FF:FE30:4050. Split the MAC in two halves (001020 and 304050), insert FFFE in the middle and flip bit 7 of the first byte: 00 becomes 02.
3. A lab switch with VTP revision 200 is connected, with the same domain and in server mode, to a production network at revision 53. What happens and how do you avoid it?
Answer. The higher revision wins: the production network adopts the lab switch's VLAN database and loses its VLANs. You avoid it by putting the switch in transparent mode first (or changing the domain and reverting it) so the revision is 0, or by using transparent or off.
4. Three switches in a triangle, all with priority 32768 in VLAN 1. SW1 has the lowest MAC. Which port is blocked between SW2 and SW3?
Answer. SW1 is the root. SW2 and SW3 use their direct link to SW1 as the root port. On the SW2–SW3 segment the cost to the root is equal at both ends, so the Bridge ID breaks the tie: the lowest wins (SW2's, which has the lower MAC) and SW3's port is blocked (alternate in RSTP).
5. A PortFast port goes err-disabled when a desktop switch is plugged in. What caused it and how do you recover it?
Answer. BPDU Guard: the port received a BPDU, which should never happen on a user port, and shut it down. Remove the unauthorized device and apply shutdown and no shutdown on the interface (or configure errdisable recovery).
Key takeaways
- Straight-through for different devices, crossover for like devices (and PC to router); Auto-MDIX solves it on ports that support it.
- Full duplex at both ends or both fixed: a mismatch produces late collisions and CRC errors.
- The switch learns the source MAC and forwards by the destination MAC; broadcast and unknown unicast are flooded across the whole VLAN.
- ARP resolves IP to MAC in IPv4; in IPv6 Neighbor Discovery does it with ICMPv6 and solicited-node multicast.
- Protect access with enable secret, local users or AAA and SSH version 2 on the vty lines; Telnet is clear text.
- On a trunk, disable DTP, set the native VLAN and limit the VLANs; keep unused ports shut down.
- VTP wins by revision number: reset it to 0 before connecting a used switch.
- The root bridge is the lowest Bridge ID (priority and MAC); each non-root switch has one root port and each segment one designated port.
- Rapid PVST+ converges in seconds with alternate and backup roles; EtherChannel avoids blocked links and balances per flow.
Official resources
- CCNA 200-301: exam page and topics (Cisco)cisco.com
- Understand Rapid Spanning Tree Protocol (802.1w)cisco.com
- Understand VLAN Trunk Protocol (VTP)cisco.com
- RFC 826: An Ethernet Address Resolution Protocolrfc-editor.org
- RFC 4861: Neighbor Discovery for IP version 6rfc-editor.org
- RFC 4291: IP Version 6 Addressing Architecturerfc-editor.org
Source and credits. Chapter written from the CCNA 200-301 Bootcamp that Jesús Espinoza recorded live in 2021, on the v1.0 syllabus; the current exam is v1.1. Text drafted with AI assistance and reviewed; original diagrams by The House of Routing. Technical data and configuration were checked against Cisco's official documentation, IETF RFCs and IEEE standards.