Skip to content

Get the app

Study guide · Domain 3.0

IP Routing

20% of the exam · 4 exam topics

Domain 3 is how a router chooses where to send a packet: reading the routing table by longest prefix, administrative distance and metric, building and fixing IPv4 and IPv6 static routes, configuring single-area OSPFv2 and OSPFv3, and reading the status of HSRP and VRRP, which give hosts a gateway that survives a router failure.

A study feature written by ExamDragon, not part of the real exam. Each heading is one of this domain's 4 exam topics, as Cisco states it in the 200-301 CCNA v2.0 exam topics.

3.1Interpret a routing table to identify the next hop for a packet (routing protocol, prefix/mask, administrative distance, metric, and default route)

  • Each entry in show ip route shows the source code (C connected, L local, S static, D EIGRP, O OSPF, R RIP, B BGP), the prefix and mask, [administrative distance/metric], the next hop, the age and the exit interface.
  • A router picks the route in three steps: longest prefix match first, then the lowest administrative distance between routes to the same prefix and length, then the lowest metric inside one protocol.
  • Default administrative distances: connected 0, static 1, eBGP 20, internal EIGRP 90, OSPF 110, RIP 120, iBGP 200. A distance of 255 means the route is never used.
  • Metrics are protocol-specific: OSPF uses cumulative cost, EIGRP a composite of bandwidth and delay, RIP hop count. Metrics of different protocols are never compared.
  • Equal-cost paths appear as one prefix with several via lines; all are installed and the load is shared.
  • The default route (0.0.0.0/0, or ::/0 for IPv6) is marked with an asterisk and named as the gateway of last resort. It is used only when no more specific route matches; without one, unmatched packets are dropped.
  1. The situationR1 has O 10.1.0.0/16 [110/20], D 10.1.4.0/22 [90/3072] and S 10.1.5.0/24 [1/0]. A packet arrives for 10.1.6.9.
  2. Step 1List the routes whose range contains 10.1.6.9: 10.1.0.0/16 covers 10.1.0.0 to 10.1.255.255, 10.1.4.0/22 covers 10.1.4.0 to 10.1.7.255, 10.1.5.0/24 covers only 10.1.5.x.
  3. Step 2Keep the matches: the /16 and the /22 match, the /24 does not.
  4. Step 3Choose the longest prefix: the /22 wins, so the packet follows the EIGRP route.
  5. Where questions turnComparing administrative distance or metric before prefix length. A /24 static route and a /16 OSPF route are different routes, and the longer match wins whatever the source.
  6. The takeawayFind the matching ranges first and take the longest; administrative distance only matters between routes to the same prefix and length.
Practise 3.1

3.2Troubleshoot IPv4 and IPv6 static routing

  • Syntax: ip route <network> <mask> {next-hop | exit-interface [next-hop]} [distance] for IPv4, and ipv6 route <prefix/length> {next-hop | exit-interface [next-hop]} [distance] for IPv6, which also needs ipv6 unicast-routing.
  • Default route (3.2.a): ip route 0.0.0.0 0.0.0.0 <next-hop> or ipv6 route ::/0 <next-hop>. It appears as S* and becomes the gateway of last resort.
  • Network route (3.2.b): reaches a whole subnet, such as ip route 172.16.40.0 255.255.255.0 10.0.23.3. The network address must have no host bits set for the mask.
  • Host route (3.2.c): reaches one address with a /32 mask (255.255.255.255) or /128 in IPv6, and wins over shorter routes by longest prefix match.
  • Floating static (3.2.d): a backup route given an administrative distance higher than the route it backs up, for example 115 behind OSPF's 110. It stays out of the table until the primary route disappears.
  • Troubleshooting: a next-hop static route is installed only while the next hop is reachable; a down link withdraws it. A link-local IPv6 next hop must be given with its exit interface. Check the mask, the next hop and the distance against show ip route.
  1. The situationR1 learns a default route by OSPF and needs a backup default through 203.0.113.9 that is used only when the OSPF route is lost.
  2. Step 1Note the primary route's distance: an OSPF route has 110.
  3. Step 2Configure the backup above it: ip route 0.0.0.0 0.0.0.0 203.0.113.9 115.
  4. Step 3Confirm with show ip route that the default is still O*E2 [110/1] while the primary works, and that S* [115/0] appears when the OSPF route is removed.
  5. Where questions turnGiving a floating static a low distance such as 5, which is still below OSPF's 110 and EIGRP's 90, so the backup link carries all the traffic. Another common slip is a link-local IPv6 next hop without its interface.
  6. The takeawayA floating static route needs a distance higher than the dynamic route's; below it, the backup becomes the primary.
Practise 3.2

3.3Configure single area OSPFv2 for IPv4 and OSPFv3 for IPv6

  • OSPFv2 is enabled with router ospf <process-id> and network <address> <wildcard> area <id>, or per interface with ip ospf <process-id> area <id>. Single area means every interface is in area 0.
  • OSPFv3 is enabled per interface with ipv6 ospf <process-id> area <id> in interface configuration (the ipv6 router ospf <process-id> process holds settings such as router-id); it needs ipv6 unicast-routing and has no network command.
  • Router ID (3.3.d): the router-id command first, then the highest IPv4 address on an up loopback, then the highest IPv4 address on an active physical interface. OSPFv3 uses the same 32-bit ID, so a router without IPv4 addresses needs router-id set. A new ID takes effect after clear ip ospf process or a reload, and every router ID must be unique.
  • Neighbor adjacencies (3.3.a): neighbors must share the area, the hello and dead timers (10 and 40 seconds by default on Ethernet), the subnet and mask, and compatible network types, with unique router IDs. A matching MTU is needed to get past EXSTART and EXCHANGE to FULL.
  • Broadcast (3.3.c): the default type on Ethernet elects a DR and BDR by highest priority (default 1), then highest router ID. Priority 0 never becomes DR or BDR. The election is not preemptive: a better router joining later does not take over. DROTHERs stay in 2WAY with each other and are FULL with the DR and BDR.
  • Point-to-point (3.3.b): ip ospf network point-to-point on both ends of a two-router link removes the DR and BDR election; show ip ospf neighbor shows FULL/ -.
  1. The situationFour routers share a VLAN: R1 priority 1 ID 10.0.0.1, R2 priority 10 ID 10.0.0.2, R3 priority 0 ID 10.0.0.9, R4 priority 1 ID 10.0.0.4. All start together.
  2. Step 1Remove routers with priority 0: R3 cannot be elected despite the highest router ID.
  3. Step 2Pick the DR by highest priority: R2, with 10.
  4. Step 3Pick the BDR among the rest: R1 and R4 tie on priority 1, so the higher router ID, R4, becomes BDR.
  5. Step 4If R5 with priority 200 joins later, it becomes a DROTHER, because the election does not preempt: it becomes BDR only when the DR or the BDR fails, and DR only when the router then acting as DR also fails.
  6. Where questions turnExpecting the router with the highest router ID or a newly raised priority to become DR at once. Priority beats router ID, and the DR election is not preemptive, so a change applies only at the next election.
  7. The takeawayPriority first, router ID second, priority 0 never, and no takeover once a DR exists.
Practise 3.3

3.4Interpret the operational status of First Hop Redundancy Protocols (HSRP and VRRP)

  • First hop redundancy protocols give hosts one virtual gateway IP and virtual MAC shared by several routers, so the gateway survives a router failure.
  • HSRP: one Active router forwards for the virtual IP, one Standby router is ready to take over, others are in Listen. States run Initial, Learn, Listen, Speak, then Standby or Active.
  • HSRP default priority is 100 (range 0 to 255), the highest interface IP breaks a priority tie, and preemption is off by default: configure standby preempt for a higher-priority router to take over.
  • Virtual MAC addresses: HSRPv1 0000.0c07.acXX and HSRPv2 0000.0c9f.fXXX, with the group in hexadecimal; VRRP 0000.5e00.01XX.
  • VRRP: one Master forwards and the others are Backup. Default priority is 100, a router that uses the virtual IP as its own address is the owner with priority 255, and preemption is on by default.
  • Reading show standby brief: the P column shows preemption, State is this router's role, and Active and Standby name the other routers (local means this router; unknown means none). Reading show vrrp brief: Own, Pre (Y or N), State and Master addr.
  1. The situationshow standby brief on R2 shows group 10 with priority 120, no P, state Standby and Active 192.168.10.2, while R1 has the default priority.
  2. Step 1Compare priorities: R2's 120 is higher than R1's 100, so R2 would win an election.
  3. Step 2Check the P column: it is empty, so R2 does not preempt.
  4. Step 3Fix it with standby 10 preempt on R2, then confirm that R2 shows Active and local.
  5. Where questions turnAssuming HSRP preempts like VRRP, or mixing up the names: HSRP uses Active and Standby, VRRP uses Master and Backup, and the virtual MAC prefixes differ.
  6. The takeawayIn HSRP a higher priority means nothing for a running group without preemption; in VRRP preemption is already on.
Practise 3.4

Key terms

AD
Administrative Distance
OSPF
Open Shortest Path First
EIGRP
Enhanced Interior Gateway Routing Protocol
RID
Router ID
DR
Designated Router
BDR
Backup Designated Router
MTU
Maximum Transmission Unit
FHRP
First Hop Redundancy Protocol
HSRP
Hot Standby Router Protocol
VRRP
Virtual Router Redundancy Protocol
After this guide: R1 has O 10.8.0.0/16 [110/5] and S 10.8.0.0/16 [130/0] for the same prefix. Which route is installed, what is the static route called, and when does it take over?
Show the answer

The OSPF route is installed because its administrative distance of 110 is lower than 130. The static route is a floating static route, and it enters the routing table only if the OSPF route to 10.8.0.0/16 is lost.

Practise IP Routing

Built to Cisco's 200-301 CCNA v2.0 exam topics. The explanations, worked examples and traps are ExamDragon's own. Every source this path is built on.