Complete CCNA 200-301 v1.1 Course

Networking explained from the beginning with real-life scenarios, diagrams, Cisco IOS commands, practical labs and review questions.

Welcome to the Course

A computer network lets devices exchange information and share services. The internet, an office network and a home Wi-Fi network follow the same fundamental principles at different scales.

Real-life scenario: Think of a network as a postal system. An IP address identifies the destination building, a MAC address identifies a specific local recipient, switches move traffic inside the local area, and routers move it between different areas.
Basic office network A laptop and printer connect to a switch. The switch connects to a router, which connects to the internet. Laptop Printer Switch Router Internet

How to use this course

  1. Read one concept at a time.
  2. Explain it aloud using your own words.
  3. Recreate each topology in Cisco Packet Tracer.
  4. Type commands instead of copying them.
  5. Complete the review questions without checking the answers.

Recommended laboratory equipment

  • Cisco Packet Tracer
  • A computer with at least 8 GB RAM
  • A text editor for configuration notes
  • Optional: Wireshark for packet analysis
Important: This is an independent study resource, not an official Cisco course. Always compare important exam details with Cisco’s current published objectives.

1. Network Fundamentals

Network fundamentals explain how devices connect, identify one another, exchange data and select paths. This chapter starts with the physical devices that make networking possible.

1.1 Network Components

Router

A router connects different IP networks. It examines the destination IP address of each packet, checks its routing table and selects an appropriate path toward the destination.

Real-life scenario: A router is like a highway junction. A vehicle arrives with a destination, and the road signs direct it toward the correct city. Similarly, a router sends packets toward the correct destination network.
Office LAN 192.168.10.0/24 Router R1 Selects the path Server LAN 192.168.20.0/24

Basic router verification commands:

Router> enable
Router# show ip interface brief
Router# show ip route
Router# show running-config
Exam point: Routers primarily make forwarding decisions using destination IP addresses. They separate broadcast domains.

Layer 2 Switch

A Layer 2 switch connects devices inside a LAN. It learns source MAC addresses and records them in its MAC address table. It forwards Ethernet frames using the destination MAC address.

Real-life scenario: Think of a switch as a receptionist inside one office building. The receptionist knows which room belongs to each employee and directs internal deliveries to the appropriate room.
Situation Switch action
Known unicast destination Forwards the frame through the matching port
Unknown unicast destination Floods the frame through other ports in the VLAN
Broadcast frame Floods it through other ports in the VLAN
Frame for source device on the same incoming port Filters the frame
Layer 2 Switch MAC address table PC-A Port Gi0/1 PC-B Port Gi0/2 Printer Port Gi0/3 Server Port Gi0/4
Switch> enable
Switch# show mac address-table
Switch# show interfaces status
Switch# show vlan brief

Layer 3 Switch

A Layer 3 switch combines high-speed Ethernet switching with routing capabilities. It can route traffic between VLANs by using switched virtual interfaces, commonly called SVIs.

Real-life scenario: A company places employees and servers in separate VLANs. A Layer 3 switch routes traffic between those VLANs without sending every packet to a separate physical router.
Switch(config)# ip routing

Switch(config)# interface vlan 10
Switch(config-if)# ip address 192.168.10.1 255.255.255.0
Switch(config-if)# no shutdown

Switch(config)# interface vlan 20
Switch(config-if)# ip address 192.168.20.1 255.255.255.0
Switch(config-if)# no shutdown
Device Main forwarding information Typical purpose
Layer 2 switch MAC address table Forward frames inside a VLAN
Layer 3 switch MAC table and routing table Switch frames and route between VLANs
Router Routing table Connect different IP networks and WANs

Next-Generation Firewall and IPS

A traditional firewall permits or blocks traffic using information such as source address, destination address, protocol and port. A next-generation firewall can additionally identify applications, inspect content and apply identity-based policies.

An intrusion prevention system, or IPS, analyzes traffic for malicious behavior and can automatically block detected threats.

Real-life scenario: A firewall resembles a building security guard checking who may enter. An IPS resembles a guard who also inspects behavior and intervenes when someone appears to be attacking the building.
Internet NGFW + IPS Inspect Permit or block Protected LAN
Key difference: An IDS detects and alerts. An IPS is positioned to detect and actively block malicious traffic.

Wireless Access Point

An access point connects wireless clients to a wired network. It bridges IEEE 802.11 wireless frames and IEEE 802.3 Ethernet frames.

Real-life scenario: Your phone communicates with an office access point over radio waves. The access point passes that traffic into the wired Ethernet network so the phone can reach internal servers and the internet.

Wireless LAN Controller

A wireless LAN controller centrally manages multiple access points. It can manage WLAN configuration, security, radio parameters and client roaming.

Real-life scenario: A hotel may have hundreds of access points. Configuring each one separately would be inefficient. A controller lets administrators apply a common wireless configuration centrally.
Wireless Controller Network Switch AP 1 AP 2 AP 3

Network Controller

A network controller provides centralized visibility and policy management. Instead of configuring every device manually, administrators can express intended outcomes and let the controller coordinate implementation.

Real-life scenario: A company wants every new branch to receive the same VLANs, security rules and monitoring settings. A controller can consistently deploy the policy instead of an engineer entering commands separately on every device.

Endpoints

Endpoints are devices that consume or provide network data. Examples include laptops, phones, printers, cameras, sensors and IP telephones.

A laptop requesting a webpage is an endpoint. The web server answering that request is also an endpoint. The switches and routers between them are intermediary devices.

Servers

A server provides a service to other devices called clients. One physical or virtual server may provide several services.

Server Purpose Common protocol or port
DNS Converts names into IP addresses UDP/TCP 53
DHCP Automatically supplies IP configuration UDP 67 and 68
Web Provides websites and web applications HTTP 80, HTTPS 443
File Stores and shares files Protocol depends on implementation
Email Sends and receives email SMTP, IMAP or POP3

Power over Ethernet

Power over Ethernet, or PoE, sends electrical power and network data over the same Ethernet cable. It is commonly used for access points, IP phones and security cameras.

Real-life scenario: A security camera is installed on a ceiling where no electrical socket exists. A PoE switch supplies both its network connection and electrical power through one cable.
A device must support compatible PoE standards and power requirements. Available switch power is limited by its PoE power budget.
Switch# show power inline

Interface  Admin  Oper       Power  Device
Gi1/0/1    auto   on         15.4W  IP Phone
Gi1/0/2    auto   on         22.0W  Access Point
Gi1/0/3    auto   off         0.0W  Not detected

1.2 Network Topology Architectures

Two-Tier Architecture

A two-tier campus design uses an access layer and a combined distribution/core layer. It is often called a collapsed-core design.

  • Access layer: connects users and endpoint devices.
  • Collapsed distribution/core: aggregates access switches, routes between networks and connects to external services.
A medium-sized office has four access switches for employees. Two multilayer switches provide routing and redundant connectivity. A separate three-tier design would add unnecessary cost and complexity.
Distribution/Core 1 Layer 3 switch Distribution/Core 2 Layer 3 switch Access 1 Access 2 Access 3 Access 4 Access layer connects endpoint devices

Three-Tier Architecture

A traditional three-tier campus design contains three distinct layers:

  1. Access: connects endpoints.
  2. Distribution: aggregates access switches and provides routing and policy boundaries.
  3. Core: transports large volumes of traffic quickly between distribution blocks.
A large university has many buildings. Access switches connect classrooms, distribution switches aggregate each building, and the core connects all buildings and data centers.

Spine-Leaf Architecture

Spine-leaf is commonly used in data centers. Every leaf switch connects to every spine switch. Servers connect to leaf switches. Leaf switches do not normally connect directly to other leaf switches.

In a data center, one application may communicate with many other servers. Spine-leaf provides predictable paths and supports large volumes of east-west traffic between servers.
Spine 1 Spine 2 Leaf 1 Leaf 2 Leaf 3 Leaf 4 Servers Servers Servers Servers

WAN

A wide area network connects geographically separated locations. WAN services may use internet VPNs, leased circuits, broadband connections, cellular networks or provider-managed services.

A company has offices in Berlin, London and Mumbai. Each office has its own LAN, while WAN connections allow the offices to exchange data.

Small Office/Home Office

A SOHO design normally combines routing, Ethernet switching, wireless access, DHCP, NAT and basic firewall functions in one device.

A home router gives private IP addresses to phones and laptops, connects them through Wi-Fi, translates their addresses using NAT and forwards their internet traffic to the service provider.

On-Premises and Cloud

Model Description Real-life example
On-premises The organization operates infrastructure at its own location. A company owns servers in its office data center.
Public cloud A provider supplies shared infrastructure as a service. A web application runs on rented cloud virtual machines.
Private cloud Cloud-style infrastructure is dedicated to one organization. A bank operates internal self-service virtual infrastructure.
Hybrid cloud On-premises systems integrate with public or private cloud services. Local databases support an application hosted in the public cloud.

1.3 Physical Interfaces and Cabling

The physical layer carries bits between devices. CCNA requires you to understand copper Ethernet, single-mode fiber, multimode fiber and common interface problems.

Copper Ethernet

Twisted-pair Ethernet cables transmit data using electrical signals. Four pairs of insulated copper wires are twisted to reduce electromagnetic interference.

Real-life scenario: Office computers often connect to a nearby access switch using copper Ethernet because it is affordable and can carry both data and PoE.
Category Common capability Typical use
Cat 5e 1 Gbps up to 100 metres General office access
Cat 6 1 Gbps up to 100 metres; 10 Gbps at shorter distances Modern office installations
Cat 6A 10 Gbps up to 100 metres High-speed access and data centres
Ethernet over twisted-pair copper normally has a maximum channel length of 100 metres. This generally consists of up to 90 metres of permanent cabling plus patch cables.

Straight-Through and Crossover Cables

Traditional Ethernet interfaces used different transmit and receive wire pairs. The cable type depended on the connected devices.

Connection Traditional cable
PC to switch Straight-through
Router to switch Straight-through
Switch to switch Crossover
PC to PC Crossover
Router to router over Ethernet Crossover
Modern interfaces commonly support automatic medium-dependent interface crossover, or auto-MDIX. This allows the interface to adjust automatically, so either cable type may work. You should still understand the traditional cabling rules.

Fiber-Optic Cabling

Fiber carries information as light rather than electrical signals. It supports longer distances, high bandwidth and resistance to electromagnetic interference.

Characteristic Multimode fiber Single-mode fiber
Core Larger Smaller
Light source Usually LED or VCSEL Laser
Distance Shorter Longer
Typical use Inside buildings and data centres Campus, metropolitan and provider links
Relative cost Typically lower Optics are typically more expensive
Copper Electrical signals Commonly up to 100 m Supports PoE Affected by EMI Multimode Multiple light paths Shorter fiber links Large fiber core Immune to EMI Single-mode Single light path Long-distance links Small fiber core Immune to EMI
Never look directly into a fiber connector or optical transceiver. Invisible laser light can damage your eyes.

Shared Media and Point-to-Point Connections

On shared media, multiple devices compete for access to the same transmission medium. Collisions were possible on older Ethernet hubs.

A point-to-point Ethernet link connects exactly two interfaces, such as a computer connected directly to a switch port. Modern switched full-duplex Ethernet links do not experience collisions.

A hub is like several people talking through one shared speaker. Only one person can talk successfully at a time. A switched point-to-point link is like a private phone call where both participants can talk simultaneously.

1.4 Interface and Cable Problems

Interface Status

Switch# show interfaces status

Port      Name        Status       Vlan  Duplex  Speed  Type
Gi0/1     PC-A        connected    10    a-full  a-1000 10/100/1000BaseTX
Gi0/2     Printer     notconnect   10    auto    auto   10/100/1000BaseTX
Gi0/3     Uplink      connected    trunk a-full  a-1000 10/100/1000BaseTX
Status Likely meaning
connected The physical link is operational.
notconnect No working physical connection is detected.
disabled The interface has been administratively shut down.
err-disabled The switch disabled the port after detecting a problem.

Common Physical Problems

Problem Observable symptom Suggested action
Damaged cable Link is down or repeatedly changes state Test or replace the cable
Wrong transceiver Fiber link remains down Verify wavelength, speed and fiber type
Excessive cable length Errors or unstable connectivity Shorten the link or use fiber
Dirty fiber connector Weak optical signal and errors Inspect and clean it correctly
Electromagnetic interference Errors increase near electrical equipment Reroute the cable or use fiber

Duplex and Speed Mismatch

Full duplex permits simultaneous transmission and reception. Half duplex permits communication in only one direction at a time and uses collision detection.

If one side uses full duplex while the other uses half duplex, the connection may remain operational but perform poorly. Users may report slow transfers, intermittent applications and unusually high interface error counters.
Switch# show interfaces gigabitEthernet 0/1

GigabitEthernet0/1 is up, line protocol is up
  Full-duplex, 1000Mb/s
  5 minute input rate 45000 bits/sec
  5 minute output rate 68000 bits/sec
  12 input errors, 8 CRC, 0 frame
  0 output errors, 0 collisions

Important Error Counters

Counter Meaning
CRC errors The received frame failed its integrity check.
Runts Frames smaller than the minimum valid Ethernet frame size.
Giants Frames larger than the accepted maximum size.
Collisions Transmitters attempted to use shared half-duplex media together.
Late collisions Often indicate a duplex mismatch or cabling problem.
Input errors A general total containing several receive-side error types.
Troubleshooting principle: If an interface is down, begin with Layer 1: power, cable, connector, transceiver, interface status, speed and duplex.

1.5 TCP and UDP

Applications use transport-layer protocols to communicate between processes. TCP and UDP both use port numbers, but they provide different services.

Transmission Control Protocol

TCP is connection-oriented and provides:

  • Connection establishment
  • Sequence numbers
  • Acknowledgements
  • Retransmission of missing data
  • Flow control
  • Error detection
Downloading an important document normally uses TCP because missing or incorrectly ordered data must be detected and corrected.

TCP Three-Way Handshake

Client Server 1. SYN 2. SYN-ACK 3. ACK

User Datagram Protocol

UDP is connectionless. It has a smaller header and does not establish a session, acknowledge delivery, reorder data or retransmit missing data.

A live voice call may use UDP. A late audio packet has little value, so the application usually continues instead of waiting for a retransmission.
Feature TCP UDP
Connection establishment Yes No
Reliable delivery mechanisms Yes No
Sequencing Yes No
Header overhead Higher Lower
Common uses Web, email, SSH and file transfer Voice, video, DNS and DHCP

Port Numbers

An IP address identifies a host interface. A port number identifies an application or process on that host.

An apartment building represents a server IP address. Individual apartment numbers represent transport-layer ports. The address gets the delivery to the building, while the apartment number identifies the correct recipient.
Protocol Port Transport
FTP data/control 20/21 TCP
SSH 22 TCP
Telnet 23 TCP
SMTP 25 TCP
DNS 53 UDP and TCP
DHCP server/client 67/68 UDP
HTTP 80 TCP
POP3 110 TCP
NTP 123 UDP
IMAP 143 TCP
SNMP 161/162 UDP
HTTPS 443 TCP
Wireshark exercise:
  1. Start a Wireshark capture on your active network interface.
  2. Visit an HTTPS website.
  3. Stop the capture and apply the filter tcp.port == 443.
  4. Find a TCP SYN, SYN-ACK and ACK.
  5. Compare the source and destination port numbers.
  6. Apply the filter dns and examine a DNS query.

1.6 OSI and TCP/IP Models

Networking models divide communication into layers. Each layer performs a specific job and provides services to the layer above it. This makes designing and troubleshooting networks easier.

The OSI Seven-Layer Model

Layer Name Main responsibility Examples
7 Application Provides network services to user applications HTTP, HTTPS, DNS, DHCP, SSH
6 Presentation Formatting, encryption and compression TLS, character encoding, image formats
5 Session Establishes and manages application sessions Session establishment and termination
4 Transport Process-to-process communication TCP, UDP, port numbers
3 Network Logical addressing and routing IPv4, IPv6, ICMP, routers
2 Data Link Local delivery, framing and MAC addressing Ethernet, switches, VLANs
1 Physical Transmits bits as electrical, optical or radio signals Copper, fiber, connectors and radio
Real-life scenario: Sending a package involves multiple services. You write a message, package it, add delivery information, hand it to a transport company and let the physical delivery system carry it. The receiver reverses these steps. Network communication works similarly.
7 — Application 6 — Presentation 5 — Session 4 — Transport 3 — Network 2 — Data Link 1 — Physical User-facing services Segments and ports Packets and IP Frames and MAC Bits and signals

TCP/IP Model

The TCP/IP model describes the protocol suite used by modern networks and the internet. It is commonly represented using four layers.

TCP/IP layer Related OSI layers Examples
Application OSI 5–7 HTTP, DNS, DHCP, SSH and SMTP
Transport OSI 4 TCP and UDP
Internet OSI 3 IPv4, IPv6 and ICMP
Network Access OSI 1–2 Ethernet, Wi-Fi and physical media
Memory aid: “All People Seem To Need Data Processing” represents OSI layers 7 through 1: Application, Presentation, Session, Transport, Network, Data Link and Physical.

1.7 Encapsulation and Decapsulation

Encapsulation occurs when each networking layer adds control information to data before transmission. The receiving device removes that information through decapsulation.

  1. The application creates data.
  2. TCP or UDP adds a transport header.
  3. IP adds a network-layer header.
  4. Ethernet adds a header and trailer.
  5. The physical layer transmits the frame as bits.
Application data TCP/UDP header Data IP header TCP/UDP Data Ethernet header IP TCP/UDP Data FCS Frame converted into bits: 101101001010...
Layer Protocol data unit
Application Data
Transport TCP segment or UDP datagram
Network Packet
Data Link Frame
Physical Bits
When you open a website, the browser creates application data. TCP adds port numbers, IP adds source and destination IP addresses, and Ethernet adds source and destination MAC addresses for the current local link.

1.8 Ethernet Frames

Ethernet is the main LAN technology used in wired networks. It places data inside frames for delivery across a local network segment.

Field Size Purpose
Preamble 7 bytes Allows receiver synchronization
Start Frame Delimiter 1 byte Marks the beginning of the frame
Destination MAC 6 bytes Identifies the local destination
Source MAC 6 bytes Identifies the sender
Type/Length 2 bytes Identifies encapsulated data or length
Data 46–1500 bytes Carries the upper-layer packet
Frame Check Sequence 4 bytes Detects transmission errors
The standard Ethernet frame from destination MAC through FCS is normally between 64 and 1518 bytes without an 802.1Q VLAN tag.

MAC Addresses

A MAC address is 48 bits long and normally written as 12 hexadecimal digits. For example:

00:1A:2B:3C:4D:5E
001A.2B3C.4D5E
00-1A-2B-3C-4D-5E
  • The first 24 bits traditionally identify the manufacturer.
  • The remaining 24 bits identify a particular interface.
  • A hexadecimal digit represents four binary bits.
Address type Purpose Example
Unicast Identifies one interface 00:1A:2B:3C:4D:5E
Broadcast Targets all devices in a broadcast domain FF:FF:FF:FF:FF:FF
Multicast Targets a selected group Group-dependent address

1.9 How a Switch Learns and Forwards

A switch dynamically builds its MAC address table by examining the source MAC address of incoming frames.

  1. A frame enters a switch port.
  2. The switch reads the source MAC address.
  3. It records that address against the incoming port and VLAN.
  4. It checks the destination MAC address.
  5. It forwards, floods or filters the frame.
PC-A MAC: AAAA Switch Learns AAAA on Gi0/1 PC-B MAC: BBBB Source addresses are learned; destination addresses are looked up.

Forwarding Decisions

Destination Switch behaviour
Known unicast Forward through the associated port
Unknown unicast Flood through all other ports in the same VLAN
Broadcast Flood through all other ports in the same VLAN
Known destination on incoming port Filter the frame
Switch# show mac address-table

          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
  10    00aa.aaaa.aaaa    DYNAMIC     Gi0/1
  10    00bb.bbbb.bbbb    DYNAMIC     Gi0/2
  20    00cc.cccc.cccc    DYNAMIC     Gi0/3
MAC address table entries belong to a VLAN. The same switch port may appear with addresses from different VLANs when it operates as a trunk.

1.10 Same-Network and Remote-Network Delivery

A host uses its subnet mask to determine whether a destination is local or remote.

  • Local destination: The sender creates a frame addressed directly to the destination host's MAC address.
  • Remote destination: The sender creates a frame addressed to its default gateway's MAC address.
PC-A at 192.168.10.20/24 can send directly to 192.168.10.50 because both addresses are in 192.168.10.0/24. To reach 192.168.20.50, PC-A sends the frame to its default gateway because the destination is remote.
PC-A 192.168.10.20/24 Switch Local forwarding Default Gateway 192.168.10.1 Remote Server 192.168.20.50 Local traffic stays within the LAN. Remote traffic is sent to the default gateway.

1.11 ARP

The Address Resolution Protocol maps an IPv4 address to a MAC address on the local network.

  1. The sender checks its ARP cache.
  2. If no mapping exists, it sends a broadcast ARP request.
  3. The device using the requested IPv4 address sends an ARP reply.
  4. The sender stores the IP-to-MAC mapping temporarily.
PC-A knows its gateway has IPv4 address 192.168.10.1 but needs the gateway's MAC address before creating an Ethernet frame. It broadcasts: “Who has 192.168.10.1?” The router replies with its MAC address.
PC> arp -a

Interface: 192.168.10.20
  Internet Address      Physical Address      Type
  192.168.10.1          00-11-22-33-44-55     dynamic
Router# show arp

Protocol  Address         Age  Hardware Addr   Type  Interface
Internet  192.168.10.1      -  0011.2233.4455  ARPA  Gi0/0
Internet  192.168.10.20     2  00aa.bbcc.ddee  ARPA  Gi0/0
ARP is used with IPv4. IPv6 uses Neighbor Discovery through ICMPv6 instead of ARP.
Packet Tracer lab: observe ARP and switching
  1. Connect two PCs to a switch.
  2. Assign 192.168.10.10/24 and 192.168.10.20/24.
  3. Open Simulation mode.
  4. Ping PC-B from PC-A.
  5. Observe the ARP request, ARP reply and ICMP messages.
  6. Check each PC's ARP table with arp -a.
  7. Check the switch table with show mac address-table.
  8. Identify which fields the switch learns and which fields the hosts learn.

1.12 IPv4 Addressing

An IPv4 address is a 32-bit logical address assigned to a network interface. It is written as four decimal octets separated by periods.

192.168.10.25

Binary:
11000000.10101000.00001010.00011001

Each octet contains eight bits and has a value between 0 and 255.

Bit position 128 64 32 16 8 4 2 1
Example bits 1 1 0 0 0 0 0 0
$128 + 64 = 192$
Real-life scenario: An IPv4 address resembles a postal address. The network portion identifies the neighbourhood, while the host portion identifies a particular property in that neighbourhood.

Network and Host Portions

A subnet mask identifies which IPv4 bits represent the network and which represent the host.

  • A subnet-mask bit of 1 represents the network portion.
  • A subnet-mask bit of 0 represents the host portion.
Address:       192.168.10.25
Subnet mask:   255.255.255.0
Prefix:        /24

Network part:  192.168.10
Host part:                 25
Network ID:    192.168.10.0
Broadcast:     192.168.10.255
Network portion 192.168.10 Host portion 25 192.168.10.25/24: first 24 bits are network bits

Important Address Types

Address Purpose
Network address Identifies the subnet; all host bits are 0
Usable host address May be assigned to an interface
Broadcast address Targets every IPv4 host in the subnet; all host bits are 1
Default gateway Router or Layer 3 switch used to reach remote networks
In a normal IPv4 subnet, do not assign the network or broadcast address to a host.

1.13 Public, Private and Special IPv4 Addresses

Private IPv4 Ranges

Private range CIDR block
10.0.0.0–10.255.255.255 10.0.0.0/8
172.16.0.0–172.31.255.255 172.16.0.0/12
192.168.0.0–192.168.255.255 192.168.0.0/16

Private addresses are used inside organizations and are not routed across the public internet. Network Address Translation commonly translates them into public addresses.

Your laptop may use 192.168.1.50 at home. Your router translates this private address into a public address before sending traffic to the internet.

Other Special Addresses

Range Purpose
127.0.0.0/8 Loopback testing; 127.0.0.1 is commonly used
169.254.0.0/16 Link-local addressing when automatic configuration fails
224.0.0.0/4 IPv4 multicast
255.255.255.255 Limited broadcast
0.0.0.0 Unspecified address or default-route representation

1.14 Subnet Masks and Prefix Lengths

Prefix Subnet mask Total addresses Normally usable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.2542Used on supported point-to-point links
/32255.255.255.2551One specific address

Subnetting Formulas

If $h$ bits remain for hosts:

$$\text{Total addresses} = 2^h$$

For a conventional subnet:

$$\text{Usable hosts} = 2^h - 2$$

If $s$ host bits are borrowed:

$$\text{Number of subnets} = 2^s$$

The subtraction of two accounts for the network and broadcast addresses. Point-to-point /31 links are a special case.

1.15 The Block-Size Method

The block-size method quickly finds subnet boundaries without writing all 32 bits in binary.

  1. Locate the interesting octet—the first mask octet that is not 255 or 0.
  2. Calculate $256 - \text{mask value}$.
  3. List multiples of that block size.
  4. Find the range containing the given address.

Worked Example: 192.168.10.70/26

Prefix:           /26
Mask:             255.255.255.192
Interesting octet: fourth octet
Block size:       256 - 192 = 64

Subnet boundaries:
0, 64, 128, 192

70 falls between 64 and 127.
Item Result
Network address192.168.10.64
First usable address192.168.10.65
Last usable address192.168.10.126
Broadcast address192.168.10.127
Usable hosts62
192.168.10.0/26 Hosts: 1–62 Broadcast: 63 192.168.10.64/26 Hosts: 65–126 Broadcast: 127 192.168.10.128/26 Hosts: 129–190 Broadcast: 191 192.168.10.192/26 Hosts: 193–254 Broadcast: 255 A /24 divided into four equal /26 subnets

Worked Example: 172.16.77.130/20

Prefix:            /20
Mask:              255.255.240.0
Interesting octet: third octet
Block size:        256 - 240 = 16

Third-octet boundaries:
0, 16, 32, 48, 64, 80, 96...

77 falls between 64 and 79.
Item Result
Network address172.16.64.0
First usable address172.16.64.1
Last usable address172.16.79.254
Broadcast address172.16.79.255
Usable hosts4,094

1.16 Selecting a Subnet Size

Choose enough host bits to support the required devices, including reasonable growth.

Example: Department Requiring 50 Hosts

/27 provides 30 usable hosts — too small
/26 provides 62 usable hosts — sufficient
/25 provides 126 usable hosts — sufficient but wastes more addresses

Best fit: /26

Example: Department Requiring 500 Hosts

/24 provides 254 usable hosts — too small
/23 provides 510 usable hosts — sufficient

Best fit: /23
A company expects a department to grow from 45 to 55 devices. Assigning a /27 would fail because it supports only 30 conventional host addresses. A /26 provides 62 usable addresses.

1.17 Fixed-Length and Variable-Length Subnetting

Fixed-Length Subnet Masking

FLSM gives every subnet the same prefix length. It is simple but can waste addresses when departments have very different requirements.

Variable-Length Subnet Masking

VLSM uses different prefix lengths based on actual requirements. Allocate the largest subnet first to prevent address overlap.

VLSM Worked Example

Divide 192.168.10.0/24 for these requirements:

  • Sales: 100 hosts
  • Engineering: 50 hosts
  • Support: 20 hosts
  • Router link: 2 hosts
Network Required Assigned subnet Usable range Broadcast
Sales 100 192.168.10.0/25 192.168.10.1–126 192.168.10.127
Engineering 50 192.168.10.128/26 192.168.10.129–190 192.168.10.191
Support 20 192.168.10.192/27 192.168.10.193–222 192.168.10.223
Router link 2 192.168.10.224/30 192.168.10.225–226 192.168.10.227
Allocate VLSM subnets from largest to smallest and verify that none of their address ranges overlap.

1.18 Configuring IPv4 Addresses

Router Interface

Router> enable
Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# description Office LAN
Router(config-if)# ip address 192.168.10.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# end

Router# show ip interface brief

Layer 2 Switch Management Address

Switch> enable
Switch# configure terminal
Switch(config)# interface vlan 10
Switch(config-if)# ip address 192.168.10.2 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# ip default-gateway 192.168.10.1
A Layer 2 switch's management address does not make it a router. ip default-gateway lets the switch send management traffic to remote networks.

Verification Commands

Router# show ip interface brief
Router# show interfaces gigabitEthernet 0/0
Router# show ip route
Router# show arp
Router# ping 192.168.10.10
Router# traceroute 192.168.20.10

IPv4 Subnetting Practice

1. Find the subnet containing 192.168.50.200/27.

Mask: 255.255.255.224; block size: 32. The boundaries include 160, 192 and 224. Network: 192.168.50.192; usable range: 193–222; broadcast: 223.

2. Find the subnet containing 10.25.140.7/18.

Mask: 255.255.192.0; third-octet block size: 64. The address is in 10.25.128.0/18. Usable range: 10.25.128.1–10.25.191.254; broadcast: 10.25.191.255.

3. What prefix supports at least 200 hosts?

/24. It provides 256 total addresses and 254 conventional usable host addresses.

4. Are 192.168.1.30/28 and 192.168.1.35/28 in the same subnet?

No. The block size is 16. Address 30 belongs to 192.168.1.16/28, while address 35 belongs to 192.168.1.32/28.

Packet Tracer lab: IPv4 addressing
  1. Add one router, two switches and four PCs.
  2. Connect one switch to each router interface.
  3. Use 192.168.10.0/24 for LAN 1.
  4. Use 192.168.20.0/24 for LAN 2.
  5. Assign the router the first usable address in each LAN.
  6. Assign unique host addresses and the correct default gateways.
  7. Use show ip interface brief to verify the router.
  8. Ping hosts within the same LAN and across the router.
  9. Correct any mask, gateway or interface-state errors.

1.19 IPv6 Fundamentals

IPv6 uses 128-bit addresses, providing a much larger address space than 32-bit IPv4. IPv6 also supports automatic addressing, simpler headers and improved multicast-based network operations.

Real-life scenario: IPv4 is like a city running out of telephone numbers and repeatedly sharing numbers through extensions. IPv6 provides enough numbers to assign unique addresses to an enormous number of devices.

IPv6 Address Format

An IPv6 address contains eight groups of four hexadecimal digits. Each group represents 16 bits.

2001:0db8:0000:0000:0000:00ab:0000:1234

Hexadecimal digits represent these decimal and binary values:

HexBinary HexBinary HexBinary HexBinary
000004010081000C1100
100015010191001D1101
2001060110A1010E1110
3001170111B1011F1111

1.20 Shortening IPv6 Addresses

Rule 1: Remove Leading Zeros

Leading zeros in each 16-bit group may be removed.

Original:
2001:0db8:0000:0001:00ab:0000:0000:1234

After removing leading zeros:
2001:db8:0:1:ab:0:0:1234
Remove only leading zeros. The group 1000 cannot be shortened because its zeros are not at the beginning.

Rule 2: Compress One Continuous Zero Sequence

One continuous sequence of all-zero groups may be replaced with ::.

2001:db8:0:0:0:0:0:10
2001:db8::10
Use :: only once in an address. Using it twice would make the number of omitted groups ambiguous.

Expanding an IPv6 Address

Short address:
2001:db8:12::5

There are three written groups before :: and one after it.
Eight groups are required, so :: represents four zero groups.

Expanded:
2001:0db8:0012:0000:0000:0000:0000:0005

1.21 IPv6 Prefixes

IPv6 uses prefix notation. A typical LAN uses a /64 prefix, leaving 64 bits for the interface identifier.

Address: 2001:db8:10:20:abcd:1234:5678:9abc/64

Network prefix:
2001:db8:10:20::/64

Interface identifier:
abcd:1234:5678:9abc
64-bit network prefix 2001:db8:10:20 64-bit interface ID abcd:1234:5678:9abc 2001:db8:10:20:abcd:1234:5678:9abc/64

1.22 IPv6 Address Types

Global Unicast Address

A global unicast address is routable across IPv6 networks. The currently allocated global unicast range is contained within 2000::/3.

2001:db8:10:20::25/64
The prefix 2001:db8::/32 is reserved for documentation and examples. Do not treat it as a real publicly routed production prefix.

Link-Local Address

Every IPv6-enabled interface requires a link-local address. Link-local addresses begin within FE80::/10 and are used only on the local link.

fe80::21a:2bff:fe3c:4d5e

Link-local addresses are used for:

  • Neighbor Discovery
  • Router discovery
  • Next-hop routing information
  • Communication limited to the local link
Two routers may use their link-local addresses as routing-protocol neighbours, even when their global unicast addresses differ.

Unique Local Address

Unique local addresses use FC00::/7, with locally assigned addresses commonly beginning with FD. They are intended for private internal use and are not normally routed on the public internet.

fd12:3456:789a:10::25/64

Loopback and Unspecified Addresses

Address Purpose
::1/128 IPv6 loopback address
::/128 Unspecified IPv6 address

IPv6 Multicast

IPv6 multicast sends traffic to a group of interested interfaces. IPv6 does not use broadcast addresses.

Address Meaning
FF02::1 All IPv6 nodes on the local link
FF02::2 All IPv6 routers on the local link
FF02::5 All OSPFv3 routers
FF02::6 All OSPFv3 designated routers

Anycast

An anycast address is assigned to multiple interfaces, normally on different devices. Routing delivers traffic to the nearest instance according to the routing table.

A global service can operate servers in several countries using the same anycast address. Users are routed toward a nearby service instance.

1.23 IPv6 Address Configuration Methods

Static Configuration

Router> enable
Router# configure terminal
Router(config)# ipv6 unicast-routing
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ipv6 address 2001:db8:10:1::1/64
Router(config-if)# no shutdown

The ipv6 unicast-routing command enables the router to forward IPv6 packets between interfaces.

Manual Link-Local Address

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ipv6 address fe80::1 link-local
Administrators often give routers simple link-local addresses such as FE80::1 to make configurations and troubleshooting easier.

EUI-64

Modified EUI-64 can create a 64-bit interface identifier from a 48-bit MAC address.

  1. Split the MAC address into two 24-bit halves.
  2. Insert FFFE between the halves.
  3. Invert the universal/local bit in the first byte.
  4. Combine the result with the 64-bit IPv6 prefix.

EUI-64 Worked Example

MAC address:
00:1A:2B:3C:4D:5E

Split:
001A2B | 3C4D5E

Insert FFFE:
001A:2BFF:FE3C:4D5E

Invert the U/L bit:
00 becomes 02

Interface identifier:
021A:2BFF:FE3C:4D5E

With prefix 2001:db8:10:1::/64:
2001:db8:10:1:021A:2BFF:FE3C:4D5E/64
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ipv6 address 2001:db8:10:1::/64 eui-64

SLAAC

Stateless Address Autoconfiguration allows a host to create its own global IPv6 address after receiving prefix information from a router advertisement.

  1. The host creates a link-local address.
  2. The host listens for or requests a router advertisement.
  3. The router advertises a network prefix and configuration flags.
  4. The host creates an address using the advertised prefix.
  5. The host checks that the address is not already in use.
A phone joins an IPv6 network and automatically creates an address without an administrator manually configuring it.

DHCPv6

Method Address source Other information
SLAAC Host creates its address Router advertisements
Stateless DHCPv6 SLAAC DHCPv6 supplies information such as DNS
Stateful DHCPv6 DHCPv6 server DHCPv6 server tracks address assignments
An IPv6 default gateway is learned from router advertisements, not from the DHCPv6 server.

1.24 Neighbor Discovery Protocol

IPv6 Neighbor Discovery uses ICMPv6. It replaces several IPv4 functions, including ARP and router discovery.

Message Abbreviation Purpose
Router Solicitation RS A host requests router information
Router Advertisement RA A router advertises prefixes and configuration flags
Neighbor Solicitation NS Discovers a neighbour or verifies reachability
Neighbor Advertisement NA Responds with neighbour information
Redirect Redirect Identifies a better first-hop router
IPv6 Host IPv6 Router Router Solicitation Router Advertisement Normal IPv6 traffic

Solicited-Node Multicast

Each IPv6 unicast address has a corresponding solicited-node multicast address. Neighbor Discovery uses this address instead of broadcasting to every host.

When one IPv6 host needs another host's Layer 2 address, it sends a Neighbor Solicitation to the relevant solicited-node multicast group rather than disturbing every device on the LAN.

Duplicate Address Detection

Before using an IPv6 address, a host can perform Duplicate Address Detection to confirm that another interface is not already using it.

1.25 Verifying IPv6

Router# show ipv6 interface brief

GigabitEthernet0/0     [up/up]
    FE80::1
    2001:DB8:10:1::1

GigabitEthernet0/1     [up/up]
    FE80::1
    2001:DB8:10:2::1
Router# show ipv6 interface gigabitEthernet 0/0
Router# show ipv6 route
Router# show ipv6 neighbors
Router# ping 2001:db8:10:1::20
Router# traceroute 2001:db8:10:2::20
The same link-local address can appear on different router interfaces because each address is meaningful only on its local link. When using a link-local destination, you may need to specify the outgoing interface.

IPv6 Practice Questions

1. Shorten 2001:0db8:0000:0000:00ab:0000:0000:0010.

One valid shortest representation is 2001:db8::ab:0:0:10. Only one continuous zero sequence may use ::.

2. Expand 2001:db8:5::25.

2001:0db8:0005:0000:0000:0000:0000:0025

3. What is the IPv6 loopback address?

::1/128

4. Does IPv6 use ARP?

No. IPv6 uses ICMPv6 Neighbor Discovery messages, including Neighbor Solicitation and Neighbor Advertisement.

5. Which IPv6 messages provide prefix and gateway information?

Router Advertisements.

Packet Tracer lab: dual-stack network
  1. Create two LANs connected by one router.
  2. Enable ipv6 unicast-routing.
  3. Use 2001:DB8:10:1::/64 for LAN 1.
  4. Use 2001:DB8:10:2::/64 for LAN 2.
  5. Assign each router interface ::1 in its subnet.
  6. Configure IPv6 addresses on the PCs or enable automatic addressing.
  7. Verify link-local and global addresses.
  8. Ping across both LANs using IPv6.
  9. Inspect the router's IPv6 routing and neighbour tables.
  10. Repeat the test with IPv4 to create a dual-stack network.

1.26 Wireless Networking Fundamentals

Wireless LANs use radio waves instead of physical Ethernet cables. A wireless client connects to an access point using an SSID and an authentication method.

Important Wireless Terms

Term Meaning
SSID The name advertised by a wireless network
BSSID The MAC address identifying a wireless access point radio
RF Radio frequency used to transmit wireless signals
Channel A defined portion of the radio-frequency spectrum
Association The process by which a client joins an access point
Roaming Moving between access points while maintaining connectivity
Real-life scenario: When you select “Office-WiFi” on your laptop, the SSID is the network name. The laptop associates with a nearby access point, authenticates, receives an IP address and begins communicating.

Wireless Bands

Band General characteristics
2.4 GHz Longer range, better wall penetration, more interference
5 GHz More channels and capacity, generally shorter range
6 GHz Additional spectrum for supported Wi-Fi 6E and newer clients
Actual channel availability and permitted transmission power depend on the country and regulatory domain.

Wireless Interference

Wireless performance can be affected by:

  • Other access points using overlapping channels
  • Microwave ovens and cordless devices
  • Concrete walls, metal structures and glass
  • Too many clients on one access point
  • Excessive distance from the access point
  • Non-Wi-Fi radio interference
A meeting room may experience slow Wi-Fi when many users join a video call. The issue may be congestion rather than a faulty internet connection.

Wireless Encryption and Authentication

Method Security level Typical use
Open No wireless authentication or encryption Public guest networks with web login
WPA2-Personal Pre-shared key Homes and small offices
WPA2-Enterprise 802.1X with centralized authentication Business networks
WPA3-Personal Modern personal authentication Supported home and small-office devices
WPA3-Enterprise Enterprise authentication and stronger security options Organizations with compatible infrastructure
Avoid WEP. It is obsolete and insecure. For a business WLAN, centralized authentication with 802.1X commonly uses an authentication server such as RADIUS.

1.27 Virtualization

Virtualization abstracts computing resources from the physical hardware. Multiple virtual machines can run on one physical server through a hypervisor.

Component Role
Physical host Provides CPU, memory, storage and network interfaces
Hypervisor Creates and manages virtual machines
Virtual machine Runs an operating system and applications
Virtual NIC Connects a virtual machine to a virtual or physical network
Real-life scenario: Instead of buying one physical server for web services and another for testing, an organization may run separate virtual machines on one powerful host.
Hypervisor Web VM Database VM Test VM Physical server hardware

Network Virtualization

Network virtualization creates logical networks independently of the underlying physical topology. Examples include virtual switches, VLANs, virtual routers and virtual firewalls.

A data-centre server may host development and production applications. Virtual networks can isolate their traffic even though both workloads use the same physical switch infrastructure.

1.28 VRF

Virtual Routing and Forwarding creates separate routing tables on one router or Layer 3 switch. Each VRF can contain overlapping IP address spaces while keeping traffic logically separated.

An internet service provider can use different VRFs for separate customers. Customer A and Customer B may both use 192.168.1.0/24 internally without their routes mixing.
Router(config)# vrf definition CUSTOMER_A
Router(config-vrf)# address-family ipv4
Router(config-vrf-af)# exit

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# vrf forwarding CUSTOMER_A
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Applying vrf forwarding to an interface normally removes its existing IP address. Reconfigure the address afterward.

1.29 Containers

Containers package an application and its dependencies while sharing the host operating system kernel. They are generally lighter and faster to start than full virtual machines.

Feature Virtual machine Container
Includes Complete guest operating system Application and dependencies
Startup time Usually longer Usually shorter
Isolation Strong hardware-level abstraction Process-level isolation
Typical use Different operating systems and workloads Portable application deployment
A developer can package a web application in a container so it behaves consistently on a laptop, test server and production cluster.

1.30 Switching Concepts

Collision Domains

A collision domain is a network segment where devices could potentially compete to transmit at the same time. Each switch port creates a separate collision domain.

Broadcast Domains

A broadcast domain is the set of devices that receive a Layer 2 broadcast. Routers and Layer 3 boundaries separate broadcast domains. Each VLAN is normally a separate broadcast domain.

Broadcast Domain 1 VLAN 10 Router Broadcast Domain 2 VLAN 20 A router separates broadcasts; switch ports separate collision domains.

MAC Address Table Aging

Dynamic MAC address entries are removed after a period of inactivity. This allows the switch to adapt when a device moves to another port.

Switch# show mac address-table aging-time
Vlan    Aging Time
----    ----------
All     300 seconds

Store-and-Forward Switching

In store-and-forward switching, the switch receives the entire frame, verifies its FCS and then forwards it. Corrupted frames are discarded.

Store-and-forward resembles a warehouse checking a package completely before sending it onward. This adds a small delay but prevents damaged frames from being forwarded.

Full Duplex

Full-duplex Ethernet allows simultaneous transmission and reception on a point-to-point link. Collision detection is unnecessary on a properly operating full-duplex link.

Network Fundamentals Summary

Devices

Switches forward local frames, routers forward packets between networks, access points connect wireless clients and firewalls enforce security policy.

Addressing

MAC addresses support local Ethernet delivery. IPv4 and IPv6 addresses identify interfaces across routed networks.

Models

OSI and TCP/IP models divide networking into layers and help isolate problems.

IPv4

Subnet masks separate network and host portions. Always identify the network, usable range and broadcast address.

IPv6

IPv6 uses 128-bit addresses, multicast and ICMPv6 Neighbor Discovery.

Physical media

Copper is common for access links; fiber supports longer distances and resists electromagnetic interference.

Network Fundamentals Final Review

1. What is the main function of a router?

It forwards packets between different IP networks using a routing table.

2. What does a switch learn from the source MAC address?

It learns the source MAC address and associates it with the incoming port and VLAN.

3. Which transport protocol provides reliable, ordered delivery?

TCP.

4. How many usable host addresses does a /26 provide?

62 conventional usable host addresses.

5. What is the IPv6 link-local range?

FE80::/10.

6. What replaces ARP in IPv6?

ICMPv6 Neighbor Discovery.

7. What is the difference between a collision and broadcast domain?

A collision domain is a segment where transmissions could collide. A broadcast domain is the set of devices receiving a Layer 2 broadcast.

8. What does a VRF provide?

Separate routing and forwarding tables on the same router or Layer 3 switch.

Capstone lab: build a small dual-stack office
  1. Add one router, two Layer 2 switches, one access point, one server and four PCs.
  2. Create separate user, server and guest networks using IPv4 subnets.
  3. Configure IPv6 /64 prefixes for each network.
  4. Configure router interfaces and verify that they are up/up.
  5. Configure switch management addresses and default gateways.
  6. Connect the access point to a dedicated guest network.
  7. Test local and remote IPv4 and IPv6 connectivity.
  8. Inspect MAC, ARP, IPv6 neighbor and routing tables.
  9. Disconnect a cable and identify the problem using Layer 1 troubleshooting.
  10. Document the topology, addressing plan and verification results.

Review Questions

1. Which address does a Layer 2 switch primarily examine?

The destination MAC address in an Ethernet frame.

2. Which device forwards packets between IP networks?

A router or a Layer 3 switch with routing enabled.

3. Why is PoE useful?

It supplies power and data over one Ethernet cable, simplifying the installation of access points, IP phones and cameras.

4. What is a collapsed-core design?

A two-tier design in which the distribution and core functions are combined.

5. How are spine and leaf switches connected?

Every leaf connects to every spine, while servers connect to leaf switches.

Mini lab: identify network roles
  1. Open Cisco Packet Tracer.
  2. Add one router, one switch, two PCs, one server and one access point.
  3. Connect the wired devices using appropriate Ethernet links.
  4. Label each device according to its network role.
  5. Use show ip interface brief on the router.
  6. Use show mac address-table on the switch.
  7. Observe which device maintains IP routes and which device learns MAC addresses.
The next Network Fundamentals installment covers cabling, interfaces, duplex and speed problems, TCP/IP, Ethernet, IPv4, subnetting and IPv6.

2. Network Access

Network access covers how switches connect devices, separate traffic with VLANs, carry multiple VLANs over trunks, prevent Layer 2 loops and provide wireless connectivity.

2.1 VLANs

A VLAN, or Virtual Local Area Network, logically separates devices on a switch. Each VLAN is a separate broadcast domain.

Real-life scenario: A company uses VLAN 10 for employees, VLAN 20 for voice phones and VLAN 30 for guests. Although all devices use the same physical switches, their broadcast traffic remains separated.
Switch VLAN database Employees — VLAN 10 Voice — VLAN 20 Guest — VLAN 30 Guest — VLAN 30

Creating and Naming VLANs

Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name USERS
Switch(config-vlan)# exit

Switch(config)# vlan 20
Switch(config-vlan)# name VOICE
Switch(config-vlan)# exit

Switch(config)# vlan 30
Switch(config-vlan)# name GUESTS
Switch(config-vlan)# exit

Assigning an Access Port

Switch(config)# interface gigabitEthernet 0/5
Switch(config-if)# description Employee-PC
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# spanning-tree portfast

An access port normally carries traffic for one VLAN. It is commonly used for PCs, printers, cameras and other endpoint devices.

Verifying VLANs

Switch# show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi0/1, Gi0/2
10   USERS                            active    Gi0/5, Gi0/6
20   VOICE                            active    Gi0/7
30   GUESTS                           active    Gi0/8
A VLAN must exist on the switch before an access port can be assigned to it. A port in an inactive or missing VLAN cannot forward normal traffic.

2.2 Trunk Ports

A trunk carries traffic for multiple VLANs over one physical link. VLAN identification is added using IEEE 802.1Q tagging.

Two switches are connected by one cable. Instead of using a separate cable for VLAN 10, VLAN 20 and VLAN 30, the link becomes a trunk and transports all three VLANs.
Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# description Trunk-to-SW2
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30

Native VLAN

The native VLAN carries untagged frames on an 802.1Q trunk. Both ends of a trunk should use the same native VLAN.

Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# switchport trunk native vlan 999
A native VLAN mismatch can cause connectivity problems and security risks. Configure trunk settings consistently on both sides.

Trunk Verification

Switch# show interfaces trunk

Port        Mode         Encapsulation  Status        Native vlan
Gi0/24      on           802.1q         trunking      999

Port        Vlans allowed on trunk
Gi0/24      10,20,30

Port        Vlans allowed and active in management domain
Gi0/24      10,20,30

2.3 Inter-VLAN Routing

Devices in different VLANs cannot communicate through Layer 2 switching alone. A router or Layer 3 switch must route between the VLANs.

Router-on-a-Stick

Router-on-a-stick uses one physical router interface with multiple subinterfaces. Each subinterface represents one VLAN.

Router G0/0 trunk Switch Trunk port VLAN 10 — Users VLAN 20 — Voice VLAN 30 — Guests
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# no shutdown

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

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

Router(config)# interface gigabitEthernet 0/0.30
Router(config-subif)# encapsulation dot1Q 30
Router(config-subif)# ip address 192.168.30.1 255.255.255.0

Layer 3 Switch Inter-VLAN Routing

Switch(config)# ip routing

Switch(config)# vlan 10
Switch(config-vlan)# name USERS

Switch(config)# interface vlan 10
Switch(config-if)# ip address 192.168.10.1 255.255.255.0
Switch(config-if)# no shutdown

Switch(config)# vlan 20
Switch(config-vlan)# name SERVERS

Switch(config)# interface vlan 20
Switch(config-if)# ip address 192.168.20.1 255.255.255.0
Switch(config-if)# no shutdown
A PC in VLAN 10 sends traffic for a server in VLAN 20 to the VLAN 10 gateway. The Layer 3 device routes the packet and sends it into VLAN 20.

2.4 Voice VLANs

An IP phone and a computer can share one switch port. The phone uses the voice VLAN, while the attached computer uses the data VLAN.

Switch(config)# interface gigabitEthernet 0/10
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# switchport voice vlan 20
Switch(config-if)# spanning-tree portfast
The phone tags voice traffic for VLAN 20. The computer connected through the phone sends untagged data traffic assigned to VLAN 10 by the switch.

2.5 VLAN Troubleshooting

Symptom Possible cause Useful command
PC cannot reach same-VLAN devices Wrong access VLAN or port down show vlan brief
VLAN works on one switch but not another VLAN missing or absent from trunk allowed list show interfaces trunk
Different VLANs cannot communicate Missing gateway or inter-VLAN routing show ip interface brief
Unexpected connectivity or warnings Native VLAN mismatch show interfaces trunk
Packet Tracer lab: VLANs and trunking
  1. Add two switches and four PCs.
  2. Create VLANs 10 and 20 on both switches.
  3. Assign two PCs to VLAN 10 and two PCs to VLAN 20.
  4. Connect the switches using a trunk.
  5. Verify that same-VLAN PCs can communicate.
  6. Verify that different-VLAN PCs cannot communicate yet.
  7. Use show vlan brief and show interfaces trunk.
  8. Add a router-on-a-stick configuration.
  9. Configure the correct default gateway on every PC.
  10. Test communication between VLAN 10 and VLAN 20.

Review Questions

1. What does a VLAN provide?

A logical Layer 2 broadcast domain within a switched network.

2. What is the purpose of a trunk?

To carry traffic for multiple VLANs over one physical link.

3. What is required for communication between VLANs?

A router or Layer 3 switch providing inter-VLAN routing.

4. What is the native VLAN?

The VLAN that carries untagged frames on an 802.1Q trunk.

5. Why is a voice VLAN used?

To separate IP phone traffic from ordinary data traffic and apply appropriate voice policies.

2.6 EtherChannel

EtherChannel combines multiple physical Ethernet links into one logical link. This increases bandwidth and provides redundancy. Cisco commonly uses Port Aggregation Protocol (PAgP) or the open standard Link Aggregation Control Protocol (LACP).

Real-life scenario: Two switches need more bandwidth than one cable can provide. Four 1-Gbps links are bundled into one logical EtherChannel. If one cable fails, the remaining links continue carrying traffic.
Switch 1 Port-channel 1 Switch 2 Port-channel 1 Four physical links = one logical link

LACP Modes

Mode Behaviour
Active Actively negotiates LACP
Passive Responds to LACP but does not initiate it

An EtherChannel forms when at least one side is active. Passive/passive does not form a channel.

LACP Configuration

Switch1(config)# interface range gigabitEthernet 0/1 - 2
Switch1(config-if-range)# channel-group 1 mode active
Switch1(config-if-range)# exit

Switch1(config)# interface port-channel 1
Switch1(config-if)# switchport mode trunk
Switch1(config-if)# switchport trunk allowed vlan 10,20,30

Configure the matching channel on the second switch:

Switch2(config)# interface range gigabitEthernet 0/1 - 2
Switch2(config-if-range)# channel-group 1 mode active
Switch2(config-if-range)# exit

Switch2(config)# interface port-channel 1
Switch2(config-if)# switchport mode trunk
Switch2(config-if)# switchport trunk allowed vlan 10,20,30
Interfaces in one EtherChannel must use compatible speed, duplex, switchport mode, access VLAN, native VLAN and allowed VLAN settings.

Verifying EtherChannel

Switch# show etherchannel summary

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------
1      Po1(SU)       LACP        Gi0/1(P) Gi0/2(P)
Indicator Meaning
S Layer 2 port-channel
U Port-channel is in use
P Interface is bundled in the port-channel
I Interface is standalone
s Suspended
Switch# show interfaces port-channel 1
Switch# show lacp neighbor
Switch# show interfaces trunk
Configure Layer 2 or trunk settings on the port-channel interface, not independently on each member interface.

2.7 Layer 2 Loops

A Layer 2 loop occurs when redundant switch paths allow Ethernet frames to circulate indefinitely. Ethernet frames do not contain a hop-count field, so loops can cause severe network problems.

Real-life scenario: An employee connects both ends of a spare cable to the same switch. Broadcast frames circulate repeatedly, consuming bandwidth and switch resources. This can make the entire LAN slow or unavailable.

Effects of Layer 2 Loops

  • Broadcast storms
  • Multiple copies of the same frame
  • MAC address table instability
  • High CPU usage
  • Duplicate frames received by endpoints
  • Network-wide connectivity loss

2.8 Spanning Tree Protocol

Spanning Tree Protocol, or STP, prevents Layer 2 loops by placing redundant interfaces into a blocking state while maintaining an alternate path for failure recovery.

Root Bridge Lowest bridge ID Switch A Switch B Redundant link is blocked to prevent a loop

Bridge ID

STP elects one switch as the root bridge. The bridge with the lowest bridge ID wins. The bridge ID is based on bridge priority and MAC address.

Switch(config)# spanning-tree vlan 10 priority 24576

Lowering the priority makes a switch more likely to become the root bridge. The default priority is commonly 32768, subject to the extended system ID.

STP Port Roles

Role Purpose
Root port Best path from a non-root switch toward the root bridge
Designated port Forwarding port selected for a network segment
Alternate port Backup path that is normally discarding
Disabled Not participating because the interface is administratively down

STP Port States

State Function
Blocking Does not forward data frames; listens for BPDUs
Listening Participates in STP but does not learn MAC addresses
Learning Learns MAC addresses but does not forward data frames
Forwarding Learns MAC addresses and forwards frames
Disabled Does not participate in STP

2.9 Rapid Spanning Tree Protocol

Rapid PVST+ improves convergence by using a separate spanning-tree instance per VLAN and transitioning ports more quickly after a topology change.

Switch(config)# spanning-tree mode rapid-pvst
Switch(config)# spanning-tree vlan 10,20,30 priority 24576
If an uplink fails, RSTP can activate an alternate path more quickly than traditional 802.1D STP, reducing user disruption.

STP Verification

Switch# show spanning-tree

VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    24586
             Address     0011.2233.4455
             This bridge is the root

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- --------- ----------------
Gi0/1            Desg FWD 4         128.1     P2p
Gi0/2            Desg FWD 4         128.2     P2p
Switch# show spanning-tree vlan 10
Switch# show spanning-tree root
Switch# show spanning-tree blockedports

2.10 PortFast

PortFast allows an access port connected to an endpoint to enter the forwarding state immediately instead of waiting through normal STP transitions.

Switch(config)# interface gigabitEthernet 0/5
Switch(config-if)# spanning-tree portfast
Use PortFast only on ports connected to end devices. Do not use it on links between switches. Connecting a switch to a PortFast port can create a loop.

2.11 BPDU Guard

BPDU Guard protects PortFast ports. If a BPDU arrives, the switch assumes an unexpected switch has been connected and places the interface into an err-disabled state.

Switch(config)# interface gigabitEthernet 0/5
Switch(config-if)# spanning-tree portfast
Switch(config-if)# spanning-tree bpduguard enable

It can also be enabled globally for PortFast interfaces:

Switch(config)# spanning-tree portfast bpduguard default
A contractor connects a small unmanaged switch to an employee wall socket. BPDU Guard can disable the port rather than allowing the new switch to affect the spanning-tree topology.

2.12 Root Guard and Loop Guard

Root Guard

Root Guard prevents a designated port from becoming a root port because of unexpected superior BPDUs. It is useful at boundaries where another switch must not become the root bridge.

Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# spanning-tree guard root

Loop Guard

Loop Guard prevents a port that unexpectedly stops receiving BPDUs from moving incorrectly into forwarding. It places the port into a loop-inconsistent state until BPDUs return.

Switch(config)# interface gigabitEthernet 0/23
Switch(config-if)# spanning-tree guard loop

2.13 STP Troubleshooting

Problem Check
Unexpected root bridge Bridge priority and MAC address
Port is blocking Root path cost, bridge IDs and topology design
Port is err-disabled BPDU Guard, link flapping or another protection feature
Frequent topology changes Unstable links, incorrect PortFast use or loops
Slow endpoint startup Missing PortFast on a genuine endpoint port
Switch# show interfaces status err-disabled
Switch# show errdisable recovery
Switch# show spanning-tree detail
Switch# show logging
Packet Tracer lab: STP and EtherChannel
  1. Add three switches in a triangle topology.
  2. Connect each switch with redundant links.
  3. Observe which port STP blocks.
  4. Use show spanning-tree to identify the root bridge.
  5. Change the root switch priority.
  6. Disconnect a forwarding link and observe reconvergence.
  7. Bundle two parallel links using LACP.
  8. Verify the port-channel with show etherchannel summary.
  9. Configure PortFast and BPDU Guard on an endpoint port.
  10. Connect another switch to that port and observe the protection response.

Network Access Review

1. What is the purpose of a trunk?

It transports traffic for multiple VLANs across one physical link.

2. What does EtherChannel provide?

Logical link aggregation, increased capacity and redundancy.

3. Why does STP block a redundant port?

To prevent a Layer 2 loop while retaining the link as a possible backup.

4. What is the root bridge?

The switch elected by STP as the reference point for calculating paths.

5. What does BPDU Guard do?

It protects an edge port by disabling it when an unexpected BPDU arrives.

6. What happens if both LACP peers are passive?

LACP does not initiate, so the EtherChannel normally does not form.

2.14 Wireless LAN Architecture

Enterprise wireless networks separate the wireless access function from centralized management. Access points provide radio connectivity, while a wireless LAN controller manages configuration, security and mobility.

Network Services Wireless LAN Controller Access Point 1 Access Point 2 Access Point 3

Autonomous and Lightweight Access Points

Type Management model Typical use
Autonomous AP Configured individually Small or simple deployments
Lightweight AP Managed by a wireless controller Enterprise WLANs
Cloud-managed AP Managed through a cloud platform Distributed branches and simplified operations
A small café may configure one autonomous access point locally. A university with hundreds of APs benefits from centralized controller or cloud management.

2.15 Access Point Modes

Mode Purpose
Local Provides normal WLAN client access
Monitor Scans for wireless activity and security threats
Sniffer Captures wireless frames for analysis
Rogue detector Helps identify unauthorized access points
FlexConnect Allows local branch operation with controller management
Bridge Connects networks over a wireless bridge link

2.16 WLAN Components

SSID and WLAN Policy

A WLAN profile associates an SSID with security, VLAN and traffic policies. Different user groups can receive different access policies.

An organization can publish “Company-Staff” for employees on VLAN 10 and “Company-Guest” for visitors on VLAN 30. The two SSIDs use different authentication and firewall policies.

CAPWAP

Control and Provisioning of Wireless Access Points, or CAPWAP, is used between lightweight access points and wireless LAN controllers.

CAPWAP traffic Purpose Default UDP port
Control AP management and control messages UDP 5246
Data Client data transported through the AP/controller tunnel UDP 5247
A lightweight AP may be connected to an access switch, but its management and client traffic can be carried through a CAPWAP tunnel to the controller.

AP Discovery

An access point must discover a controller before it can obtain centralized configuration. Discovery may use DHCP information, DNS, broadcast or a statically configured controller address, depending on the deployment.

2.17 Wireless Security

Personal Authentication

Personal wireless networks use a shared passphrase. Every authorized user receives the same secret.

SSID: Home-WiFi
Security: WPA2-Personal
Passphrase: Shared secret

Enterprise Authentication

Enterprise WLANs use 802.1X. A client authenticates through an access point and controller to a centralized authentication server, commonly RADIUS.

Wireless Client Supplicant Access Point Authenticator Controller Policy relay RADIUS Server
802.1X role Device
Supplicant Wireless client requesting access
Authenticator Access point or network device controlling the connection
Authentication server RADIUS server validating credentials and returning policy
A shared WPA-Personal password is not the same as 802.1X enterprise authentication. Enterprise authentication normally supports individual credentials and centralized policy.

2.18 Wireless Channel Planning

Access points should use channel assignments that minimize co-channel and adjacent-channel interference. Channel planning considers location, power, coverage, client density and regulatory restrictions.

2.4 GHz Example

In many regulatory domains, channels 1, 6 and 11 are commonly selected because they do not overlap with one another in the 2.4 GHz band.

Three nearby access points operating on overlapping channels can interfere with one another. Assigning separated channels and adjusting transmit power can improve performance.

Signal and Coverage

Observation Likely interpretation
Strong signal but slow service Congestion, interference or upstream network issue
Weak signal at room edge Distance, walls or poor AP placement
Frequent roaming Coverage overlap or unstable signal
High retries Interference, low signal or client transmission issues

2.19 Wireless Troubleshooting

Client Cannot See the SSID

  1. Confirm the access point is powered and operational.
  2. Check whether the SSID is hidden.
  3. Verify the client supports the configured frequency and security.
  4. Check channel utilization and radio configuration.
  5. Confirm the WLAN is enabled on the controller.

Client Sees SSID but Cannot Authenticate

  1. Check the passphrase for personal authentication.
  2. Verify the client certificate or credentials for enterprise authentication.
  3. Check RADIUS reachability and shared secret configuration.
  4. Confirm date and time where certificates are used.
  5. Review controller and authentication-server logs.

Client Authenticates but Has No IP Address

  1. Confirm the client is mapped to the correct VLAN.
  2. Verify DHCP service and DHCP relay configuration.
  3. Check the trunk between the AP/controller and switch.
  4. Confirm the VLAN exists and is allowed on trunks.
  5. Check the default gateway and DHCP scope.

Useful Commands

Switch# show vlan brief
Switch# show interfaces trunk
Switch# show power inline
Switch# show mac address-table dynamic
Switch# show cdp neighbors
Switch# show lldp neighbors
Wireless troubleshooting should be layered: radio visibility, authentication, VLAN assignment, DHCP, gateway reachability and application access.
Packet Tracer lab: basic WLAN
  1. Add a wireless router or access point and two wireless clients.
  2. Configure an SSID named Training-WiFi.
  3. Enable WPA2-Personal security with a strong test passphrase.
  4. Connect both clients to the SSID.
  5. Verify that each client receives an IP address.
  6. Ping the wireless gateway.
  7. Change the passphrase and observe authentication failure.
  8. Restore the correct passphrase and test connectivity again.
  9. Document the SSID, security method, VLAN and IP network.

Network Access Final Review

1. What is the difference between an access port and a trunk?

An access port normally carries one VLAN. A trunk carries multiple VLANs and identifies them using tagging.

2. What protocol negotiates many Cisco EtherChannels?

LACP is the standards-based protocol. PAgP is Cisco proprietary.

3. Why does STP block a port?

To eliminate a Layer 2 loop while preserving a redundant path.

4. What does CAPWAP provide?

Control and data communication between lightweight access points and a wireless LAN controller.

5. What server commonly supports 802.1X authentication?

A RADIUS authentication server.

6. What should you check if a WLAN client authenticates but receives no IP address?

VLAN mapping, trunk configuration, DHCP service or relay, DHCP scope and default gateway.

3. IP Connectivity

IP connectivity explains how routers learn networks, choose paths and forward packets between different subnets.

3.1 How a Router Forwards Packets

  1. Receives an Ethernet frame on an active interface.
  2. Removes the Layer 2 header and examines the destination IP address.
  3. Searches its routing table.
  4. Selects the best matching route.
  5. Decrements the IPv4 TTL or IPv6 Hop Limit.
  6. Creates a new Layer 2 frame for the outgoing interface.
  7. Forwards the packet to the next hop.
Real-life scenario: A letter may cross several postal regions. Each regional office reads the destination and forwards it to the next appropriate office. A router performs a similar process with packets.
Source LAN 10.1.1.0/24 R1 R2 Destination LAN 10.2.2.0/24 Each router chooses the next hop.

3.2 The Routing Table

A routing table contains network destinations, prefix lengths, next hops and outgoing interfaces. Routes may be learned as connected, static or dynamic routes.

Router# show ip route

Codes: C - connected, S - static, O - OSPF, L - local

C    192.168.10.0/24 is directly connected, GigabitEthernet0/0
L    192.168.10.1/32 is directly connected, GigabitEthernet0/0
O    192.168.20.0/24 [110/2] via 10.0.0.2, 00:00:18, GigabitEthernet0/1
S*   0.0.0.0/0 [1/0] via 10.0.0.1
Code Meaning
C Connected network
L Local interface address
S Static route
O OSPF route
* Candidate default route

3.3 Longest-Prefix Match

When several routes match a destination, the router chooses the route with the longest prefix—the most specific route.

If a router has routes for 10.0.0.0/8, 10.20.0.0/16 and 10.20.30.0/24, traffic to 10.20.30.50 uses the /24 route because it is the most specific match.
Route Matches 10.20.30.50? Specificity
10.0.0.0/8 Yes Least specific
10.20.0.0/16 Yes More specific
10.20.30.0/24 Yes Most specific; selected

3.4 Route Selection

If routes to the same destination have different administrative distances, the route with the lower administrative distance is preferred.

Source Typical administrative distance
Connected 0
Static 1
OSPF 110
RIP 120
Unknown or unusable 255

If routes come from the same routing source, the routing protocol's metric determines the preferred path.

The exact values can vary by implementation and configuration. The exam principle is: longest prefix first, then administrative distance, then protocol metric.

3.5 Connected Routes

When an interface has an IP address and is operational, the router installs a connected route for the subnet and a local host route for the interface address.

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip address 192.168.10.1 255.255.255.0
Router(config-if)# no shutdown

Router# show ip route connected
C    192.168.10.0/24 is directly connected, GigabitEthernet0/0
L    192.168.10.1/32 is directly connected, GigabitEthernet0/0

3.6 Static Routes

A static route is manually configured by an administrator. It does not change automatically when the topology changes unless tracking or another mechanism is used.

Next-Hop Static Route

Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2

Exit-Interface Static Route

Router(config)# ip route 192.168.20.0 255.255.255.0 gigabitEthernet 0/1

Fully Specified Static Route

Router(config)# ip route 192.168.20.0 255.255.255.0 \
  gigabitEthernet 0/1 10.0.0.2
A small branch has one path to headquarters. A static route may be appropriate because the topology is simple and changes rarely.

IPv6 Static Route

Router(config)# ipv6 route 2001:db8:20::/64 2001:db8:12::2

3.7 Default Routes

A default route matches destinations for which no more specific route exists. It is also called the gateway of last resort.

IPv4 Default Route

Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1

IPv6 Default Route

Router(config)# ipv6 route ::/0 2001:db8:ffff::1
A branch router sends all unknown internet traffic to its service-provider router using a default route.

3.8 Floating Static Routes

A floating static route is a backup route configured with a higher administrative distance than the primary route.

! Primary static route
Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2 1

! Backup floating route
Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.1.2 200
A business uses a private WAN circuit as its primary path and an internet VPN as a backup. The floating route remains hidden until the primary route disappears.

3.9 Routing Table Verification

Router# show ip route
Router# show ip route 192.168.20.0
Router# show ip cef
Router# show ip protocols
Router# ping 192.168.20.10
Router# traceroute 192.168.20.10
Command Purpose
show ip route Displays the IPv4 routing table
show ip route <network> Shows the selected route to a destination
ping Tests reachability
traceroute Shows Layer 3 hops toward a destination
Packet Tracer lab: static routing
  1. Add three routers and one LAN at each router.
  2. Assign unique /24 LAN networks.
  3. Assign /30 transit networks between routers.
  4. Configure all interfaces and verify they are up/up.
  5. Add static routes to every remote LAN.
  6. Use show ip route to verify each route.
  7. Ping from a PC on the first LAN to a PC on the third LAN.
  8. Use traceroute to identify the router path.
  9. Add a default route toward the simulated internet.
  10. Configure a floating backup route and test failover.

IP Connectivity Review

1. What is longest-prefix matching?

Selecting the route with the most specific matching prefix.

2. What does a default route do?

It forwards traffic when no more specific route exists.

3. What is a floating static route?

A backup static route with a higher administrative distance than the primary route.

4. Which has a lower administrative distance: static or OSPF?

Static routing normally has a lower value: 1 versus OSPF's 110.

5. What creates a connected route?

An operational router interface configured with an IP address and subnet mask.

3.10 OSPFv2 Fundamentals

Open Shortest Path First version 2, or OSPFv2, is a link-state routing protocol for IPv4. Routers exchange link-state information, build a common topology database and calculate shortest paths using the SPF algorithm.

Real-life scenario: A delivery company shares road, distance and closure information among regional offices. Each office builds a map and selects the shortest available route. OSPF routers similarly share link-state information and calculate paths.

Why Use OSPF?

  • Automatically learns remote networks
  • Converges after topology changes
  • Supports hierarchical areas
  • Uses cost as its path metric
  • Supports classless IPv4 prefixes and VLSM
  • Uses authentication options

OSPF Single Area

A small network can place all OSPF interfaces in area 0. Area 0 is also called the backbone area.

R1 Area 0 R2 Area 0 R3 Area 0 All routers share one OSPF area and exchange routes.

3.11 OSPF Neighbour Relationships

OSPF routers become neighbours before exchanging routing information. Neighbour formation requires compatible settings.

Requirement Explanation
Same area Interfaces must belong to the same OSPF area
Matching timers Hello and dead intervals must match
Same network type Interfaces must use compatible OSPF network types
Authentication If enabled, credentials must match
Reachability Interfaces must be operational and able to exchange OSPF packets

OSPF Neighbour States

State Meaning
Down No Hello packet received from the neighbour
Init A Hello was received, but the router's own ID was not seen in it
2-Way Bidirectional Hello communication exists
ExStart Routers negotiate master and slave roles
Exchange Database description packets are exchanged
Loading Missing link-state information is requested
Full Link-state databases are synchronized
On a point-to-point link, a healthy OSPF neighbour relationship normally reaches Full. On a broadcast network, routers may remain in 2-Way with non-designated routers.

3.12 Configuring OSPF

Classic OSPF Configuration

R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
R1(config-router)# network 10.0.12.0 0.0.0.3 area 0

The number after router ospf is locally significant. It does not need to match on neighbouring routers.

Interface-Based OSPF Configuration

R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip ospf 1 area 0

R1(config)# interface gigabitEthernet 0/1
R1(config-if)# ip ospf 1 area 0
The wildcard mask is the inverse of the subnet mask. For 255.255.255.0, use 0.0.0.255. For 255.255.255.252, use 0.0.0.3.

Example: Three-Router OSPF Network

! R1
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
R1(config-router)# network 10.0.12.0 0.0.0.3 area 0

! R2
R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 10.0.12.0 0.0.0.3 area 0
R2(config-router)# network 10.0.23.0 0.0.0.3 area 0

! R3
R3(config)# router ospf 1
R3(config-router)# router-id 3.3.3.3
R3(config-router)# network 10.0.23.0 0.0.0.3 area 0
R3(config-router)# network 192.168.30.0 0.0.0.255 area 0

3.13 OSPF Router ID

Every OSPF router requires a unique router ID. The selection order is:

  1. Manually configured router ID
  2. Highest loopback interface address
  3. Highest active physical interface address
Router(config)# router ospf 1
Router(config-router)# router-id 10.10.10.10

If the router ID changes after OSPF is already running, restart the OSPF process or reload the router as appropriate.

Router# clear ip ospf process
Reset ALL OSPF processes? [no]: yes
Clearing an OSPF process briefly interrupts OSPF neighbour relationships. Perform it only during an appropriate maintenance window.

3.14 OSPF Passive Interfaces

A passive interface advertises its connected network into OSPF but does not form OSPF neighbour relationships on that interface.

Router(config)# router ospf 1
Router(config-router)# passive-interface gigabitEthernet 0/0

This is useful on user LANs where no OSPF neighbour should exist.

Router(config)# router ospf 1
Router(config-router)# passive-interface default
Router(config-router)# no passive-interface gigabitEthernet 0/1
Router(config-router)# no passive-interface gigabitEthernet 0/2
A router should advertise its employee LAN but should not accept unexpected OSPF neighbours from employee devices. Making the LAN interface passive provides that behaviour.

3.15 OSPF Metric and Cost

OSPF uses cost as its metric. Lower total cost is preferred. The cost is commonly calculated from reference bandwidth divided by interface bandwidth.

Router# show ip ospf interface gigabitEthernet 0/1

GigabitEthernet0/1 is up, line protocol is up
  Internet Address 10.0.12.1/30, Area 0
  Process ID 1, Router ID 1.1.1.1
  Network Type POINT-TO-POINT, Cost: 10

Changing Interface Cost

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip ospf cost 20

Changing Reference Bandwidth

Router(config)# router ospf 1
Router(config-router)# auto-cost reference-bandwidth 100000
If changing the reference bandwidth, apply the same value consistently to all routers in the OSPF domain.

3.16 OSPF Network Types

Network type Typical medium DR/BDR election
Broadcast Ethernet Yes
Point-to-point Point-to-point WAN or configured Ethernet link No
Non-broadcast multiaccess Older NBMA technologies Yes, with special operation

Configuring Point-to-Point Network Type

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip ospf network point-to-point

3.17 DR and BDR

On a broadcast multiaccess network, OSPF elects a Designated Router and Backup Designated Router. This reduces the number of full adjacency relationships required.

On a shared Ethernet segment with ten routers, full adjacency between every pair would be inefficient. The DR acts as the central exchange point for link-state updates.
Election factor Priority
Highest OSPF interface priority Preferred
Highest router ID Used as tie-breaker
Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip ospf priority 100

A priority of zero prevents an interface from becoming DR or BDR.

Router(config-if)# ip ospf priority 0

3.18 OSPF Verification

Router# show ip ospf
Router# show ip ospf neighbor
Router# show ip ospf interface brief
Router# show ip ospf interface gigabitEthernet 0/1
Router# show ip route ospf
Router# show ip protocols

Example Neighbour Output

Router# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address       Interface
2.2.2.2           1   FULL/ -         00:00:31    10.0.12.2     Gi0/1
3.3.3.3           1   FULL/DR         00:00:32    192.168.1.3   Gi0/0

3.19 OSPF Troubleshooting

Symptom Possible cause
No neighbour appears Interface down, wrong network statement or passive interface
Neighbour stuck in Init One-way communication or filtering
Neighbour stuck in ExStart MTU mismatch or duplicate router ID
Routes missing Incorrect area, network statement or passive configuration
Unexpected path selected OSPF cost or reference-bandwidth issue
Router# show ip interface brief
Router# show ip ospf neighbor
Router# show ip ospf interface
Router# show ip route
Router# show access-lists
Router# show logging
Packet Tracer lab: single-area OSPF
  1. Add three routers in a triangle topology.
  2. Configure /30 transit networks between routers.
  3. Add one /24 LAN to each router.
  4. Configure unique OSPF router IDs.
  5. Advertise every transit and LAN network in area 0.
  6. Verify neighbour relationships with show ip ospf neighbor.
  7. Verify learned routes with show ip route ospf.
  8. Make each user-facing interface passive.
  9. Change one interface cost and observe route selection.
  10. Shut down a transit link and verify OSPF reconvergence.

OSPF Review

1. What type of routing protocol is OSPF?

It is a link-state interior gateway protocol.

2. What is the purpose of area 0?

It is the OSPF backbone area and the required central area in a multi-area design.

3. What metric does OSPF use?

Cost, usually related to interface bandwidth.

4. What is a passive interface?

It advertises the connected network but does not form OSPF neighbour relationships on that interface.

5. Why are DR and BDR elected?

To reduce the number of full OSPF adjacencies on a broadcast multiaccess network.

4. IP Services

IP services provide address assignment, name resolution, time synchronization, monitoring, secure administration and traffic handling.

4.1 Network Address Translation

NAT translates one IP address into another. It commonly translates private internal IPv4 addresses into a public address for internet access.

Real-life scenario: A home has many devices using private addresses such as 192.168.1.10 and 192.168.1.11. The router translates their traffic to one public internet address.
Term Meaning
Inside local Private address assigned to an internal device
Inside global Public address representing an internal device
Outside global Address assigned to an external destination
Outside local External address as seen from the inside network

Static NAT

Static NAT creates a permanent one-to-one mapping between an inside local and inside global address.

Router(config)# ip nat inside source static \
192.168.10.10 203.0.113.10

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip nat inside

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip nat outside
A company hosts a public web server internally. Static NAT maps its private address to a stable public address.

Dynamic NAT

Dynamic NAT maps inside addresses to addresses from a configured public pool. The mapping exists while the translation is active.

Router(config)# ip nat pool PUBLIC_POOL \
203.0.113.20 203.0.113.30 netmask 255.255.255.0

Router(config)# access-list 1 permit 192.168.10.0 0.0.0.255

Router(config)# ip nat inside source list 1 pool PUBLIC_POOL

PAT Overload

Port Address Translation allows many inside devices to share one public address by distinguishing sessions with transport-layer port numbers.

Router(config)# access-list 1 permit 192.168.10.0 0.0.0.255
Router(config)# ip nat inside source list 1 interface gigabitEthernet 0/1 overload
192.168.1.10 192.168.1.11 192.168.1.12 NAT/PAT Router 203.0.113.5 Internet

NAT Verification

Router# show ip nat translations
Router# show ip nat statistics
Router# clear ip nat translation *

4.2 DHCPv4

Dynamic Host Configuration Protocol automatically supplies IPv4 configuration such as address, subnet mask, default gateway and DNS server.

DORA Process

  1. Discover: Client broadcasts a request for DHCP servers.
  2. Offer: A DHCP server offers an address.
  3. Request: The client requests the offered configuration.
  4. Acknowledgement: The server confirms the lease.
When a laptop joins Wi-Fi, it can receive an address, gateway and DNS server automatically instead of requiring manual configuration.

Router as DHCP Server

Router(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.20

Router(config)# ip dhcp pool USERS
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# dns-server 192.168.10.5
Router(dhcp-config)# domain-name example.local
Router(dhcp-config)# lease 7

DHCP Verification

Router# show ip dhcp binding
Router# show ip dhcp pool
Router# show ip dhcp conflict

4.3 DHCP Relay

DHCP broadcasts normally do not cross routers. A DHCP relay forwards client requests to a DHCP server located on another network.

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip helper-address 192.168.50.10
A central DHCP server serves every branch. Each branch router uses ip helper-address so local clients can reach the server.

4.4 DNS

The Domain Name System translates human-readable names into IP addresses.

Client query:
www.example.com

DNS response:
203.0.113.80
People remember intranet.company.example more easily than an IP address. DNS lets applications use names while networks use addresses.

Router DNS Lookup

Router(config)# ip name-server 192.168.10.5
Router(config)# ip domain lookup

Router# ping server.example.local
Router# nslookup www.example.com

4.5 NTP

Network Time Protocol synchronizes clocks across network devices. Accurate time is important for logs, certificates, authentication and troubleshooting.

Router(config)# ntp server 192.168.50.10

Router# show clock
Router# show ntp status
Router# show ntp associations
During a security investigation, administrators compare firewall, router and server logs. If their clocks disagree, reconstructing the incident is difficult.

4.6 Syslog

Syslog sends device messages to a centralized logging server. Messages are classified by severity from 0, emergencies, to 7, debugging.

Severity Name
0Emergency
1Alert
2Critical
3Error
4Warning
5Notification
6Informational
7Debugging
Router(config)# logging host 192.168.50.20
Router(config)# logging trap warnings
Router(config)# service timestamps log datetime msec
A central syslog server records an interface-down event from a remote branch, allowing the operations team to investigate without logging into every device.

4.7 SNMP

Simple Network Management Protocol allows monitoring systems to collect information and receive alerts from network devices.

SNMP component Role
Manager Monitoring platform requesting information
Agent Software running on the monitored device
MIB Structured collection of manageable objects
Trap Unsolicited alert sent by the device
Router(config)# snmp-server community MONITORING ro
Router(config)# snmp-server host 192.168.50.30 version 2c MONITORING
Router(config)# snmp-server enable traps
SNMPv1 and SNMPv2c community strings are not strongly protected. Prefer SNMPv3 where supported because it provides authentication and privacy.

4.8 Quality of Service

Quality of Service, or QoS, classifies and prioritizes traffic when network resources are congested.

QoS concept Purpose
Classification Identifies traffic types
Marking Adds a value indicating traffic treatment
Queuing Determines transmission order during congestion
Shaping Buffers traffic to smooth the sending rate
Policing Limits traffic and may drop or remark excess packets
Voice packets are sensitive to delay and jitter. QoS can place voice in a priority queue so a large file transfer does not make a phone call unintelligible.

4.9 Secure Remote Access with SSH

Secure Shell provides encrypted remote administration. It is preferred over Telnet, which sends credentials and commands without strong encryption.

Router(config)# hostname R1
R1(config)# ip domain-name example.local
R1(config)# username admin privilege 15 secret StrongPasswordHere
R1(config)# crypto key generate rsa modulus 2048
R1(config)# ip ssh version 2

R1(config)# line vty 0 4
R1(config-line)# login local
R1(config-line)# transport input ssh
R1(config-line)# exit

SSH Verification

R1# show ip ssh
R1# show users
R1# show running-config | section line vty
An administrator connects to a branch router over SSH. The session is encrypted, so credentials and commands are not sent as readable text.

4.10 FTP and TFTP

TFTP is a simple file-transfer protocol often used for configuration and image transfers. FTP provides more features and authentication options.

Router# copy running-config tftp:
Router# copy tftp: running-config
Router# copy flash: tftp:
Router# copy tftp: flash:
Always verify the destination, available storage and file integrity before replacing a device configuration or software image.

IP Services Lab

Packet Tracer lab: branch services
  1. Configure a router as a DHCP server for a user LAN.
  2. Exclude the gateway and infrastructure addresses.
  3. Configure PAT using the router's WAN interface.
  4. Configure a static NAT mapping for an internal web server.
  5. Configure a DNS server and test name resolution.
  6. Configure NTP and verify the clock source.
  7. Configure a remote syslog server.
  8. Enable SSH and disable Telnet on the VTY lines.
  9. Test each service and document the verification command.

IP Services Review

1. What does PAT use to distinguish many sessions?

Transport-layer port numbers.

2. What is the purpose of DHCP relay?

It forwards DHCP requests across a router to a DHCP server on another network.

3. Why is NTP important?

It synchronizes device clocks, improving logging, authentication and troubleshooting.

4. Why is SSH preferred to Telnet?

SSH encrypts the management session; Telnet does not provide equivalent protection.

5. What does QoS address?

It manages traffic treatment during congestion, including delay-sensitive voice and video traffic.

5. Security Fundamentals

Network security protects confidentiality, integrity and availability. Good security combines people, processes, technology and continuous monitoring.

5.1 The CIA Triad

Principle Meaning Example
Confidentiality Only authorized people can view information Encryption and access control
Integrity Information is not changed improperly Hashes and digital signatures
Availability Systems remain accessible when needed Redundancy and backups
Real-life scenario: A banking application encrypts customer data for confidentiality, uses transaction controls for integrity and runs on redundant servers for availability.

5.2 Common Network Threats

Threat Description Example
Malware Malicious software Ransomware encrypts company files
Phishing Fraudulent message designed to steal information Fake login page sent by email
Denial of service Overwhelming a service to reduce availability Large volumes of malicious requests
Man-in-the-middle Attacker intercepts communication Rogue access point captures traffic
Spoofing Attacker pretends to be another device Forged source IP or MAC address
Social engineering Manipulating people rather than systems Attacker impersonates an employee

5.3 Device Hardening

Device hardening reduces the attack surface by disabling unnecessary services, enforcing authentication and controlling administrative access.

Basic Secure Configuration

Router(config)# hostname R1
R1(config)# enable secret StrongEnableSecret
R1(config)# service password-encryption
R1(config)# security passwords min-length 12
R1(config)# login block-for 120 attempts 3 within 60

R1(config)# username admin privilege 15 secret StrongAdminSecret
R1(config)# ip domain-name secure.example
R1(config)# crypto key generate rsa modulus 2048
R1(config)# ip ssh version 2

R1(config)# line console 0
R1(config-line)# login local
R1(config-line)# exec-timeout 5 0
R1(config-line)# logging synchronous

R1(config)# line vty 0 4
R1(config-line)# login local
R1(config-line)# transport input ssh
R1(config-line)# exec-timeout 5 0
Never publish real passwords, private keys or production configurations in a blog, lab document or public repository.

Disable an Unused Interface

Switch(config)# interface range gigabitEthernet 0/10 - 24
Switch(config-if-range)# shutdown
Switch(config-if-range)# description UNUSED
If an unused switch port remains active, someone could connect an unauthorized device. Administratively shutting it down reduces that risk.

5.4 Management Plane, Control Plane and Data Plane

Plane Purpose Protection example
Management plane Device administration SSH, AAA and management ACLs
Control plane Routing and network control protocols Routing authentication and control-plane policing
Data plane Forwarding user traffic ACLs and segmentation

5.5 AAA

AAA stands for Authentication, Authorization and Accounting.

Function Question answered
Authentication Who are you?
Authorization What are you allowed to do?
Accounting What did you do?

Local AAA

Router(config)# username admin privilege 15 secret LocalSecret
Router(config)# aaa new-model
Router(config)# aaa authentication login default local
Router(config)# aaa authorization exec default local

Router(config)# line vty 0 4
Router(config-line)# login authentication default

RADIUS and TACACS+

Feature RADIUS TACACS+
Common use Network access and 802.1X Device administration
Transport UDP TCP
Encryption Primarily password protection Encrypts the complete payload
Authorization Supported Detailed command authorization
An organization uses a central TACACS+ server so administrators authenticate with individual accounts and their commands are logged.

5.6 Access Control Lists

An ACL is an ordered list of permit and deny statements. Routers process entries from top to bottom and stop at the first match.

Every ACL has an implicit deny at the end. If no statement matches, the packet is denied.

Standard IPv4 ACL

A standard ACL filters primarily by source IPv4 address.

Router(config)# access-list 10 deny host 192.168.10.50
Router(config)# access-list 10 permit any

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip access-group 10 in

Named Standard ACL

Router(config)# ip access-list standard BLOCK-HOST
Router(config-std-nacl)# deny host 192.168.10.50
Router(config-std-nacl)# permit any

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip access-group BLOCK-HOST in

Extended IPv4 ACL

Extended ACLs can filter by source, destination, protocol and port.

Router(config)# ip access-list extended ALLOW-WEB
Router(config-ext-nacl)# permit tcp 192.168.10.0 0.0.0.255 \
host 192.168.20.10 eq 443
Router(config-ext-nacl)# deny ip any host 192.168.20.10
Router(config-ext-nacl)# permit ip any any

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip access-group ALLOW-WEB out
Employees may access a web server over HTTPS, while other traffic to that server is denied. The ACL is placed close to the destination to filter unwanted traffic efficiently.

ACL Placement

  • Standard ACL: place close to the destination because it cannot identify the destination.
  • Extended ACL: place close to the source to stop unwanted traffic early.

ACL Verification

Router# show access-lists
Router# show ip interface gigabitEthernet 0/0
Router# show running-config | section access-list

5.7 IPv6 ACLs

IPv6 ACLs are named and use commands beginning with ipv6 access-list.

Router(config)# ipv6 access-list V6-FILTER
Router(config-ipv6-acl)# permit tcp 2001:db8:10::/64 \
host 2001:db8:20::10 eq 443
Router(config-ipv6-acl)# deny ipv6 any host 2001:db8:20::10
Router(config-ipv6-acl)# permit ipv6 any any

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ipv6 traffic-filter V6-FILTER out

5.8 Layer 2 Security

Port Security

Port security limits which MAC addresses can use a switch port.

Switch(config)# interface gigabitEthernet 0/5
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 2
Switch(config-if)# switchport port-security mac-address sticky
Switch(config-if)# switchport port-security violation restrict
Violation mode Behaviour
Protect Drops unauthorized frames silently
Restrict Drops frames and increments counters or logs events
Shutdown Places the port into err-disabled state
Switch# show port-security
Switch# show port-security interface gigabitEthernet 0/5

DHCP Snooping

DHCP snooping filters untrusted DHCP messages and builds a binding table. Only trusted ports should connect to legitimate DHCP servers or uplinks.

Switch(config)# ip dhcp snooping
Switch(config)# ip dhcp snooping vlan 10,20

Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# ip dhcp snooping trust
A rogue user connects a small DHCP server to an access port. DHCP snooping blocks server replies arriving from that untrusted port.

Dynamic ARP Inspection

Dynamic ARP Inspection validates ARP messages using the DHCP snooping binding table and helps prevent ARP spoofing.

Switch(config)# ip arp inspection vlan 10,20

Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# ip arp inspection trust

IP Source Guard

IP Source Guard filters traffic using IP-to-MAC bindings learned through DHCP snooping.

Switch(config)# interface gigabitEthernet 0/5
Switch(config-if)# ip verify source

5.9 Wireless Security

  • Use WPA2 or WPA3 instead of obsolete WEP.
  • Use long, unique passphrases for personal WLANs.
  • Use 802.1X and RADIUS for enterprise authentication.
  • Separate guest traffic from internal traffic.
  • Disable unnecessary management access from guest networks.
  • Monitor for rogue access points.
Guest users should receive internet access but should not reach employee laptops, internal servers or network-management interfaces.

5.10 VPN Concepts

A Virtual Private Network creates a protected logical connection across an untrusted network. Encryption, authentication and integrity protection help secure the traffic.

VPN type Example use
Remote-access VPN Employee securely connects from home
Site-to-site VPN Two offices connect securely over the internet
IPsec VPN Provides authentication, encryption and integrity at Layer 3
Office A Private LAN Encrypted VPN Internet Office B Private LAN

5.11 Security Monitoring

Security is not complete after configuration. Administrators should monitor logs, authentication events, interface changes, failed access attempts and abnormal traffic.

Router# show logging
Router# show users
Router# show login
Router# show access-lists
Router# show ip ssh
Router# show interfaces counters errors

Security Fundamentals Lab

Packet Tracer lab: secure a branch router and switch
  1. Configure an enable secret and local administrative user.
  2. Enable SSH and allow SSH only on VTY lines.
  3. Set console and VTY session timeouts.
  4. Disable unused switch ports.
  5. Configure port security on an employee access port.
  6. Configure a standard or extended ACL.
  7. Verify ACL matches and port-security status.
  8. Configure DHCP snooping on the user VLAN.
  9. Trust only the legitimate DHCP-server or uplink port.
  10. Document every security control and its purpose.

Security Review

1. What are the three CIA principles?

Confidentiality, integrity and availability.

2. What is the implicit rule at the end of an ACL?

An implicit deny.

3. What does AAA stand for?

Authentication, Authorization and Accounting.

4. What does DHCP snooping prevent?

It helps block unauthorized DHCP-server messages and builds trusted IP-to-MAC bindings.

5. What is the purpose of port security?

To restrict which MAC addresses may use a switch port.

6. Why is SSH preferred over Telnet?

SSH encrypts remote-management traffic, while Telnet sends it insecurely.

6. Automation and Programmability

Automation uses software to configure, monitor and operate networks. Programmability makes network operations more consistent, repeatable and scalable.

6.1 Traditional and Controller-Based Networking

In traditional networking, an administrator configures each device individually. In controller-based networking, a centralized controller manages policy and communicates with network devices through APIs.

Real-life scenario: An organization opens 50 branch offices. Manual configuration requires repeating the same work 50 times. A controller or automation script can apply a standard configuration consistently.
Approach Characteristics
Traditional Device-by-device configuration through CLI
Controller-based Central policy and programmatic device management
Intent-based Administrator describes desired outcome; system implements policy

6.2 Software-Defined Networking

Software-defined networking separates the control plane from the data plane. A controller makes policy decisions, while network devices forward traffic according to those decisions.

Applications Business intent Controller Control plane Switch Router Wireless

6.3 Northbound and Southbound APIs

API direction Connects
Northbound Applications and the controller
Southbound Controller and network devices
A reporting application uses a northbound API to request network health. The controller uses southbound protocols or APIs to obtain information from switches and routers.

6.4 REST APIs

Representational State Transfer APIs commonly use HTTP methods to manipulate resources.

HTTP method Typical action
GET Read a resource
POST Create a resource
PUT Replace or update a resource
PATCH Partially update a resource
DELETE Remove a resource

HTTP Status Codes

Code Meaning
200 Successful request
201 Resource created
400 Bad request
401 Authentication required or failed
403 Request understood but not permitted
404 Resource not found
500 Server-side error

Example REST Request

GET https://controller.example/api/v1/devices

Response:
200 OK
Use HTTPS and proper authentication for management APIs. Never expose API tokens or passwords in public code.

6.5 JSON

JavaScript Object Notation is a lightweight data format commonly used by REST APIs.

{
  "device": {
    "hostname": "SW1",
    "management_ip": "192.168.10.2",
    "vlans": [10, 20, 30],
    "enabled": true
  }
}
JSON element Example
Object { "name": "SW1" }
Array [10, 20, 30]
String "hostname"
Number 10
Boolean true or false

6.6 YAML

YAML is a human-readable format commonly used by automation tools.

device:
  hostname: SW1
  management_ip: 192.168.10.2
  vlans:
    - 10
    - 20
    - 30
  enabled: true
YAML uses indentation to represent structure. Use consistent spaces and do not mix tabs with spaces.

6.7 Python for Network Automation

Python can connect to devices, collect command output, transform data and apply repeatable configuration.

devices = [
    {"hostname": "R1", "address": "192.168.10.1"},
    {"hostname": "R2", "address": "192.168.20.1"}
]

for device in devices:
    print("Checking", device["hostname"], device["address"])

Simple JSON Processing

import json

data = '''
{
  "hostname": "SW1",
  "vlans": [10, 20, 30]
}
'''

device = json.loads(data)

print(device["hostname"])
print(device["vlans"])

Configuration Generation

hostname = "ACCESS-SW1"
management_ip = "192.168.10.2"

configuration = f"""
hostname {hostname}
interface vlan 10
 ip address {management_ip} 255.255.255.0
 no shutdown
"""

print(configuration)
A script can generate standardized switch configurations from a spreadsheet of hostnames, management addresses and VLAN requirements.

6.8 Configuration Management

Configuration-management tools describe the desired state of systems and help apply it consistently.

Concept Meaning
Desired state How the device should be configured
Idempotence Repeating a task produces the same final state
Inventory List of managed devices and their properties
Playbook Automation instructions describing tasks
Template Reusable configuration with variables

Example Ansible-Style YAML

---
- name: Configure access VLAN
  hosts: switches
  gather_facts: false

  tasks:
    - name: Create users VLAN
      ios_vlans:
        config:
          - name: USERS
            vlan_id: 10
        state: merged
The exact module names and syntax depend on the platform and collection. Test automation in a lab before applying it to production devices.

6.9 Controller-Based Architecture Examples

Controller type Primary focus
LAN controller Campus switching, policy and assurance
Wireless controller Access-point and WLAN management
WAN controller WAN path, application and branch policy
Cloud management platform Centralized management of distributed infrastructure

6.10 Data Analytics and Machine Learning

Network platforms can collect telemetry and use analytics to identify trends, anomalies and likely faults.

Term Simple meaning
Telemetry Continuous operational data from network devices
Analytics Finding patterns and useful information in data
Machine learning Using data to identify patterns or make predictions
Artificial intelligence Broader methods for systems performing tasks associated with human intelligence
A monitoring platform notices that packet loss increases every weekday at 09:00 near one access point. The operations team investigates client density, radio interference or an overloaded uplink.

6.11 Automation Benefits and Risks

Benefits

  • Faster deployment
  • Consistent configuration
  • Reduced typing errors
  • Repeatable changes
  • Improved auditability
  • Scalability

Risks

  • A faulty template can affect many devices quickly.
  • Exposed credentials can compromise the network.
  • Unvalidated changes may cause outages.
  • Automation can amplify mistakes.
A safe workflow validates configuration in a lab, reviews the change, backs up the current state, applies a small rollout and monitors the result before wider deployment.

Automation Lab

Beginner Python lab
  1. Create a list of three fictional network devices.
  2. Store hostname, management IP and device role for each device.
  3. Loop through the list and print a health-check message.
  4. Store the same information in JSON format.
  5. Load the JSON file with Python.
  6. Generate a simple interface configuration from variables.
  7. Never place real credentials in the script.
  8. Extend the script to validate that every device has an IP address.

Automation Review

1. What is the difference between northbound and southbound APIs?

Northbound APIs connect applications to a controller. Southbound APIs connect the controller to network devices.

2. What does GET normally do in a REST API?

It retrieves a resource.

3. What is JSON used for?

It represents structured data exchanged between applications and APIs.

4. What does idempotence mean?

Repeating an automation task produces the same intended final state.

5. Why should automation be tested before production use?

An incorrect script or template can apply damaging changes to many devices very quickly.

7. Practical CCNA Labs

These labs combine the main CCNA skills. Build each topology in Cisco Packet Tracer, configure it manually and verify every result.

Lab 1: Basic Router and Switch Setup

PC-A 192.168.10.10/24 Switch VLAN 10 Router 192.168.10.1
  1. Add one PC, one switch and one router.
  2. Connect the devices with copper Ethernet links.
  3. Configure the router interface as 192.168.10.1/24.
  4. Configure the PC as 192.168.10.10/24.
  5. Set the PC default gateway to 192.168.10.1.
  6. Configure the hostname and an enable secret.
  7. Ping the router from the PC.
  8. Verify with show ip interface brief.
Router(config)# hostname R1
R1(config)# enable secret CiscoSecret
R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# no shutdown

Lab 2: VLANs and Inter-VLAN Routing

  1. Add one router, one switch and two PCs.
  2. Create VLAN 10 for users and VLAN 20 for servers.
  3. Assign one PC to each VLAN.
  4. Configure the switch-to-router link as a trunk.
  5. Create router subinterfaces for VLANs 10 and 20.
  6. Configure the correct default gateway on each PC.
  7. Ping between the two VLANs.
Switch(config)# vlan 10
Switch(config-vlan)# name USERS
Switch(config)# vlan 20
Switch(config-vlan)# name SERVERS

Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

Switch(config)# interface gigabitEthernet 0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20

Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# switchport mode trunk
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# no shutdown

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

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
Switch# show vlan brief
Switch# show interfaces trunk
Router# show ip interface brief

Lab 3: Static Routing

  1. Add two routers and one LAN on each side.
  2. Use 192.168.10.0/24 for LAN 1.
  3. Use 192.168.20.0/24 for LAN 2.
  4. Use 10.0.0.0/30 between the routers.
  5. Configure both router interfaces.
  6. Add a static route to the remote LAN on each router.
  7. Test end-to-end connectivity.
R1(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2
R2(config)# ip route 192.168.10.0 255.255.255.0 10.0.0.1

Lab 4: OSPF

  1. Use the topology from Lab 3.
  2. Remove the static routes.
  3. Configure OSPF process 1 on both routers.
  4. Assign unique router IDs.
  5. Advertise LAN and transit networks in area 0.
  6. Verify the neighbour relationship.
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
R1(config-router)# network 10.0.0.0 0.0.0.3 area 0

R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 192.168.20.0 0.0.0.255 area 0
R2(config-router)# network 10.0.0.0 0.0.0.3 area 0
show ip ospf neighbor
show ip route ospf
show ip ospf interface brief

Lab 5: DHCP and NAT

  1. Configure a router with an inside LAN and outside interface.
  2. Configure the router as a DHCP server.
  3. Exclude the gateway addresses.
  4. Configure PAT using the outside interface.
  5. Verify that clients receive addresses.
  6. Test connectivity to an external simulated server.
R1(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.20
R1(config)# ip dhcp pool USERS
R1(dhcp-config)# network 192.168.10.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.10.1
R1(dhcp-config)# dns-server 8.8.8.8

R1(config)# access-list 1 permit 192.168.10.0 0.0.0.255
R1(config)# ip nat inside source list 1 interface gigabitEthernet 0/1 overload

Lab 6: Secure Device Management

  1. Set a hostname and enable secret.
  2. Create a local administrator.
  3. Generate RSA keys.
  4. Enable SSH version 2.
  5. Allow SSH only on VTY lines.
  6. Set an inactivity timeout.
  7. Verify the configuration.
Router(config)# hostname SECURE-R1
SECURE-R1(config)# ip domain-name lab.example
SECURE-R1(config)# username admin privilege 15 secret AdminSecret
SECURE-R1(config)# crypto key generate rsa modulus 2048
SECURE-R1(config)# ip ssh version 2

SECURE-R1(config)# line vty 0 4
SECURE-R1(config-line)# login local
SECURE-R1(config-line)# transport input ssh
SECURE-R1(config-line)# exec-timeout 5 0

Lab 7: Troubleshooting Challenge

Build a network with the following intentional errors:

  • One router interface is shut down.
  • One PC has an incorrect subnet mask.
  • One switch port is assigned to the wrong VLAN.
  • One trunk does not allow VLAN 20.
  • One PC has the wrong default gateway.
  • One OSPF network statement is incorrect.

Use this troubleshooting order:

  1. Check physical links and interface status.
  2. Check VLAN membership and trunk state.
  3. Check IP addresses and subnet masks.
  4. Check default gateways.
  5. Check routing tables.
  6. Check ACLs and security controls.
  7. Test with ping, traceroute and protocol-specific commands.
show interfaces status
show vlan brief
show interfaces trunk
show ip interface brief
show ip route
show ip ospf neighbor
show access-lists
ping
traceroute

Lab Completion Checklist

  • Every interface has the correct address and mask.
  • Every active interface is operational.
  • VLANs exist on all required switches.
  • Trunks carry the required VLANs.
  • Default gateways are correct.
  • Routing tables contain all required networks.
  • Security controls are verified rather than assumed.
  • Configurations are saved after testing.
Router# copy running-config startup-config

8. Final CCNA Quiz

1. Which device forwards traffic between IP networks?



2. Which address does a Layer 2 switch learn?



3. How many conventional usable hosts does /26 provide?



4. Which protocol replaces ARP in IPv6?



5. What carries multiple VLANs?



6. What prevents Layer 2 loops?



7. Which OSPF metric is preferred?



8. What does PAT use to distinguish sessions?



9. What does DHCP provide?



10. What does AAA mean?



11. What is the purpose of an ACL?



12. Which protocol is preferred for secure CLI access?



13. What does a REST GET request usually do?



14. What does a VRF provide?



15. Which protocol synchronizes device clocks?



9. CCNA Glossary

Term Simple definition
ACLOrdered rules that permit or deny traffic.
ARPMaps an IPv4 address to a MAC address.
Area 0OSPF backbone area.
Broadcast domainDevices that receive a Layer 2 broadcast.
CAPWAPProtocol used between lightweight APs and controllers.
DHCPAutomatically supplies IP configuration.
DNSMaps names to IP addresses.
EtherChannelCombines physical links into one logical link.
FCSFrame Check Sequence used to detect errors.
IPv432-bit IP addressing protocol.
IPv6128-bit IP addressing protocol.
LACPStandards-based EtherChannel negotiation protocol.
MAC addressLayer 2 hardware address of an interface.
NATTranslates one IP address into another.
NTPSynchronizes device clocks.
OSPFLink-state interior gateway routing protocol.
PATAllows many private hosts to share one public address.
PoEPower and data over one Ethernet cable.
PortFastPlaces trusted endpoint ports into forwarding quickly.
RADIUSCentralized authentication and authorization service.
RouterForwards packets between IP networks.
SNMPMonitors and manages network devices.
SSHEncrypted remote command-line access.
STPPrevents Layer 2 switching loops.
SyslogCentralized device event logging.
TrunkLink carrying multiple VLANs.
VLANLogical Layer 2 broadcast domain.
VRFSeparate logical routing and forwarding table.
WLANWireless local area network.

Study Plan

  1. Read one domain and summarize it without looking at the page.
  2. Build the related Packet Tracer lab.
  3. Verify every command and record the output.
  4. Complete the review questions.
  5. Repeat weak topics until you can explain them simply.
  6. Use Cisco's current official exam topics to confirm scope.
This is an independent study guide, not an official Cisco training course or a guarantee of exam success. Confirm current objectives, exam policies and product commands using Cisco's official documentation.