Static Routing, OSPFv2 & First Hop Redundancy
CCNA 200-301 · IP Connectivity
Static routing and OSPF are the two ways the CCNA expects you to fill a routing table, and the exam tests them very differently. Static routes are tested as configuration — can you write the command, with the right next hop, for a default route, a network route, a host route, or a floating static route? OSPF is tested as understanding — can you explain how neighbours become adjacent, how the DR and BDR are elected, and how cost is calculated? This guide covers both, plus the first hop redundancy protocols that keep a network's default gateway alive when a router fails.
Static routing
A static route is a route you configure by hand. The command is ip route [destination network] [mask] [next hop or exit interface]. A network route points to a whole subnet: ip route 10.1.1.0 255.255.255.0 192.168.1.2 sends traffic for the 10.1.1.0/24 network to the next-hop router at 192.168.1.2. A default route uses 0.0.0.0 for both the network and the mask: ip route 0.0.0.0 0.0.0.0 192.168.1.2 catches everything that matches no more specific route. A host route uses a /32 mask to point at a single device: ip route 10.1.1.5 255.255.255.255 192.168.1.2.
The next hop can be an IP address or an exit interface, and the choice matters. On a multi-access network such as Ethernet, use a next-hop IP address: if you use an exit interface, the router must send an ARP request for every destination address, which is inefficient. On a point-to-point link, an exit interface is fine, because there is only one possible neighbour. Static routes have an administrative distance of 1, so they beat every dynamically learned route to the same destination.
A floating static route is a static route with a deliberately raised administrative distance, so it stays out of the routing table while a better route exists and appears only when that route fails. The classic use is a backup path: if OSPF (AD 110) provides the primary route, a floating static route with AD 200 — ip route 10.1.1.0 255.255.255.0 192.168.2.2 200 — sits unused until the OSPF route disappears, at which point it is installed automatically. The exam tests this by asking which AD value makes a route float: the answer is always a value higher than the protocol it backs up. IPv6 static routes work the same way: ipv6 route 2001:db8:1::/64 2001:db8::2, with a default route of ipv6 route ::/0 2001:db8::2.
Single-area OSPFv2
OSPF (Open Shortest Path First) is a link-state routing protocol: each router builds a complete map of the network (the link-state database) and runs Dijkstra's shortest path algorithm to compute the best route to every destination. The CCNA covers single-area OSPFv2 — OSPF version 2, for IPv4, with all routers in area 0, the backbone area. OSPF's administrative distance is 110, and its metric is cost, calculated as the reference bandwidth divided by the interface bandwidth. The default reference bandwidth is 100 Mbps, so a 100 Mbps link has a cost of 1, a 10 Mbps link has a cost of 10, and a 1 Gbps link has a cost of 1 (costs are integers, with a minimum of 1). Because modern links are far faster than 100 Mbps, real networks raise the reference bandwidth with auto-cost reference-bandwidth so that a 10 Gbps link is preferred over a 1 Gbps link — with the default reference, both cost 1 and OSPF cannot tell them apart.
Before routers exchange routes, they must become neighbours. Two routers form an adjacency when they agree on the area number, the subnet, the hello and dead timers (hello 10 seconds, dead 40 seconds on broadcast and point-to-point networks), authentication settings, and stub-area flags, and when each has a unique router ID. The adjacency progresses through states — Down, Init, 2-Way, ExStart, Exchange, Loading, Full — and only in the Full state do routers exchange complete link-state information. The router ID is a 32-bit identifier chosen as the highest loopback IP address, or the highest active interface address if no loopback exists; best practice is to set it manually with the router-id command and use a loopback interface, so the ID never changes when a physical interface goes down.
On multi-access networks such as Ethernet, OSPF elects a designated router (DR) and a backup designated router (BDR) to reduce adjacency overhead: instead of every router forming adjacencies with every other router, all routers form adjacencies with the DR and BDR only. The election is won by the highest OSPF priority (default 1, set with ip ospf priority; a priority of 0 means the router never becomes DR or BDR), with the highest router ID breaking ties. On point-to-point links there is no election — the two routers simply become adjacent. The DR and BDR listen on the multicast address 224.0.0.6, while all OSPF routers listen on 224.0.0.5. Basic configuration is router ospf 1 followed by network 192.168.1.0 0.0.0.255 area 0 (note the wildcard mask), and passive-interface stops OSPF hellos on LAN interfaces that have no neighbours. Verify with show ip ospf neighbor, which shows the neighbour's state (Full is healthy), and show ip route ospf.
First hop redundancy protocols
A host's default gateway is a single point of failure: if its gateway router dies, the host loses all off-subnet connectivity. First hop redundancy protocols (FHRPs) solve this by letting two or more routers share a virtual IP address (and a virtual MAC address) that hosts use as their gateway. One router is active and forwards traffic; the others stand by, and if the active router fails, a standby takes over the virtual address within seconds — transparently to the hosts, which never change their gateway configuration.
HSRP (Hot Standby Router Protocol) is Cisco's proprietary FHRP: routers in a group elect an active router (highest priority, default 100; preemption lets a higher-priority router reclaim the role when it recovers) and a standby. VRRP (Virtual Router Redundancy Protocol) is the open-standard equivalent, working the same way with a master and backup routers. GLBP (Gateway Load Balancing Protocol) is Cisco's enhancement: instead of one active router and idle standbys, GLBP load-balances traffic across all routers in the group by having the active virtual gateway assign different virtual MAC addresses to different hosts. The exam tests the purpose of FHRPs and the differences between the three — remember that only GLBP load-balances, and only VRRP is an open standard.
Exam traps to watch for
- Giving a floating static route an AD lower than the protocol it backs up. A floating route needs a HIGHER AD (for example 200 to float above OSPF's 110).
- Saying the DR is elected by lowest router ID. The DR is the highest priority, then the highest router ID — the opposite of the spanning tree root election.
- Forgetting that OSPF cost is reference bandwidth divided by interface bandwidth, with a minimum of 1. A 1 Gbps link and a 100 Mbps link both cost 1 with the default reference bandwidth.
- Using an exit interface for a static route on Ethernet. Use a next-hop IP address on multi-access networks to avoid an ARP request per destination.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.Which command configures a default static route through the next-hop router at 192.168.1.2?
Explanation: A default route uses 0.0.0.0 for both the destination network and the mask, followed by the next-hop address: ip route 0.0.0.0 0.0.0.0 192.168.1.2. Option A is wrong because it points at a specific network (192.168.1.0) rather than the default, and puts 0.0.0.0 in the next-hop position. Option B is wrong because the mask 255.255.255.255 would make it a host route to 0.0.0.0, not a default route. Option C uses an exit interface instead of the required next-hop address.
Exam objective: 200-301 3.3: Configure and verify IPv4 and IPv6 static routing — default route
Q2.An engineer wants a static route to 10.1.1.0/24 to act as a backup that is only used if the OSPF route to the same network fails. Which command achieves this?
Explanation: A floating static route needs an administrative distance higher than the protocol it backs up: OSPF's AD is 110, so an AD of 200 keeps the static route out of the table while the OSPF route exists, and it appears only when the OSPF route fails. Option B is wrong because AD 1 (the default) would beat OSPF and the static route would always be installed. Option C is wrong because without an AD value the route uses the default AD of 1. Option D is wrong because AD 90 is lower than OSPF's 110, so the static route would still win.
Exam objective: 200-301 3.3: Configure and verify IPv4 and IPv6 static routing — floating static
Q3.Two OSPF routers on the same Ethernet segment have priorities of 1 and 0. Which router can become the DR, and why?
Explanation: The DR election is won by the highest priority, and a priority of 0 explicitly disqualifies a router from becoming DR or BDR — so the priority-1 router wins. Option B is wrong because the highest priority wins, not the lowest. Option C is wrong because priorities do not need to match; only the area, subnet, timers, and authentication must agree. Option D is wrong because each segment elects one DR and one BDR, not two DRs.
Exam objective: 200-301 3.4: Configure and verify single area OSPFv2 — broadcast (DR/BDR selection)
Q4.With the default OSPF reference bandwidth of 100 Mbps, what is the OSPF cost of a 10 Mbps link?
Explanation: OSPF cost is the reference bandwidth divided by the interface bandwidth: 100 Mbps / 10 Mbps = 10. Option A (1) is the cost of a 100 Mbps link (or any link faster than the reference bandwidth, since cost has a minimum of 1). Option C (100) would be the cost of a 1 Mbps link. Option D has no basis in the calculation.
Exam objective: 200-301 3.4: Configure and verify single area OSPFv2 — cost
Q5.Which two conditions must be true for two routers to form an OSPF adjacency? (Choose the best pair.)
Explanation: OSPF neighbours must agree on the area number, share a subnet, and have matching hello and dead timers (plus matching authentication and stub flags). Option B is wrong because router IDs must be unique, not identical, and priorities do not need to match. Option C is wrong because only one router per segment is the DR. Option D is wrong because the OSPF process ID is locally significant and does not need to match, and reference bandwidth differences do not prevent adjacency (though they affect cost).
Exam objective: 200-301 3.4: Configure and verify single area OSPFv2 — neighbor adjacencies
Q6.A router has a loopback interface with IP address 1.1.1.1 and physical interfaces with higher IP addresses. No router-id is configured manually. What is the OSPF router ID?
Explanation: OSPF picks the router ID as the highest loopback IP address if any loopback exists, otherwise the highest active physical interface address — so 1.1.1.1 wins even though physical interfaces have higher addresses. Option A is wrong because OSPF always selects a router ID automatically when none is configured. Option B is wrong because loopback addresses take precedence over physical interfaces. Option C is wrong because there is no special 'management IP' concept in router ID selection.
Exam objective: 200-301 3.4: Configure and verify single area OSPFv2 — router ID
Q7.Which multicast address do OSPF routers use to send hello packets to all other OSPF routers on a segment?
Explanation: 224.0.0.5 is the AllSPFRouters multicast address, used for hello packets and link-state updates to every OSPF router on the segment. Option A (224.0.0.9) is the RIPv2 multicast address. Option B (224.0.0.10) is the EIGRP multicast address. Option D (224.0.0.6) is the AllDRouters address, used to reach only the DR and BDR.
Exam objective: 200-301 3.4: Configure and verify single area OSPFv2 — neighbor adjacencies
Q8.What is the purpose of the passive-interface command in OSPF configuration?
Explanation: passive-interface stops OSPF hello packets from being sent out of an interface (so no neighbour adjacency forms there) while the network connected to that interface is still advertised in OSPF — the right setting for a LAN interface with only endpoints attached. Option A is wrong because it affects one interface, not the whole OSPF process. Option C is wrong because DR election is controlled by priority, not by passive-interface. Option D is wrong because authentication is configured separately.
Exam objective: 200-301 3.4: Configure and verify single area OSPFv2
Q9.Which first hop redundancy protocol load-balances traffic across all routers in the group, rather than using one active router and idle standbys?
Explanation: GLBP (Gateway Load Balancing Protocol) has the active virtual gateway assign different virtual MAC addresses to different hosts, so traffic is spread across all routers in the group instead of leaving standby routers idle. Option A is wrong because HSRP uses one active router and a standby. Option C is wrong because VRRP likewise uses one master router and backups. Option D is wrong because LACP is a link-aggregation protocol for bundling Ethernet links, not a first hop redundancy protocol.
Exam objective: 200-301 3.5: Describe the purpose, functions, and concepts of first hop redundancy protocols
Q10.A host uses 192.168.1.1 as its default gateway. That address is the virtual IP of an HSRP group, and the active router fails. What happens to the host's traffic?
Explanation: That is the whole point of a first hop redundancy protocol: the virtual IP address stays the same, the standby router assumes the active role and takes over the virtual MAC address, and hosts keep forwarding to the same gateway address with no reconfiguration. Option A is wrong because hosts never use the routers' real addresses — they use the virtual IP. Option B is wrong because the standby takes over within seconds. Option C is wrong because Spanning Tree is a Layer 2 mechanism and is not involved in gateway failover.
Exam objective: 200-301 3.5: Describe the purpose, functions, and concepts of first hop redundancy protocols