F Routing Concepts You Must Master (CCNA / CCNP) - The Network DNA: Networking, Cloud, and Security Technology Blog

Routing Concepts You Must Master (CCNA / CCNP)

Home Routing & Switching Routing Concepts CCNA/CCNP

CCNA / CCNP EXAM PREP

From administrative distance and static routes to OSPF, EIGRP, BGP, route redistribution, and IPv6 — every routing concept that defines the CCNA and CCNP exams, explained with real-world context and Cisco IOS commands.

 Updated 2025 ⏱ 18-min read  Full IOS Command Reference

Routing Concepts You Must Master (CCNA / CCNP)

If switching is the foundation of a campus network, routing is its nervous system. Routing determines how data finds its path across networks — between buildings, across the internet, between cloud regions, and between autonomous systems operated by different organizations. Every packet you have ever sent has been forwarded by routers making decisions based on the concepts in this guide.

Both the CCNA (200-301) and CCNP ENCOR (350-401) exams test routing deeply and repeatedly. OSPF alone accounts for a significant portion of both exams. Understanding routing at this level also separates engineers who can troubleshoot production outages from those who cannot. This guide covers everything — from the routing table fundamentals to the nuances of BGP path selection.

1. Routing Fundamentals — How Routers Work

A router is a Layer 3 device that forwards packets between different networks based on their destination IP address. Unlike a switch that operates within a single broadcast domain, a router connects separate networks and makes intelligent forwarding decisions by consulting its routing table.

 HOW A ROUTER PROCESSES A PACKET

PACKET ARRIVES
Ingress interface
DEST IP LOOKUP
Routing table (LPM)
ARP NEXT-HOP
Resolve L2 address
REWRITE & FORWARD
New L2 header, TTL-1

Three critical concepts define how a router chooses its forwarding path:

  • Longest Prefix Match (LPM): When multiple routing table entries match a destination, the router always chooses the most specific one — the entry with the longest subnet mask. A /28 match beats a /24 match, which beats a /0 default route.
  • Recursive Route Lookup: If the routing table entry points to a next-hop IP (rather than a directly connected interface), the router must do a second lookup to find which interface to use to reach that next-hop — a recursive lookup.
  • CEF (Cisco Express Forwarding): In production, routers use a hardware-accelerated FIB (Forwarding Information Base) and Adjacency Table pre-built from the routing table, so every packet is forwarded at line rate without a full routing table lookup per packet.

2. Administrative Distance & the Routing Table

Administrative Distance (AD) is a value from 0–255 that represents the trustworthiness of a routing source. When two different routing protocols both have a route to the same destination, the router installs the route from the source with the lower AD into the routing table. AD is used to choose between sources; metric is used to choose between paths within the same source.

Route Source AD Value Routing Table Code
Connected Interface 0 C
Static Route 1 S
EIGRP Summary Route 5 D EX
eBGP 20 B
EIGRP (Internal) 90 D
OSPF 110 O
IS-IS 115 i
RIP 120 R
EIGRP (External) 170 D EX
iBGP 200 B

⚠ Exam Trap: AD is a local value — it is never advertised to other routers. A floating static route uses a manually increased AD (e.g., ip route 0.0.0.0 0.0.0.0 10.0.0.1 250) so it only enters the routing table when the preferred dynamic route disappears.

3. Static Routing — Types & Use Cases

Static routes are manually configured entries in the routing table. They do not adapt to topology changes but offer the lowest overhead, highest predictability, and precise control. Static routes are indispensable for stub networks, default route injection, and floating backup paths.

Standard Static

Route to a specific network via a next-hop IP or exit interface. The backbone of WAN stub connections and simple topologies.

Default Route (Gateway of Last Resort)

0.0.0.0/0 — matches any destination not in the routing table. Used to send all unmatched traffic to the ISP or edge router.

Floating Static Route

A static route with a manually raised AD (above the dynamic protocol's AD). Stays hidden until the primary dynamic route disappears — a cost-effective backup path.

Null0 Route (Black-hole)

Routes traffic to the Null0 interface — packets are silently dropped. Used to aggregate summarization and prevent routing loops when advertising summary routes.

! Standard static route (next-hop IP)
Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2

! Standard static route (exit interface — point-to-point only)
Router(config)# ip route 192.168.20.0 255.255.255.0 Serial0/0

! Default route — send all unmatched traffic to ISP
Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1

! Floating static (AD 130 beats OSPF 110 only when OSPF route gone)
Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.3 130

! Null0 aggregate (prevents routing loops for summary 172.16.0.0/16)
Router(config)# ip route 172.16.0.0 255.255.0.0 Null0

! Verify routing table
Router# show ip route static
Router# show ip route 192.168.20.0

4. OSPF — Open Shortest Path First

OSPF (RFC 2328) is a link-state IGP that builds a complete map of the network topology using Link State Advertisements (LSAs), runs Dijkstra's SPF algorithm independently on every router, and converges significantly faster than distance-vector protocols. OSPF is the most heavily tested routing protocol on both CCNA and CCNP exams.

OSPF Neighbor Formation Requirements

Before OSPF routers exchange LSAs, they must form a Full adjacency. The following parameters must match on both sides of the link:

Hello/Dead Timers

Default: 10s/40s (broadcast) | 30s/120s (NBMA)

Area ID

Must be the same area on both interfaces

Authentication

Key & password must match if configured

Subnet & Mask

Must be on the same subnet

Area Type

Stub/NSSA flags must match

MTU

MTU mismatch causes stuck in Exstart/Exchange

OSPF Area Types

Area Type Allows Type 5 LSAs? Allows Type 3 LSAs? Use Case
Backbone (Area 0) ✔ Yes ✔ Yes Core — all areas must connect here
Standard ✔ Yes ✔ Yes General-purpose non-backbone area
Stub ✘ No ✔ Yes Branch — default route replaces external routes
Totally Stub ✘ No ✘ No Smallest routing table — one default route only
NSSA Type 7 only ✔ Yes Branch with local ASBR redistributing external routes

OSPF Configuration (Multi-Area)

! Enable OSPF process 1 with explicit Router-ID
Router(config)# router ospf 1
Router(config-router)# router-id 1.1.1.1

! Advertise networks into specific areas
Router(config-router)# network 192.168.100.0 0.0.0.255 area 0
Router(config-router)# network 192.168.11.0 0.0.0.255 area 1
Router(config-router)# network 1.1.1.1 0.0.0.0 area 0

! Passive interface — stop sending hellos on LAN segments
Router(config-router)# passive-interface GigabitEthernet0/1

! Configure interface priority for DR/BDR election (0 = never DR)
Router(config-if)# ip ospf priority 200

! Tune OSPF cost on interface (lower = preferred)
Router(config-if)# ip ospf cost 10

! Configure a Stub area (on ABR and all routers in the area)
Router(config-router)# area 1 stub
! Totally Stub — add no-summary on ABR only
Router(config-router)# area 1 stub no-summary

! Virtual link through Area 1 transit (connect Area 2 to backbone)
Router(config-router)# area 1 virtual-link 2.2.2.2

! Authentication (MD5)
Router(config-if)# ip ospf message-digest-key 1 md5 OSPFPASS
Router(config-if)# ip ospf authentication message-digest

! Verification
Router# show ip ospf neighbor
Router# show ip ospf database
Router# show ip route ospf

5. EIGRP — Enhanced Interior Gateway Routing Protocol

EIGRP is Cisco's advanced distance-vector protocol (sometimes called "hybrid" because it incorporates link-state characteristics). It offers fast convergence through the DUAL (Diffusing Update Algorithm), unequal-cost load balancing, and bounded updates (only sends updates when topology changes, and only to affected neighbors — not the entire network). EIGRP uses its own transport (RTP — Reliable Transport Protocol) and hello packets for neighbor discovery.

EIGRP Metric — Composite Formula

EIGRP Metric = 256 × (K1×Bandwidth + K3×Delay)

Default: K1=1, K2=0, K3=1, K4=0, K5=0

Bandwidth = 107 / (minimum bandwidth in kbps along path)
Delay = sum of all interface delays in tens of microseconds (÷10)

DUAL — Successor & Feasible Successor

Successor

The best path to a destination — lowest Feasible Distance (FD). Installed in the routing table. Can have multiple equal-cost successors for load balancing.

Feasible Successor

A backup path that satisfies the Feasibility Condition: the neighbor's Reported Distance (RD) must be less than the current Feasible Distance (FD). Instantly promoted to Successor if primary fails — this is why EIGRP converges in milliseconds.

! Classic EIGRP (AS number must match all routers)
Router(config)# router eigrp 100
Router(config-router)# network 192.168.1.0 0.0.0.255
Router(config-router)# network 10.0.0.0 0.255.255.255
Router(config-router)# no auto-summary

! Named EIGRP (modern, recommended for CCNP)
Router(config)# router eigrp CORP
Router(config-router)# address-family ipv4 unicast autonomous-system 100
Router(config-router-af)# network 192.168.1.0 0.0.0.255
Router(config-router-af)# eigrp router-id 1.1.1.1

! Unequal-cost load balancing (variance multiplier)
! Routes with FD ≤ successor FD × variance get installed
Router(config-router)# variance 2

! Stub router — only advertises connected/summary routes
Router(config-router)# eigrp stub connected summary

! Manual summarization on interface
Router(config-if)# ip summary-address eigrp 100 172.16.0.0 255.255.0.0

! Verification
Router# show ip eigrp neighbors
Router# show ip eigrp topology
Router# show ip eigrp topology all-links

6. BGP — Border Gateway Protocol Fundamentals

BGP (RFC 4271) is the routing protocol of the internet — an Exterior Gateway Protocol (EGP) that routes between Autonomous Systems (AS). Unlike IGPs, BGP is a path-vector protocol that makes routing decisions based on policies and path attributes rather than metrics alone. BGP runs over TCP port 179, making neighbor sessions reliable but requiring explicit neighbor configuration (BGP does not use multicast discovery).

iBGP vs eBGP

iBGP — Internal BGP

Peers within the same AS. AD = 200. Does not change the next-hop by default. Requires full mesh between all iBGP speakers (or use Route Reflectors/Confederations to scale). Does not increment the AS_PATH.

eBGP — External BGP

Peers in different ASes. AD = 20. Modifies next-hop to itself by default. Appends its own AS to the AS_PATH. Default TTL = 1 (peers must be directly connected, unless eBGP multihop is configured).

BGP Best Path Selection (in order)

Remember: "We Love Oranges AS Oranges Mean Pure Refreshment"

1 Weight — Cisco proprietary, local to router, higher is better (default 0)
2 Local Preference — higher is better (default 100), shared within AS via iBGP
3 Originate — locally originated route preferred (next-hop 0.0.0.0)
4 AS_PATH length — shorter is better (used to influence inbound traffic)
5 Origin code — IGP (i) < EGP (e) < Incomplete (?)
6 MED (Multi-Exit Discriminator) — lower is better, influences inbound from neighbor AS
7 Peer type — eBGP preferred over iBGP
8 Router ID — lowest BGP Router-ID wins as tiebreaker
! Configure eBGP peer (AS 65001 peering with AS 65002)
Router(config)# router bgp 65001
Router(config-router)# bgp router-id 1.1.1.1
Router(config-router)# neighbor 203.0.113.2 remote-as 65002
Router(config-router)# neighbor 203.0.113.2 description ISP-PEER

! Advertise a network into BGP
Router(config-router)# network 198.51.100.0 mask 255.255.255.0

! Configure iBGP peer (same AS — use loopback)
Router(config-router)# neighbor 2.2.2.2 remote-as 65001
Router(config-router)# neighbor 2.2.2.2 update-source Loopback0
Router(config-router)# neighbor 2.2.2.2 next-hop-self

! Route Reflector — allow iBGP route reflection
Router(config-router)# neighbor 3.3.3.3 route-reflector-client

! Influence outbound with Local Preference (prefer AS 65002 exit)
Router(config-router)# neighbor 203.0.113.2 route-map SET-LOCPREF in
Router(config)# route-map SET-LOCPREF permit 10
Router(config-route-map)# set local-preference 200

! Verification
Router# show bgp ipv4 unicast summary
Router# show bgp ipv4 unicast 198.51.100.0
Router# show bgp ipv4 unicast neighbors 203.0.113.2 advertised-routes

7. Route Redistribution

Route redistribution injects routes learned by one routing protocol into another. It is essential in multi-protocol networks — during migrations, in multi-vendor environments, or when different parts of the network run different IGPs. Redistribution always requires careful attention to prevent routing loops and suboptimal paths — especially bidirectional redistribution between two protocols.

⚠ Critical Warning — Redistribution Loop Prevention: When redistributing bidirectionally between OSPF and EIGRP on multiple boundary routers, you must use route tags, prefix-lists, or distribute-lists to prevent routes learned via redistribution from being re-redistributed back into the originating protocol — creating phantom routes and routing loops.

! Redistribute OSPF routes into EIGRP
Router(config)# router eigrp 100
Router(config-router)# redistribute ospf 1 metric 10000 100 255 1 1500
! metric = bandwidth delay reliability load MTU (must be set manually)

! Redistribute EIGRP routes into OSPF
Router(config)# router ospf 1
Router(config-router)# redistribute eigrp 100 subnets metric 20 metric-type E2
! "subnets" keyword is required to include classless routes

! Redistribute static routes into OSPF
Router(config)# router ospf 1
Router(config-router)# redistribute static subnets

! Redistribute connected networks into BGP
Router(config)# router bgp 65001
Router(config-router)# redistribute connected

! Use route tags to prevent loops (tag OSPF routes when redistributing to EIGRP)
Router(config)# route-map OSPF-TO-EIGRP permit 10
Router(config-route-map)# match ip address prefix-list OSPF-NETS
Router(config-route-map)# set tag 110

! Block tagged routes from being re-redistributed back
Router(config)# route-map EIGRP-TO-OSPF deny 5
Router(config-route-map)# match tag 110

8. Route Summarization & Supernetting

Route summarization (also called route aggregation or supernetting) combines multiple specific routes into a single summarized advertisement, reducing routing table size, decreasing LSA/update flooding, and isolating topology instability behind the summarizing router.

How to calculate a summary address:

Networks to summarize:

172.16.0.0/24 → 10101100.00010000.00000000.xxxxxxxx

172.16.1.0/24 → 10101100.00010000.00000001.xxxxxxxx

172.16.2.0/24 → 10101100.00010000.00000010.xxxxxxxx

172.16.3.0/24 → 10101100.00010000.00000011.xxxxxxxx

Common bits = 22 → Summary: 172.16.0.0/22

! OSPF area range summarization (on ABR — Area 1 → Area 0)
Router(config)# router ospf 1
Router(config-router)# area 1 range 172.16.0.0 255.255.252.0

! OSPF external summarization (on ASBR — redistributed routes)
Router(config-router)# summary-address 172.16.0.0 255.255.252.0

! EIGRP manual summarization (on the interface toward neighbors)
Router(config-if)# ip summary-address eigrp 100 172.16.0.0 255.255.252.0

! BGP aggregate address
Router(config-router)# aggregate-address 172.16.0.0 255.255.252.0 summary-only
! "summary-only" suppresses more-specific routes from being advertised

9. Policy-Based Routing (PBR)

Policy-Based Routing (PBR) allows a router to make forwarding decisions based on criteria other than the destination IP address — such as source IP, protocol, port, DSCP marking, or packet length. PBR overrides the normal routing table lookup for matching traffic. Common uses include routing VoIP traffic through a low-latency path, sending specific users through a separate ISP link, or directing management traffic through a dedicated path.

! PBR — Route VLAN 100 traffic out ISP-1, all others out ISP-2

! Step 1: Create ACL to match traffic
Router(config)# ip access-list standard VLAN100-TRAFFIC
Router(config-std-nacl)# permit 192.168.100.0 0.0.0.255

! Step 2: Create route-map with set next-hop action
Router(config)# route-map PBR-POLICY permit 10
Router(config-route-map)# match ip address VLAN100-TRAFFIC
Router(config-route-map)# set ip next-hop 203.0.113.1

! Step 3: Apply route-map to INGRESS interface
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip policy route-map PBR-POLICY

! Verify
Router# show route-map PBR-POLICY
Router# debug ip policy

10. IPv6 Routing — OSPFv3, EIGRPv6 & Static

IPv6 routing works on the same principles as IPv4 but with 128-bit addressing, different address types (Global Unicast, Link-Local, Unique Local), and updated protocol implementations. OSPFv3 supports IPv6 natively and can now also run IPv4 using address families. EIGRPv6 (or Named EIGRP with IPv6 AF) provides fast convergence for IPv6 networks. The key operational difference is that IPv6 routers use Link-Local addresses as next-hops — not global unicast addresses.

! Enable IPv6 routing
Router(config)# ipv6 unicast-routing

! IPv6 static routes
Router(config)# ipv6 route 2001:db8:2::/48 2001:db8:1::2
Router(config)# ipv6 route ::/0 2001:db8:1::1  ! Default route

! OSPFv3 — interface-based configuration
Router(config)# ipv6 router ospf 1
Router(config-rtr)# router-id 1.1.1.1

Router(config)# interface GigabitEthernet0/0
Router(config-if)# ipv6 ospf 1 area 0

! EIGRPv6 — Named EIGRP (modern method)
Router(config)# router eigrp CORP
Router(config-router)# address-family ipv6 unicast autonomous-system 100
Router(config-router-af)# eigrp router-id 1.1.1.1

! Verify IPv6 routing
Router# show ipv6 route
Router# show ipv6 ospf neighbor
Router# show ipv6 eigrp neighbors

11. Exam Tips & Quick-Reference Table

Topic Key Fact / Number Exam Trap
OSPF Hello/Dead (Broadcast) Hello=10s, Dead=40s (4× Hello) NBMA: Hello=30s, Dead=120s
OSPF DR/BDR Election Highest priority wins; tie = highest RID Priority 0 = never DR; election is non-preemptive
OSPF Cost Formula Cost = Reference BW / Interface BW Default Ref BW = 100 Mbps — 1G and 10G both show cost=1 unless adjusted
EIGRP AS Number Must match on all routers in the same domain EIGRP AS ≠ BGP AS — completely different use
EIGRP Unequal-Cost LB Requires variance command + Feasibility Condition Only Feasible Successors qualify — not just any backup route
BGP TCP Port TCP 179 — BGP uses TCP (reliable delivery) BGP does NOT use multicast — neighbors must be explicit
BGP iBGP next-hop iBGP does NOT change next-hop by default Use next-hop-self on iBGP peers or routes become unreachable
OSPF Redistribution Always use subnets keyword Without subnets, only classful networks are redistributed
Floating Static AD Must be higher than the primary protocol's AD Backup for OSPF (110): use AD 111–254. Backup for EIGRP (90): use AD 91–254
PBR Application Point Applied on ingress interface of incoming traffic PBR is applied inbound — not outbound like access-lists on routing

 Master Checklist — Before Your CCNA/CCNP Exam

☑ Explain Longest Prefix Match with an example

☑ Recite all AD values from memory

☑ Configure static, default & floating routes from CLI

☑ Configure multi-area OSPF with DR/BDR control

☑ Explain OSPF area types and when to use each

☑ Identify Successor vs Feasible Successor in EIGRP topology table

☑ Configure EIGRP variance for unequal-cost load balancing

☑ Recite BGP best-path selection order (W-L-O-AS-O-M-P-R)

☑ Explain iBGP next-hop-self and when it is needed

☑ Redistribute OSPF into EIGRP and back with loop prevention

☑ Calculate a summary address for any group of subnets

☑ Configure PBR to route traffic based on source IP


Tags

CCNA CCNP Routing OSPF EIGRP BGP Static Routing Route Redistribution Administrative Distance Route Summarization Policy-Based Routing IPv6 Routing Cisco IOS DUAL Algorithm