From point A to point B
Point A: you know a switch connects devices, but you see it as a box with blinking lights. Point B: by the end you will explain how it decides where each frame goes, get into its command line securely, make it ready to manage over the network and look after its operating system and configuration.
This chapter goes deeper into what you saw in chapter 1. It covers topics 1.13 (switching concepts) and 1.4 (interface and cable issues) of the Network Fundamentals domain, and topics 2.3 (CDP and LLDP) and 2.8 (management access) of the Network Access domain. Together the two domains are worth 40% of the exam.
- Collision and broadcast domains and ARP and ping
- Learn, flood, forward and filter, and the MAC table in practice
- Console, SSH, Telnet, HTTPS, AAA and cloud
- CLI modes, passwords and SSH
- Basic configuration and interfaces: speed, duplex and errors
- CDP and LLDP
- IOS memories and boot and configuration files
Collision and broadcast domains
A collision domain is the part of the network where two frames can collide if they are sent at the same time. A broadcast domain is the set of devices that receive a frame sent to everyone (the address FF:FF:FF:FF:FF:FF).
Your job as an administrator is to cut collisions and make broadcast domains smaller. Each device handles them differently:
| Device | Collision domains | Broadcast domains |
|---|---|---|
| Hub | One for all its ports | One |
| Switch | One per port; none if the port runs full duplex | One per VLAN (just one if you use no VLANs) |
| Router | One per interface | One per interface: it does not forward broadcasts |
In a modern switched network, with every port in full duplex, collisions all but disappear. Broadcasts, however, still reach every device in the same VLAN. That is why you use VLANs (chapter 3) or a router to shrink a broadcast domain.
For your notes. Count the collision and broadcast domains in this network: a router with two interfaces, each going to a switch with 8 ports in use, no VLANs. (Answer: 18 collision domains and 2 broadcast domains.)
ARP and ping
To deliver a frame on the LAN, a device needs the destination MAC, but it usually only knows the IP. ARP (Address Resolution Protocol) resolves that mapping: it asks “who has this IP?” and stores the answer in its ARP cache.
ARP asks by broadcast and gets the answer by unicast. Diagram: The House of Routing.
- PC A sends an ARP request as a broadcast. The switch floods it out of every port except the one it came in on.
- Everyone receives it, but only PC B recognizes its IP and answers with an ARP reply by unicast.
- PC A stores the IP–MAC pair and can now build the frame.
If the destination is on another network, the device does not ask for the final destination’s MAC but for its default gateway’s: the frame only travels as far as the router.
Ping uses ICMP to test connectivity: it sends an echo request (type 8) and waits for an echo reply (type 0). On a Cisco router, each ! is a reply and each . is a timeout. It is normal for the first ping to fail while ARP resolves:
R1# ping 192.168.1.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.20, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
R1# show ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.1.1 - 0011.2233.4401 ARPA GigabitEthernet0/0
Internet 192.168.1.20 0 00aa.bb11.2222 ARPA GigabitEthernet0/0
On Windows you check the ARP cache with arp -a; on a Cisco device, with show ip arp or show arp.
Switch logic
A switch makes all its decisions with a single table, the MAC address table (also called the CAM table). With every frame it receives it does four things:
Learn, flood, forward and filter. Diagram: The House of Routing.
- Learn. It reads the source MAC and records it next to the port the frame came in on. It never learns from the destination MAC.
- Flood. If the destination MAC is not in the table (unknown unicast), or the frame is broadcast or multicast, it sends it out of every port in the VLAN except the incoming one.
- Forward. If it knows the destination MAC, it sends the frame only out of the matching port.
- Filter. If the destination MAC sits on the same port the frame came in on, it drops it.
Learned entries do not last forever: if a MAC is not seen again within 300 seconds (the default aging time), the switch removes it. That way the table adapts when a device moves to another port.
A switch must also avoid layer 2 loops, because a broadcast frame could circle endlessly between switches. That is the job of Spanning Tree (STP), which you will see in chapter 3.
Switching methods
How much of the frame the switch reads before forwarding it. Diagram: The House of Routing.
| Method | What it waits for before forwarding | Advantage |
|---|---|---|
| Store-and-forward | The whole frame; it checks the FCS | Drops damaged frames. It is the usual method on Catalyst switches. |
| Cut-through | Only the 6 bytes of the destination MAC | Lowest latency, but it forwards frames with errors |
| Fragment-free | The first 64 bytes | Avoids forwarding collision fragments (runts) |
The MAC table in practice
Check the table with show mac address-table. Each line maps a VLAN, a MAC, the entry type and the port:
SW1# show mac address-table dynamic
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 00aa.0001.0001 DYNAMIC Gi0/1
1 00aa.0002.0002 DYNAMIC Gi0/2
1 0011.2233.4401 DYNAMIC Gi0/24
Total Mac Addresses for this criterion: 3
| Command | What it is for |
|---|---|
show mac address-table address 00aa.0001.0001 | Find which port a device is on |
show mac address-table interface gi0/1 | See which devices are behind a port |
show mac address-table count | Count entries per VLAN |
show mac address-table aging-time | See the aging time (300 s) |
clear mac address-table dynamic | Clear dynamic entries so they are learned again |
Management access
Managing a switch means getting into its operating system, Cisco IOS, to configure and verify it. You can do it out of band, through a dedicated port, or in band, through the same network the switch carries.
Out-of-band and in-band management. Diagram: The House of Routing.
| Method | How it works | Keep in mind |
|---|---|---|
| Console | Rollover cable (RJ-45 to DB-9) or USB to the console port. Terminal program at 9600 baud, 8 data bits, no parity, 1 stop bit and no flow control. | It is the only way into an unconfigured device. It needs no IP. |
| Auxiliary (AUX) | Port on some routers for attaching a modem | Legacy use; switches do not have it |
| Telnet | Remote terminal over TCP 23 to the management IP | It travels in clear text: anyone can read the username and password |
| SSH | Encrypted remote terminal over TCP 22 | It is the standard. Always use version 2. |
| HTTP and HTTPS | Web interface to configure from the browser (TCP 80 and 443) | If you enable it, use HTTPS only |
| TACACS+ and RADIUS | The device checks users against a central AAA server | TACACS+ (Cisco, TCP 49) encrypts the whole packet and separates authorization; RADIUS (standard, UDP 1812/1813) encrypts only the password. |
| Cloud management | Devices connect to a cloud dashboard, such as Cisco Meraki | Central configuration for many sites at once |
For in-band management, a layer 2 switch needs an IP address on a virtual interface, the SVI (switched virtual interface), and a default gateway to answer administrators on other networks.
The Cisco IOS CLI
Whichever way you get in, you land in the CLI (command line interface). It is organized in modes: each one allows a kind of task and you recognize it by the prompt.
The CLI modes and how to move between them. Diagram: The House of Routing.
| Mode | Prompt | How you get in | What you do |
|---|---|---|---|
| User EXEC | Switch> | When you connect | See basic information and ping |
| Privileged EXEC | Switch# | enable | See everything, save, copy, reload and debug |
| Global configuration | Switch(config)# | configure terminal | Change device-wide settings |
| Interface | Switch(config-if)# | interface gi0/1 | Configure a port or an SVI |
| Line | Switch(config-line)# | line console 0 or line vty 0 15 | Protect the console and remote access |
Shortcuts that save time: ? lists the possible commands or parameters, Tab completes the word, the up arrow recalls the previous command, and you only need to type enough for the command not to be ambiguous (conf t, sh run). exit goes up one level; end or Ctrl+Z take you back to privileged mode. From any configuration mode you can run an EXEC command by prefixing it with do, for example do show ip interface brief.
Passwords and SSH
A switch fresh out of the box asks for nothing: anyone with a console cable gets into privileged mode. Protect it in three places: the jump to privileged mode, the console and the remote lines (VTY).
enable password versus enable secret
| Command | How it is stored | Recommendation |
|---|---|---|
enable password | In clear text in the configuration | Do not use it |
enable secret | As a hash (type 5, MD5, in classic IOS) | Always use it. If both exist, the secret wins. |
enable algorithm-type scrypt secret | Type 9 hash (scrypt), stronger | The best option on current IOS |
service password-encryption | Encrypts clear-text passwords with type 7 | It only stops casual glances: type 7 is easily reversed |
Console, local users and SSH
SW1(config)# enable algorithm-type scrypt secret Th0r!Enable
SW1(config)# username admin privilege 15 algorithm-type scrypt secret Th0r!Admin
SW1(config)# line console 0
SW1(config-line)# login local
SW1(config-line)# exec-timeout 10 0
SW1(config-line)# exit
SW1(config)# ip domain-name thehouseofrouting.lab
SW1(config)# crypto key generate rsa modulus 2048
SW1(config)# ip ssh version 2
SW1(config)# line vty 0 15
SW1(config-line)# login local
SW1(config-line)# transport input ssh
SW1(config-line)# end
To generate the RSA keys, the device needs its own name (hostname) and a domain (ip domain-name). SSH version 2 requires keys of at least 768 bits; use 2048. transport input ssh rejects Telnet on the VTY lines and login local asks for the user created with username. Verify with show ip ssh and show ssh.
password plus login under line console 0 also works, but it does not identify each administrator. In production, prefer local users or, better still, an AAA server.Basic switch configuration
With access protected, get the switch ready to manage over the network:
Switch(config)# hostname SW1
SW1(config)# banner motd # Authorized personnel only #
SW1(config)# interface vlan 1
SW1(config-if)# description Management
SW1(config-if)# ip address 192.168.1.2 255.255.255.0
SW1(config-if)# no shutdown
SW1(config-if)# exit
SW1(config)# ip default-gateway 192.168.1.1
SW1(config)# end
SW1# show ip interface brief
SW1# copy running-config startup-config
- hostname names the device and changes the prompt.
- interface vlan 1 creates the management SVI. You give it the IP and bring it up with
no shutdown; the SVI only comes up if the VLAN exists and at least one port in that VLAN is active. - ip default-gateway tells a layer 2 switch where to send management traffic bound for other networks.
- description documents the purpose of each interface.
Banners
| Banner | When it appears | Typical use |
|---|---|---|
banner motd | First, on connecting, before login | Legal or maintenance notice |
banner login | After the MOTD, just before asking for username and password | Access warning |
banner exec | After logging in | Information for the administrator |
The first character after the word motd (here #) is the delimiter: the text ends when you type it again. Avoid messages like “Welcome”: a legal notice should warn that unauthorized access is prohibited.
Speed, duplex and interface errors
By default, ports negotiate speed and duplex on their own (speed auto and duplex auto). You can set them by hand, but then do it on both ends of the link:
SW1(config)# interface fastethernet0/5
SW1(config-if)# speed 100
SW1(config-if)# duplex full
SW1(config-if)# description Print server
If one end has auto-negotiation turned off, the other detects the speed from the signal but cannot learn the duplex: on 10 and 100 Mb/s links it assumes half duplex. The result is a duplex mismatch: the half side records late collisions and the full side records CRC errors. The network works, but slowly and with losses. On copper Gigabit Ethernet, auto-negotiation is mandatory and the link runs full duplex.
Remember: in full duplex there are no collisions and CSMA/CD is not used.
Reading the error counters
SW1# show interfaces status
Port Name Status Vlan Duplex Speed Type
Fa0/5 Print serv connected 1 a-full a-100 10/100BaseTX
Fa0/6 notconnect 1 auto auto 10/100BaseTX
Fa0/7 err-disabled 1 auto auto 10/100BaseTX
SW1# show interfaces fastethernet0/5 | include errors|CRC|collision|runts
0 runts, 0 giants, 0 throttles
152 input errors, 148 CRC, 4 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 3 interface resets
0 late collision, 0 deferred
| Counter | What it means | Typical cause |
|---|---|---|
| Runts | Frames smaller than 64 bytes | Collisions or faulty NICs |
| Giants | Frames larger than 1518 bytes | Misconfigured MTU or faulty NIC |
| CRC | The FCS does not match | Damaged cable, interference or duplex mismatch |
| Input errors | Sum of input errors (runts, giants, CRC, frame…) | Physical problems |
| Collisions | Collisions while transmitting | Normal in half duplex; abnormal in full |
| Late collisions | Collisions after the first 64 bytes | Duplex mismatch or cable too long |
The interface state tells you which layer to look at: administratively down means no shutdown is missing; down/down points to layer 1 (cable, far-end port); up/down, to layer 2; err-disabled, to a security feature that shut the port.
CDP and LLDP
When you arrive at a network with no documentation, you need to know what is at the other end of each cable. Two layer 2 protocols tell you: CDP (Cisco Discovery Protocol) and LLDP (Link Layer Discovery Protocol).
CDP and LLDP only see the directly connected neighbor. Diagram: The House of Routing.
| CDP | LLDP | |
|---|---|---|
| Origin | Cisco proprietary | IEEE 802.1AB standard, multi-vendor |
| State on Cisco devices | Enabled by default | Usually disabled: turn it on with lldp run |
| Advertisements and hold time | Every 60 s · 180 s hold | Every 30 s · 120 s hold |
| Enable or disable device-wide | cdp run · no cdp run | lldp run · no lldp run |
| On an interface | cdp enable · no cdp enable | lldp transmit · lldp receive |
| Verify | show cdp neighbors [detail] | show lldp neighbors [detail] |
SW1# show cdp neighbors
Capability Codes: R - Router, S - Switch, I - IGMP, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
R1 Gig 0/1 152 R B S I ISR4331 Gig 0/0/0
SW2 Gig 0/2 171 S I WS-C2960X Gig 0/1
show cdp neighbors detail adds the neighbor’s IP address and IOS version: exactly what an attacker wants to know. That is why CDP (or LLDP) is turned off on ports facing users or other organizations, and left on between your own devices.
IOS memories and boot
To manage IOS, first locate where each thing lives:
ROM, flash, NVRAM and RAM. Diagram: The House of Routing.
The boot sequence
From power-on to the running-config. Diagram: The House of Routing.
- POST. The device tests its hardware.
- Bootstrap. It is copied from ROM to RAM and runs.
- Find IOS. The bootstrap checks the configuration register and the
boot systemcommands; it normally loads the first valid image in flash. If it finds none, it stays in ROMMON, the ROM monitor. - Load the configuration. IOS copies the startup-config from NVRAM to RAM, where it becomes the running-config. If there is no startup-config, it offers the initial configuration dialog (setup).
The configuration register
On routers, the configuration register is a 16-bit value written in hexadecimal. Its 4 lowest bits, the boot field, decide where to boot from: 0 leaves the device in ROMMON, 1 loads the first image in flash, and 2 to F obey the boot system commands.
| Value | Effect |
|---|---|
0x2102 | Normal boot: IOS from flash and startup-config from NVRAM (factory value) |
0x2142 | Ignores the startup-config: used to recover a forgotten password |
R1# show version | include register
Configuration register is 0x2102
R1# configure terminal
R1(config)# boot system flash:isr4300-universalk9.17.09.04a.SPA.bin
R1(config)# boot system tftp isr4300-universalk9.17.06.05.SPA.bin 192.168.1.100
R1(config)# config-register 0x2102
R1# show flash:
You can define several boot system commands: the router tries them in order. Always give the exact image name. Catalyst switches do not use the configuration register the way routers do: they boot according to the BOOT variable. The exam tests the sequence on routers.
Configuration files
A Cisco device handles two configurations: the running-config, active in RAM, and the startup-config, saved in NVRAM. What you change in the CLI applies to the running-config at once, but it is lost on reload if you do not save it.
The syntax is always copy [source] [destination]. Diagram: The House of Routing.
| Command | What it does |
|---|---|
copy running-config startup-config (or write memory) | Saves the active configuration to NVRAM |
copy startup-config running-config | Merges the saved configuration into the active one (it does not remove extras) |
copy running-config tftp | Backs up the configuration to a TFTP server |
copy tftp running-config | Brings a configuration from the server and merges it |
copy tftp flash · copy flash tftp | Installs or backs up an IOS image |
erase startup-config (or write erase) and reload | Returns the device to factory configuration |
show running-config · show startup-config | Compare active with saved |
copy startup-config running-config does not undo what you changed: it merges. If you want to go back exactly to what was saved, reload without saving.For your notes. Write in one line the difference between the running-config and the startup-config, and the command that syncs them.
What you take away
- Each switch port is a collision domain; each VLAN, a broadcast domain. Only the router stops broadcasts.
- ARP asks by broadcast and answers by unicast. Ping uses ICMP echo request and echo reply; the first ping may fail because of ARP.
- The switch learns the source MAC; floods unknowns and broadcasts; forwards knowns and filters what returns to the same port. Default aging is 300 s.
- Console out of band at 9600 8N1; in band, SSH (TCP 22) and never Telnet (TCP 23). TACACS+ encrypts everything; RADIUS, only the password.
- Modes:
>,#,(config)#,(config-if)#and(config-line)#. enable secret beats enable password. - SSH needs hostname, ip domain-name, RSA keys, a local user,
login localandtransport input ssh. - A duplex mismatch leaves late collisions on the half side and CRC errors on the full side.
- CDP: Cisco, 60/180 s, on by default. LLDP: IEEE 802.1AB, 30/120 s, turned on with
lldp run. - Boot: POST, bootstrap, IOS (flash, TFTP or ROMMON) and startup-config. 0x2102 is normal; 0x2142 ignores NVRAM.
- Save with
copy running-config startup-config; copying from startup to running merges, it does not replace.
In the next chapter you split the network into VLANs, join them with 802.1Q trunks and prevent loops with Spanning Tree and EtherChannel.
Slides
These slides support the guided class: view them here, full screen, or download the PDF for your notes. Part 1 goes with videos 1 and 2, Part 2 with videos 3 to 7 and Part 3 with videos 8 to 12.
Class videos
The videos are in Spanish. The translation of the videos is in development.
Each part of the chapter has its own video. Tap a card and the video opens right here, over the page; use the Close button or the Esc key to go back to where you were. Use them alongside the slides of the same part.
- Chapter 2 · Part 1Broadcast and collision domainsWatch video
- Chapter 2 · Part 2ARP fundamentalsWatch video
- Chapter 2 · Part 3Managing the CLIWatch video
- Chapter 2 · Part 4Configuring enable modeWatch video
- Chapter 2 · Part 5Basic switch configuration IWatch video
- Chapter 2 · Part 6Basic switch configuration IIWatch video
- Chapter 2 · Part 7Basic switch configuration IIIWatch video
- Chapter 2 · Part 8Managing Cisco IOS IWatch video
- Chapter 2 · Part 9Managing Cisco IOS IIWatch video
- Chapter 2 · Part 10Managing Cisco IOS IIIWatch video
- Chapter 2 · Part 11Configuring Cisco IOS IWatch video
- Chapter 2 · Part 12Configuring Cisco IOS IIWatch video
When you play a video, it loads from YouTube (no cookies until you open it). See the full playlist on YouTube.
Packet Tracer labs
The labs are in Spanish. The translation of the labs is in development.
Download each lab's files and open them with Cisco Packet Tracer. Tap the name to see the two downloads.
Lab 1Switching concepts, ARP and ICMP
Watch in simulation mode how the switch learns MACs, how the ARP request travels and how ping answers.
Lab 2Basic switch configuration
Name the switch, protect the console and privileged mode, and configure the SVI, the gateway and the banners.
Lab 3IOS management on the router
Check the version, the flash and the configuration register, and set up booting with boot system.
Lab 4Configuration files
Save the configuration, compare it with the startup one, and back it up and restore it with a TFTP server.
Chapter assessment
There are 100 single-choice questions, split into 10 tabs of 10. Each tab mixes every topic in the chapter and rises in level: questions 1 to 3 are low difficulty, 4 to 8 are medium and 9 to 10 are high.
We do not save your answers. They run in your browser and, if you close or reload the page, you start from zero. Getting it wrong here is the cheapest way to learn.
Additional resources
These links take you to official sites outside this portal. Use them to practice, go further and confirm what you learned.
To study and practice
- Cisco U.: Implementing and Administering Cisco Solutions (CCNA) pathu.cisco.com
- Cisco Learning Network: community, forums and study resourceslearningnetwork.cisco.com
- Cisco Packet Tracer at Networking Academynetacad.com
Exam and certification
- Official CCNA 200-301 v1.1 exam topics (PDF)learningcontent.cisco.com
- Official CCNA certification pagecisco.com
Standards and references
- RFC 826: Address Resolution Protocol (ARP)rfc-editor.org
- RFC 792: Internet Control Message Protocol (ICMP)rfc-editor.org
- RFC 4253: SSH Transport Layer Protocolrfc-editor.org
- IEEE 802.1AB: Station and Media Access Control Connectivity Discovery (LLDP)standards.ieee.org
Source and credits. Chapter built from Jesús Espinoza’s “Switching Concepts and Logic” and “Managing IOS” notes (CCNA 200-301, parts 1 and 2), paraphrased, updated and aligned with the official CCNA 200-301 v1.1 exam topics. Text drafted with AI assistance; original diagrams by The House of Routing. Technical details were checked against official Cisco documentation and IEEE and IETF standards.
