All exams← All Cisco CCNA Practice notes

IP connectivity & routing: Cisco CCNA Practice revision notes

Revision notes

How routers forward packets

Every router builds a routing table from three sources: directly connected routes, static routes you configure by hand, and dynamic routes learned via a routing protocol. When a packet arrives, the router does a longest prefix match - it picks the route with the most specific (longest) matching subnet mask, not just the first match it finds. If there is no match at all and no default route (0.0.0.0/0), the packet is dropped and the router should send back an ICMP destination unreachable message.

Administrative distance - who do you trust

When two different sources offer a route to the same destination, the router picks the one with the lowest administrative distance (AD). Learn these: connected = 0, static = 1, EIGRP internal = 90, OSPF = 110, RIP = 120, and anything unreachable/unknown = 255 (never installed). A common exam trap: metric only breaks ties WITHIN the same protocol - AD decides between protocols first.

Static vs dynamic routing

Static routes are simple, predictable and use zero CPU/bandwidth for calculation, but do not adapt if the network changes - you must edit them manually. Dynamic routing protocols (OSPF, EIGRP, RIP) automatically discover and adapt to topology changes but add complexity and overhead. A default static route (ip route 0.0.0.0 0.0.0.0 <next-hop>) is the classic 'gateway of last resort' used on stub networks like a small branch office.

OSPF essentials

OSPF is a link-state protocol using Dijkstra's SPF algorithm, AD 110, and cost as its metric (cost = reference bandwidth ÷ interface bandwidth, default reference 100 Mbps on older IOS). Routers become neighbours by exchanging Hello packets (default 10s on broadcast links, 30s on NBMA) and must agree on: area ID, subnet mask, hello/dead timers, and authentication type. Area 0 is always the backbone - every other area must connect back to it, directly or via a virtual link.

Inter-VLAN routing and gateways

Devices in different VLANs cannot talk without a router or Layer 3 switch. Router-on-a-stick uses one physical interface split into sub-interfaces (each tagged with dot1Q encapsulation for its VLAN) - cheap but limited by the single link's bandwidth. A Layer 3 switch with SVIs (switched virtual interfaces) is the enterprise standard - faster and scales better.

Common mistakes to avoid

  • Confusing administrative distance (trust between protocols) with metric (best path within a protocol).
  • Forgetting that longest prefix match always wins over a shorter, less specific route - even a static route.
  • Mixing up classful summarisation with proper subnetting - CCNA expects VLSM, not old classful thinking.
  • Forgetting the default route needs a valid, reachable next-hop or exit interface, or it will not install.
  • Assuming a routing protocol is enabled just by turning it on - networks/interfaces must be explicitly advertised (e.g. network statements in OSPF).

Key facts

Flashcards

What does a router do when two routes to the same destination come from different protocols?
It compares administrative distance and installs the route from the source with the lowest AD.
tap to reveal
What is the administrative distance of a directly connected route?
0 - the most trusted source, always preferred.
tap to reveal
What is the administrative distance of a static route?
1.
tap to reveal
What is OSPF's administrative distance?
110.
tap to reveal
What is RIP's administrative distance?
120.
tap to reveal
What happens when a router has two routes with different prefix lengths that both match the destination?
It always chooses the route with the longest (most specific) prefix match, regardless of AD or metric.
tap to reveal
How do you configure a default static route on a Cisco router?
ip route 0.0.0.0 0.0.0.0 <next-hop-ip-or-exit-interface>
tap to reveal
What algorithm does OSPF use to calculate best paths?
Dijkstra's Shortest Path First (SPF) algorithm.
tap to reveal
What four things must OSPF neighbours agree on to form an adjacency?
Area ID, subnet mask, hello/dead timers, and authentication type.
tap to reveal
What is the default OSPF Hello interval on a broadcast link?
10 seconds (dead interval is 40 seconds, 4x hello).
tap to reveal
Why is OSPF Area 0 special?
It is the mandatory backbone area - every other area must connect to it directly or via a virtual link.
tap to reveal
What is router-on-a-stick and what must each sub-interface have?
Using one physical interface with multiple VLAN sub-interfaces for inter-VLAN routing; each sub-interface needs encapsulation dot1Q <vlan-id>.
tap to reveal
What is an SVI and why is it preferred over router-on-a-stick?
A Switched Virtual Interface on a Layer 3 switch (interface vlan X) - preferred because it is not bandwidth-limited by a single trunk link.
tap to reveal
What happens if a packet has no matching route and no default route exists?
The router drops the packet and should send back an ICMP destination unreachable message.
tap to reveal
How is OSPF cost calculated?
Reference bandwidth divided by interface bandwidth - lower cost is more preferred.
tap to reveal
Practice questions

IP connectivity & routing: 5 practice questions

Q1. A router receives a packet destined for 192.168.10.55. Its routing table contains routes to 192.168.10.0/24 and 192.168.10.0/28. Which route does the router use to forward the packet?
  • A.  The 192.168.10.0/28 route, because it is the more specific (longest) match
  • B.  The router drops the packet because of the overlapping routes
  • C.  Both routes are installed and the router load-balances between them
  • D.  The 192.168.10.0/24 route, because it was learned first
Show answer & explanation
✓ Answer: A. The 192.168.10.0/28 route, because it is the more specific (longest) match
Routers always forward using the longest prefix match, not the first route learned. A /28 mask is more specific than a /24, so if the destination falls within the /28 range it wins even though the /24 also matches. Overlapping routes are normal and do not cause a drop.
Q2. What is the primary purpose of the Time to Live (TTL) field in an IPv4 header?
  • A.  To encrypt the packet contents during transit
  • B.  To indicate the priority of the packet for QoS queuing
  • C.  To prevent packets from looping indefinitely in the network
  • D.  To specify how long a device may cache the packet's payload
Show answer & explanation
✓ Answer: C. To prevent packets from looping indefinitely in the network
TTL is decremented by one at each router hop, and when it reaches zero the packet is discarded and an ICMP Time Exceeded message is sent back. This stops routing loops from circulating packets forever. It has nothing to do with caching, QoS marking, or encryption.
Q3. Which statement correctly describes the administrative distance (AD) of a static route on a Cisco router by default?
  • A.  0
  • B.  120
  • C.  1
  • D.  90
Show answer & explanation
✓ Answer: C. 1
A standard static route has a default administrative distance of 1, making it more trusted than any dynamic routing protocol but less trusted than a directly connected route (AD 0). AD 90 is EIGRP internal and AD 120 is RIP, so those describe different sources entirely.
Q4. An engineer configures 'ip route 0.0.0.0 0.0.0.0 203.0.113.1' on an edge router. What does this command create?
  • A.  A floating static route with an administrative distance of 254
  • B.  A summarised route covering the entire 203.0.113.0/24 subnet
  • C.  A static host route to 203.0.113.1 only
  • D.  A default route sending unmatched traffic to next hop 203.0.113.1
Show answer & explanation
✓ Answer: D. A default route sending unmatched traffic to next hop 203.0.113.1
The 0.0.0.0 0.0.0.0 mask matches every destination address, so this is the classic default (gateway of last resort) route pointing all otherwise-unmatched traffic to 203.0.113.1. It is not a host route, a /24 summary, nor does it carry a non-default AD unless one is explicitly appended.
Q5. Which two pieces of information does a router use together to determine the best path when multiple routing protocols advertise a route to the same destination network? (Select the single correct pairing from the options below.)
  • A.  Administrative distance first, then metric if AD is equal
  • B.  Metric first, then administrative distance if metric is equal
  • C.  Prefix length only, ignoring both AD and metric
  • D.  Route age only, preferring the most recently learned route
Show answer & explanation
✓ Answer: A. Administrative distance first, then metric if AD is equal
When routes to the same prefix come from different sources, the router first compares administrative distance and installs the route with the lowest AD; metric is only used to break a tie between routes from the same protocol. Prefix length matters for longest-match between different destination networks, not for choosing among routes to the identical prefix.
Test yourself
See the Cisco CCNA Practice page

More Cisco CCNA Practice topics