CCNA 200-301 Exam Domain 2 (20% of exam)
A VLAN (Virtual Local Area Network) is a logical grouping of devices that can communicate as if they were on the same physical network, regardless of their actual physical location. VLANs segment a single physical switch into multiple broadcast domains.
| Range | VLAN Numbers | Purpose | Notes |
|---|---|---|---|
| Normal | 1-1005 | Standard user VLANs | Stored in vlan.dat (flash memory) |
| Extended | 1006-4094 | Additional VLANs for large networks | Requires VTP transparent mode or VTPv3 |
| Reserved | 1002-1005 | Token Ring/FDDI VLANs | Cannot be deleted or modified |
vlan 10
Switch(config-vlan)# name SALES
! Assign a port to a VLAN (access port)
Switch(config)# interface fastethernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
! Verify VLANs
Switch# show vlan brief
Switch# show vlan id 10
Switch# show interfaces switchport
| Port Type | Description | VLAN Membership |
|---|---|---|
| Access Port | Connects to end devices (PCs, printers) | Single VLAN only |
| Trunk Port | Connects switches or routers | Multiple VLANs (tagged) |
| Voice VLAN | Special access port for IP phones | Data VLAN + Voice VLAN |
interface fastethernet 0/5
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10 ! Data VLAN for PC
Switch(config-if)# switchport voice vlan 50 ! Voice VLAN for phone
A trunk is a point-to-point link that carries traffic for multiple VLANs between switches, or between a switch and a router. Trunk links use tagging to identify which VLAN each frame belongs to.
IEEE 802.1Q is the industry standard for VLAN tagging. It inserts a 4-byte tag into the Ethernet frame header.
interface gigabitethernet 0/1
Switch(config-if)# switchport trunk encapsulation dot1q ! Required on some switches
Switch(config-if)# switchport mode trunk
! Change native VLAN (security best practice)
Switch(config-if)# switchport trunk native vlan 999
! Limit which VLANs can traverse the trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)# switchport trunk allowed vlan add 40
Switch(config-if)# switchport trunk allowed vlan remove 30
! Verify trunk configuration
Switch# show interfaces trunk
Switch# show interfaces gi0/1 switchport
By default, all VLANs (1-4094) are allowed on a trunk. For security and efficiency, you should limit this to only the VLANs that need to traverse the link.
| Command | Effect |
|---|---|
allowed vlan 10,20,30 |
Replace allowed list with only these VLANs |
allowed vlan add 40 |
Add VLAN 40 to existing allowed list |
allowed vlan remove 20 |
Remove VLAN 20 from allowed list |
allowed vlan all |
Reset to allow all VLANs (default) |
allowed vlan except 100-200 |
Allow all VLANs except 100-200 |
DTP is a Cisco proprietary protocol that automatically negotiates trunk links between switches. While convenient, it's generally recommended to disable DTP and manually configure trunk/access modes.
| Mode | Behavior | Sends DTP | Command |
|---|---|---|---|
| Dynamic Auto | Passively waits; becomes trunk if neighbor requests | Yes | switchport mode dynamic auto |
| Dynamic Desirable | Actively tries to form trunk | Yes | switchport mode dynamic desirable |
| Trunk | Always trunk, still sends DTP by default | Yes* | switchport mode trunk |
| Access | Always access, still sends DTP by default | Yes* | switchport mode access |
switchport mode access
Switch(config-if)# switchport nonegotiate
! On trunk ports - disable DTP negotiation
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport nonegotiate
! Verify DTP is disabled
Switch# show interfaces gi0/1 switchport
Look for: Negotiation of Trunking: Off
Since VLANs are separate broadcast domains, a Layer 3 device is required to route traffic between them. There are three main methods for inter-VLAN routing.
Uses separate physical router interfaces for each VLAN. Rarely used due to limited scalability.
Uses a single physical router interface with subinterfaces, one per VLAN. The switch port is configured as a trunk.
interface gigabitethernet 0/0
Router(config-if)# no shutdown
! Create subinterface for VLAN 10
Router(config)# interface gigabitethernet 0/0.10
Router(config-subif)# encapsulation dot1q 10
Router(config-subif)# ip address 192.168.10.1 255.255.255.0
! Create subinterface for VLAN 20
Router(config)# interface gigabitethernet 0/0.20
Router(config-subif)# encapsulation dot1q 20
Router(config-subif)# ip address 192.168.20.1 255.255.255.0
! For native VLAN (no tag)
Router(config)# interface gigabitethernet 0/0.99
Router(config-subif)# encapsulation dot1q 99 native
Router(config-subif)# ip address 192.168.99.1 255.255.255.0
! Switch trunk configuration
Switch(config)# interface gigabitethernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk native vlan 99
Uses Switch Virtual Interfaces (SVIs) on a Layer 3 switch. Most efficient method for enterprise networks.
ip routing
! Create SVI for VLAN 10
Switch(config)# interface vlan 10
Switch(config-if)# ip address 192.168.10.1 255.255.255.0
Switch(config-if)# no shutdown
! Create SVI for VLAN 20
Switch(config)# interface vlan 20
Switch(config-if)# ip address 192.168.20.1 255.255.255.0
Switch(config-if)# no shutdown
! Verify SVIs
Switch# show ip interface brief
Switch# show interfaces vlan 10
| Feature | Legacy | ROAS | L3 Switch/SVI |
|---|---|---|---|
| Scalability | Poor (limited by physical ports) | Moderate | Excellent |
| Performance | Limited by links | Limited by single link | Hardware-based, fast |
| Cost | High (needs many ports) | Low | Higher initial, better long-term |
| Use Case | Legacy, rarely used | Small networks, labs | Enterprise networks |
STP prevents Layer 2 loops in redundant switched networks by blocking redundant paths. Without STP, broadcast storms, MAC table instability, and duplicate frames would crash the network.
| State | Duration | Learns MAC | Forwards Data | Sends/Receives BPDU |
|---|---|---|---|---|
| Blocking | 20 sec (Max Age) | No | No | Receives only |
| Listening | 15 sec (Forward Delay) | No | No | Yes |
| Learning | 15 sec (Forward Delay) | Yes | No | Yes |
| Forwarding | Stable state | Yes | Yes | Yes |
| Disabled | Admin disabled | No | No | No |
| Role | Description | State |
|---|---|---|
| Root Port (RP) | Best path to root bridge (one per non-root switch) | Forwarding |
| Designated Port (DP) | Best port on each segment toward root | Forwarding |
| Non-Designated / Blocked | Redundant ports that could cause loops | Blocking |
The switch with the lowest Bridge ID becomes the root bridge. All its ports become designated ports in forwarding state.
| Link Speed | IEEE Cost (Revised) | Legacy Cost |
|---|---|---|
| 10 Mbps | 2,000,000 | 100 |
| 100 Mbps | 200,000 | 19 |
| 1 Gbps | 20,000 | 4 |
| 10 Gbps | 2,000 | 2 |
When determining which ports to block, STP uses this order of tiebreakers:
spanning-tree vlan 10 root primary
Switch(config)# spanning-tree vlan 10 root secondary
! Manually set priority (must be multiple of 4096)
Switch(config)# spanning-tree vlan 10 priority 4096
! Modify port cost
Switch(config-if)# spanning-tree cost 10
! Modify port priority (for port ID tiebreaker)
Switch(config-if)# spanning-tree port-priority 64
! Verification commands
Switch# show spanning-tree
Switch# show spanning-tree vlan 10
Switch# show spanning-tree interface gi0/1
spanning-tree portfast
! Enable PortFast globally for all access ports
Switch(config)# spanning-tree portfast default
! BPDU Guard - Shut down port if BPDU received
Switch(config-if)# spanning-tree bpduguard enable
! Enable BPDU Guard globally on PortFast ports
Switch(config)# spanning-tree portfast bpduguard default
RSTP (802.1w) is an evolution of STP that provides faster convergence - typically under 1 second compared to 30-50 seconds for 802.1D STP.
| STP State | RSTP State | Is Port Active? |
|---|---|---|
| Disabled | Discarding | No |
| Blocking | Discarding | No |
| Listening | Discarding | No |
| Learning | Learning | No (building MAC table) |
| Forwarding | Forwarding | Yes |
| Role | Description |
|---|---|
| Root Port | Same as STP - best path to root |
| Designated Port | Same as STP - best port on segment |
| Alternate Port | Backup to root port (blocked, can quickly take over) |
| Backup Port | Backup to designated port on same switch (rare) |
| Link Type | Description | Fast Transition? |
|---|---|---|
| Point-to-Point | Full-duplex link (switch-to-switch) | Yes |
| Shared | Half-duplex link (hub connection) | No |
| Edge | Connected to end device (like PortFast) | Yes (immediate) |
spanning-tree mode rapid-pvst
! Configure edge port (equivalent to PortFast)
Switch(config-if)# spanning-tree portfast edge
! Configure point-to-point link type
Switch(config-if)# spanning-tree link-type point-to-point
! Verify RSTP
Switch# show spanning-tree
| Feature | STP (802.1D) | RSTP (802.1w) | MSTP (802.1s) |
|---|---|---|---|
| Convergence | 30-50 seconds | ~1 second | ~1 second |
| VLAN Support | One tree for all | One tree for all* | Multiple VLANs per instance |
| Cisco Version | PVST+ | Rapid PVST+ | MST |
| Resources | Low | Medium | Efficient |
*Note: Cisco's Rapid PVST+ runs a separate RSTP instance per VLAN, combining RSTP speed with per-VLAN flexibility.
EtherChannel bundles multiple physical links into a single logical link, providing increased bandwidth and redundancy. STP sees the EtherChannel as a single link, so no ports are blocked.
| Protocol | Standard | Modes | Notes |
|---|---|---|---|
| LACP | IEEE 802.3ad | Active, Passive | Industry standard, preferred |
| PAgP | Cisco proprietary | Desirable, Auto | Cisco devices only |
| Static | None (manual) | On | No negotiation, both sides must be "on" |
interface range gigabitethernet 0/1-4
Switch(config-if-range)# channel-group 1 mode active
Switch(config-if-range)# exit
! Configure the port-channel interface
Switch(config)# interface port-channel 1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
! PAgP EtherChannel
Switch(config-if-range)# channel-group 1 mode desirable
! Static EtherChannel (no negotiation)
Switch(config-if-range)# channel-group 1 mode on
! Verification
Switch# show etherchannel summary
Switch# show etherchannel port-channel
Switch# show interfaces port-channel 1
EtherChannel distributes traffic across member links using a hash of frame attributes.
show etherchannel load-balance
! Configure load-balance method
Switch(config)# port-channel load-balance src-dst-mac
! Common methods:
! src-mac - Source MAC address
! dst-mac - Destination MAC address
! src-dst-mac - Source and destination MAC
! src-ip - Source IP address
! dst-ip - Destination IP address
! src-dst-ip - Source and destination IP (best for L3)
interface range gigabitethernet 0/1-2
Switch(config-if-range)# no switchport
Switch(config-if-range)# channel-group 1 mode active
Switch(config)# interface port-channel 1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.0.0.1 255.255.255.252
Wireless LANs (WLANs) use radio frequencies to connect devices without cables. Understanding wireless standards, architectures, and security is essential for CCNA.
| Standard | Frequency | Max Speed | Wi-Fi Alliance Name |
|---|---|---|---|
| 802.11b | 2.4 GHz | 11 Mbps | Wi-Fi 1 |
| 802.11a | 5 GHz | 54 Mbps | Wi-Fi 2 |
| 802.11g | 2.4 GHz | 54 Mbps | Wi-Fi 3 |
| 802.11n | 2.4 / 5 GHz | 600 Mbps | Wi-Fi 4 |
| 802.11ac | 5 GHz | 6.9 Gbps | Wi-Fi 5 |
| 802.11ax | 2.4 / 5 / 6 GHz | 9.6 Gbps | Wi-Fi 6/6E |
| Mode | Description |
|---|---|
| Local | Default mode; serves clients and scans channels between beacons |
| FlexConnect | For remote sites; can switch traffic locally even if WLC connection is lost |
| Monitor | Dedicated to scanning for rogues and intrusion detection |
| Sniffer | Captures wireless frames and sends to analyzer |
| Bridge | Point-to-point or point-to-multipoint outdoor bridging |
| SE-Connect | Spectrum analysis mode |
| Security Method | Encryption | Authentication | Status |
|---|---|---|---|
| WEP | RC4 (weak) | Open or Shared Key | Deprecated - Do not use |
| WPA | TKIP | PSK or 802.1X | Legacy - Avoid if possible |
| WPA2 | AES-CCMP | PSK or 802.1X | Current standard |
| WPA3 | AES-GCMP | SAE or 802.1X | Latest - Enhanced security |