IP Connectivity Study Guide
CCNA 200-301 Exam Domain 3 (25% of exam)
1. Routing Concepts
Routing is the process of selecting the best path for network traffic to travel from source to destination across multiple networks. Routers operate at Layer 3 (Network Layer) and use IP addresses to make forwarding decisions.
Key Concept: A router's primary job is to receive packets on one interface and forward them out another interface toward the destination. This decision is based on the routing table.
How Routers Work
- Receive packet on ingress interface
- Examine destination IP in packet header
- Lookup in routing table for matching route
- Determine exit interface and next-hop
- Rewrite Layer 2 header (new source/dest MAC)
- Forward packet out egress interface
Routing Decision Process:
Packet arrives: Dest IP = 10.2.3.100
|
v
+-------------------+
| Routing Table |
+-------------------+
| 10.1.0.0/16 -> Gi0/0
| 10.2.0.0/16 -> Gi0/1 <-- Match!
| 10.3.0.0/16 -> Gi0/2
| 0.0.0.0/0 -> Gi0/3
+-------------------+
|
v
Forward out Gi0/1 toward 10.2.0.0/16
Packet vs Frame
| Characteristic |
Packet (Layer 3) |
Frame (Layer 2) |
| Addressing |
IP addresses |
MAC addresses |
| Scope |
End-to-end (unchanged) |
Hop-to-hop (changes at each router) |
| Device |
Router |
Switch |
When a router forwards a packet, the IP header (source/destination IP) stays the same, but the Ethernet frame header (source/destination MAC) changes at each hop.
2. The Routing Table
The routing table contains all known networks and how to reach them. Routes can be learned through different methods.
Route Sources
| Code |
Source |
Description |
| C |
Connected |
Directly connected networks (interfaces with IP) |
| L |
Local |
IP address assigned to router's interface (/32) |
| S |
Static |
Manually configured routes |
| O |
OSPF |
Learned via OSPF protocol |
| D |
EIGRP |
Learned via EIGRP protocol |
| R |
RIP |
Learned via RIP protocol |
| B |
BGP |
Learned via BGP protocol |
| S* |
Static Default |
Default route (0.0.0.0/0) configured statically |
Reading the Routing Table
Router# show ip route
Codes: C - connected, S - static, O - OSPF, D - EIGRP
L - local, B - BGP, * - candidate default
Gateway of last resort is 10.0.0.1 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.1.0/24 is directly connected, GigabitEthernet0/0
L 10.1.1.1/32 is directly connected, GigabitEthernet0/0
S 10.2.0.0/16 [1/0] via 10.1.1.254
O 10.3.3.0/24 [110/20] via 10.1.1.2, 00:05:32, GigabitEthernet0/0
S* 0.0.0.0/0 [1/0] via 10.0.0.1
Understanding Route Entries
Route Entry Breakdown:
O 10.3.3.0/24 [110/20] via 10.1.1.2, 00:05:32, Gi0/0
| | | | | | |
| | | | | | +-- Exit interface
| | | | | +----------- Uptime
| | | | +---------------------- Next-hop IP
| | | +------------------------------ Metric
| | +---------------------------------- Administrative Distance
| +-------------------------------------------- Network/Prefix
+------------------------------------------------------ Route source (OSPF)
Administrative Distance (AD)
AD is the trustworthiness of a routing source. Lower AD = more trusted. When multiple routing sources know a route, the one with lowest AD wins.
| Route Source |
Default AD |
| Connected |
0 |
| Static |
1 |
| EIGRP Summary |
5 |
| eBGP |
20 |
| EIGRP (Internal) |
90 |
| OSPF |
110 |
| IS-IS |
115 |
| RIP |
120 |
| EIGRP (External) |
170 |
| iBGP |
200 |
| Unknown |
255 (unusable) |
Longest Prefix Match: When multiple routes match a destination, the router uses the route with the longest (most specific) prefix. Example: 10.1.1.0/24 beats 10.1.0.0/16 for destination 10.1.1.50.
Memorize the common AD values: Connected=0, Static=1, EIGRP=90, OSPF=110, RIP=120. These are frequently tested!
3. Static Routing
Static routes are manually configured by an administrator. They don't change unless manually modified, making them simple but not scalable for large networks.
When to Use Static Routes
- Small networks with few routes
- Stub networks with only one exit path
- Default route to the internet
- Backup routes (floating static)
- Security - full control over routing
Static Route Syntax
Router(config)# ip route [destination-network] [subnet-mask] [next-hop-ip | exit-interface]
Router(config)# ip route 192.168.2.0 255.255.255.0 10.1.1.2
Router(config)# ip route 192.168.2.0 255.255.255.0 GigabitEthernet0/1
Router(config)# ip route 192.168.2.0 255.255.255.0 GigabitEthernet0/1 10.1.1.2
Router# show ip route static
Types of Static Routes
Standard Static Route
Router(config)# ip route 172.16.0.0 255.255.0.0 10.0.0.2
Default Route (Gateway of Last Resort)
Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1
Router# show ip route
Floating Static Route (Backup Route)
Router(config)# ip route 10.2.0.0 255.255.0.0 10.1.1.254 130
Summary Route
Router(config)# ip route 10.1.0.0 255.255.252.0 10.0.0.2
IPv6 Static Routes
Router(config)# ipv6 unicast-routing
Router(config)# ipv6 route 2001:db8:2::/64 2001:db8:1::2
Router(config)# ipv6 route ::/0 2001:db8:1::1
Router(config)# ipv6 route 2001:db8:3::/64 GigabitEthernet0/0 fe80::1
When using link-local addresses as next-hop for IPv6, you must also specify the exit interface because link-local addresses are only unique per interface.
Static Routing Key Points
- AD = 1 by default (can be changed for floating static)
- 0.0.0.0/0 is the default route (catches all unmatched traffic)
- Floating static routes are backups with higher AD
- Fully specified routes use both next-hop and exit interface
- IPv6 link-local next-hop requires exit interface
4. Dynamic Routing Protocols
Dynamic routing protocols automatically discover and maintain routes. They adapt to network changes, making them essential for larger networks.
Types of Dynamic Routing Protocols
Dynamic Routing Protocols Classification:
Routing Protocols
|
+-----------------+-----------------+
| |
Interior (IGP) Exterior (EGP)
Within one AS Between AS's
| |
+-------+-------+ BGP
| |
Distance Vector Link State
| |
RIP, EIGRP OSPF, IS-IS
Distance Vector vs Link State
| Feature |
Distance Vector |
Link State |
| Information Shared |
Routing table (distances) |
Topology database (links) |
| Algorithm |
Bellman-Ford |
Dijkstra SPF |
| Network View |
Neighbor's perspective |
Complete topology |
| Convergence |
Slower |
Faster |
| CPU/Memory |
Lower |
Higher |
| Examples |
RIP, EIGRP* |
OSPF, IS-IS |
*EIGRP is technically an "advanced distance vector" or hybrid protocol
Routing Protocol Comparison
| Protocol |
Type |
Metric |
AD |
CCNA Focus |
| RIPv2 |
Distance Vector |
Hop count (max 15) |
120 |
Basic awareness |
| OSPF |
Link State |
Cost (bandwidth) |
110 |
Primary focus |
| EIGRP |
Advanced DV |
Composite (BW+delay) |
90/170 |
Basic awareness |
| BGP |
Path Vector |
Attributes |
20/200 |
Conceptual |
Metric: The value a routing protocol uses to determine the best path when multiple paths exist. Each protocol uses different metrics - OSPF uses cost, RIP uses hop count, EIGRP uses bandwidth and delay.
For CCNA, focus heavily on OSPF. Know the basics of RIP (hop count metric, max 15 hops) and EIGRP (bandwidth + delay metric, Cisco proprietary history) but deep configuration knowledge isn't required.
5. OSPF Single-Area
Open Shortest Path First (OSPF) is an open standard link-state routing protocol. It's the most commonly used IGP in enterprise networks.
OSPF Characteristics
- Link-state protocol - each router builds complete topology
- Uses Dijkstra SPF algorithm to calculate best paths
- Fast convergence - detects and reacts to changes quickly
- Classless - supports VLSM and CIDR
- Hierarchical design with areas (Area 0 is backbone)
- Uses cost as metric - based on interface bandwidth
- Administrative Distance = 110
OSPF Cost Calculation
OSPF Cost Formula:
Cost = Reference Bandwidth / Interface Bandwidth
Default Reference Bandwidth = 100 Mbps (10^8)
Examples:
- 10 Mbps: 100,000,000 / 10,000,000 = 10
- 100 Mbps: 100,000,000 / 100,000,000 = 1
- 1 Gbps: 100,000,000 / 1,000,000,000 = 0.1 → rounded to 1
- 10 Gbps: 100,000,000 / 10,000,000,000 = 0.01 → rounded to 1
Problem: With default reference, 100Mbps, 1Gbps, 10Gbps all have cost = 1!
The default reference bandwidth of 100 Mbps doesn't distinguish between modern high-speed links. Always change it to 10 Gbps (10000) or higher on all OSPF routers in your network.
Router(config)# router ospf 1
Router(config-router)# auto-cost reference-bandwidth 10000
OSPF Messages
| Type |
Name |
Purpose |
| 1 |
Hello |
Discover neighbors, maintain adjacencies |
| 2 |
Database Description (DBD) |
Summary of LSDB contents during initial sync |
| 3 |
Link-State Request (LSR) |
Request specific LSAs from neighbor |
| 4 |
Link-State Update (LSU) |
Contains actual LSAs (routing information) |
| 5 |
Link-State Acknowledgment (LSAck) |
Confirms receipt of LSU |
OSPF Multicast Addresses
| Address |
Name |
Used By |
| 224.0.0.5 |
AllSPFRouters |
All OSPF routers listen on this |
| 224.0.0.6 |
AllDRouters |
DR and BDR listen on this |
OSPF Timers
| Timer |
Broadcast/P2P |
NBMA |
Purpose |
| Hello |
10 seconds |
30 seconds |
Interval between Hello packets |
| Dead |
40 seconds |
120 seconds |
Time before declaring neighbor down |
Dead Interval: By default, the dead interval is 4x the hello interval. If no Hello is received within the dead interval, the neighbor is declared down and routes through it are removed.
OSPF neighbors must match: Area ID, Hello/Dead intervals, authentication, stub flags, and MTU. Network type affects Hello/Dead defaults.
6. OSPF Configuration
Basic OSPF Configuration
Router(config)# router ospf 1
Router(config-router)# router-id 1.1.1.1
Router(config-router)# network 10.1.1.0 0.0.0.255 area 0
Router(config-router)# network 192.168.1.0 0.0.0.255 area 0
Router(config)# interface gigabitethernet 0/0
Router(config-if)# ip ospf 1 area 0
Wildcard Mask: OSPF uses wildcard masks (inverse of subnet mask). 0 bits must match, 1 bits are "don't care". Example: 0.0.0.255 matches any IP where first 3 octets match exactly.
Router ID Selection
OSPF Router ID is chosen in this order:
- Manually configured router-id command
- Highest IP on any loopback interface
- Highest IP on any active physical interface
Router(config)# interface loopback 0
Router(config-if)# ip address 1.1.1.1 255.255.255.255
Router(config-if)# exit
Router(config)# router ospf 1
Router(config-router)# router-id 1.1.1.1
Router# clear ip ospf process
Passive Interfaces
Router(config-router)# passive-interface gigabitethernet 0/2
Router(config-router)# passive-interface default
Router(config-router)# no passive-interface gigabitethernet 0/0
Default Route Advertisement
Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1
Router(config)# router ospf 1
Router(config-router)# default-information originate
Router(config-router)# default-information originate always
Modifying OSPF Cost
Router(config)# interface gigabitethernet 0/0
Router(config-if)# ip ospf cost 50
Router(config-if)# bandwidth 100000
OSPF Verification Commands
Router# show ip ospf neighbor
Router# show ip ospf database
Router# show ip ospf interface
Router# show ip ospf interface brief
Router# show ip route ospf
Router# show ip ospf
Router# show ip ospf interface gigabitethernet 0/0
OSPFv3 for IPv6
Router(config)# ipv6 unicast-routing
Router(config)# interface gigabitethernet 0/0
Router(config-if)# ipv6 ospf 1 area 0
Router(config)# ipv6 router ospf 1
Router(config-rtr)# router-id 1.1.1.1
Router# show ipv6 ospf neighbor
Router# show ipv6 route ospf
7. OSPF Neighbor States & DR/BDR
OSPF Neighbor States
| State |
Description |
| Down |
No Hellos received from this neighbor |
| Init |
Hello received but own router-id not in neighbor's Hello |
| 2-Way |
Bidirectional communication confirmed; DR/BDR election occurs |
| ExStart |
Master/slave negotiation for DBD exchange |
| Exchange |
DBD packets exchanged describing LSDB contents |
| Loading |
LSR/LSU exchange to get missing LSAs |
| Full |
Fully adjacent; databases synchronized |
OSPF Neighbor State Progression:
Down → Init → 2-Way → ExStart → Exchange → Loading → Full
|
+-- DR/BDR election happens here
| (on multi-access networks)
|
+-- DROther routers stay at 2-Way with each other
(only go Full with DR/BDR)
DR/BDR Election
On multi-access networks (Ethernet), OSPF elects a Designated Router (DR) and Backup DR (BDR) to reduce flooding overhead.
Why DR/BDR? Without DR/BDR, every router would need a full adjacency with every other router on the segment. With 10 routers, that's 45 adjacencies! With DR/BDR, each router only needs 2 adjacencies (to DR and BDR).
DR/BDR Election Process
- Highest OSPF Priority wins (default = 1, range 0-255)
- Priority 0 = cannot be DR/BDR
- Highest Router ID is tiebreaker
- Election is non-preemptive - existing DR stays even if higher priority router joins
Router# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:32 10.1.1.2 Gi0/0
3.3.3.3 1 FULL/BDR 00:00:35 10.1.1.3 Gi0/0
4.4.4.4 1 2WAY/DROTHER 00:00:38 10.1.1.4 Gi0/0
Router(config)# interface gigabitethernet 0/0
Router(config-if)# ip ospf priority 100
Router(config-if)# ip ospf priority 0
OSPF Network Types
| Network Type |
DR/BDR? |
Hello |
Dead |
Example |
| Broadcast |
Yes |
10s |
40s |
Ethernet (default) |
| Point-to-Point |
No |
10s |
40s |
Serial links, P2P subinterfaces |
| NBMA |
Yes |
30s |
120s |
Frame Relay (legacy) |
| Point-to-Multipoint |
No |
30s |
120s |
Hub-and-spoke WAN |
Router(config-if)# ip ospf network point-to-point
On point-to-point links (like between two routers), changing network type to point-to-point skips DR/BDR election and reaches Full state faster.
8. First Hop Redundancy Protocols (FHRP)
FHRPs provide default gateway redundancy for hosts. If the primary router fails, another router takes over the virtual gateway IP seamlessly.
FHRP Concept:
Internet
|
+------+------+
| |
[Router A] [Router B]
10.1.1.2 10.1.1.3
Active Standby
| |
+------+------+
|
Virtual IP: 10.1.1.1 <-- Hosts use this as gateway
|
[Hosts]
If Router A fails, Router B takes over 10.1.1.1
Hosts don't need to change anything!
FHRP Comparison
| Feature |
HSRP |
VRRP |
GLBP |
| Standard |
Cisco proprietary |
IEEE (open) |
Cisco proprietary |
| Active Router |
Active |
Master |
AVG (Active Virtual Gateway) |
| Standby Router |
Standby |
Backup |
AVF (Active Virtual Forwarder) |
| Virtual MAC |
0000.0c07.acXX |
0000.5e00.01XX |
0007.b400.XXYY |
| Load Balancing |
Per-group only |
Per-group only |
Per-host (built-in) |
| Multicast |
224.0.0.2 (v1) / 224.0.0.102 (v2) |
224.0.0.18 |
224.0.0.102 |
HSRP Configuration
RouterA(config)# interface gigabitethernet 0/0
RouterA(config-if)# ip address 10.1.1.2 255.255.255.0
RouterA(config-if)# standby version 2
RouterA(config-if)# standby 1 ip 10.1.1.1
RouterA(config-if)# standby 1 priority 110
RouterA(config-if)# standby 1 preempt
RouterB(config)# interface gigabitethernet 0/0
RouterB(config-if)# ip address 10.1.1.3 255.255.255.0
RouterB(config-if)# standby version 2
RouterB(config-if)# standby 1 ip 10.1.1.1
RouterB(config-if)# standby 1 priority 100
RouterB(config-if)# standby 1 preempt
Router# show standby
Router# show standby brief
HSRP States
| State |
Description |
| Initial |
Starting state |
| Learn |
Waiting to hear from active router |
| Listen |
Knows virtual IP, listening for active/standby |
| Speak |
Participating in election |
| Standby |
Candidate to become next active router |
| Active |
Currently forwarding traffic for virtual IP |
HSRP Tracking
RouterA(config-if)# standby 1 track gigabitethernet 0/1 20
FHRP Key Points
- HSRP is Cisco proprietary; VRRP is open standard
- Higher priority = more likely to be active
- Preempt allows higher-priority router to take over
- Use tracking to respond to upstream failures
- GLBP provides true load balancing per-host
- Virtual IP is what hosts use as default gateway
Know the difference between HSRP (Cisco) and VRRP (standard). Remember: HSRP uses "Active/Standby" terminology while VRRP uses "Master/Backup". Default HSRP priority is 100.