CompTIA Network+ guideNetwork implementation

CompTIA Network+ Routing: How a Router Picks a Route, NAT, PAT, and FHRP

Work through a four-route table the way objective 2.1 tests it: prefix length first, then administrative distance, then metric. Then see NAT and PAT on an office with one public address, an FHRP failover, and router-on-a-stick subinterfaces.

Short answer

On CompTIA Network+ N10-009, objective 2.1 covers static and dynamic routing (BGP, EIGRP, OSPF), route selection, NAT and PAT, FHRP with a virtual IP, and subinterfaces. A router first chooses the most specific route that matches the destination, the longest prefix. Administrative distance only decides between routes to the same prefix learned from different sources, and the metric decides between routes from the same source. So a static route never beats a more specific dynamic route, even though static routes have a lower administrative distance by default on Cisco routers.

What objective 2.1 asks about routing on CompTIA Network+ N10-009

Objective 2.1 sits in Network Implementation, which is 20% of CompTIA Network+ N10-009. It asks you to explain routing technologies rather than configure them: static and dynamic routing with BGP, EIGRP, and OSPF; route selection by administrative distance, prefix length, and metric; NAT and PAT; first hop redundancy protocols (FHRP) and virtual IPs; and subinterfaces. The exam is vendor-neutral, so this page labels any vendor-specific number as such.

How a router picks a route: prefix first, then AD, then metric

Separate two decisions: protocols and administrative distance determine which routes are installed; forwarding then uses the longest matching prefix among those installed routes. For exam problems, check these distinctions:

  1. Longest prefix. The route with the most matching bits wins. RFC 1812 calls this preferring the longest match, and RFC 4632 says Internet forwarding works on a longest-match basis.
  2. Administrative distance (AD). Only when two sources offer the same prefix, the source with the lower AD gets its route installed. RFC 1812 describes the static-versus-dynamic preference as a tie-breaker used only when longest match does not decide.
  3. Metric. Only when one protocol offers more than one path to the same prefix, the protocol's best metric wins. For OSPF, that is the lowest total cost on the shortest-path tree each router builds (RFC 2328).

AD values are not standardized across vendors. Cisco's "Understand Administrative Distance" page (updated July 20, 2026) lists these defaults: connected 0, static 1, external BGP 20, internal EIGRP 90, OSPF 110, IS-IS 115, RIP 120, external EIGRP 170, internal BGP 200. The same page says AD is a local value that is not advertised, and that AD does not override longest prefix match.

A four-route table worked by hand

Take this router's table. The AD column shows Cisco defaults.

RouteLearned fromCisco default ADAddresses it covers
0.0.0.0/0Static (default route)1Every address
10.20.0.0/16Static110.20.0.0 to 10.20.255.255
10.20.30.0/24OSPF11010.20.30.0 to 10.20.30.255
10.20.30.64/26Internal EIGRP9010.20.30.64 to 10.20.30.127

The /26 range comes from its block size: 256 − 192 = 64, so /26 networks in the last octet start at .0, .64, .128, and .192. The one at .64 ends at .127.

Now resolve four destinations:

DestinationRoutes that matchWinner and why
10.20.30.100/0, /16, /24, /26The EIGRP /26. 100 falls between 64 and 127, and /26 is the longest match.
10.20.30.200/0, /16, /24The OSPF /24. 200 is outside .64 to .127, so the /26 drops out.
10.20.99.5/0, /16The static /16. The third octet is 99, so neither the /24 nor the /26 matches.
192.0.2.50/0 onlyThe default route. Nothing more specific matches.

The second row is the trap. The static /16 has a lower AD than OSPF (1 against 110), but it never gets compared on AD, because the OSPF /24 matches more bits. You can confirm the first row in binary too: 100 is 01100100 and 64 is 01000000, and a /26 compares only the first two bits of the last octet, 01 in both.

AD would decide only if, say, OSPF and EIGRP both offered 10.20.30.64/26. With Cisco defaults, EIGRP's 90 beats OSPF's 110, and only the EIGRP route goes into the table.

The free mixed set of 20 Network+ questions includes a route-selection item built on a different table, where a static route with a lower AD competes with a longer OSPF prefix. Once the four rows above feel automatic, pick the route for the free set's longest-prefix item and check the explanation for each wrong choice.

Static routes and the three dynamic protocols compared

StaticOSPFEIGRPBGP
How routes are learnedTyped in by an administratorLink-state: each router builds a shortest-path tree of the area (RFC 2328)Distance vector with the DUAL algorithm (RFC 7868, an informational RFC that documents Cisco's protocol)Exchanged between autonomous systems, with the list of ASes each route has crossed (RFC 4271)
Where it usually runsSmall or stub networks, a default route to an ISPInside one organizationInside one organization, mostly on Cisco equipmentBetween organizations and across the internet
Cisco default AD111090 internal, 170 external20 external, 200 internal

Static routes avoid routing-protocol exchanges, but an untracked static route may keep sending traffic toward an unreachable destination. Interface state, next-hop reachability, or configured tracking can remove a static route. Dynamic protocols exchange updates and can recalculate paths after a failure. If a stem asks which protocol connects two organizations, the answer is BGP, because RFC 4271 defines it as an inter-autonomous-system protocol.

NAT and PAT on an office with one public address

RFC 3022 separates two kinds of translation. Basic NAT maps addresses from one group to another. Network Address Port Translation (NAPT), which the N10-009 objectives call PAT, maps many private addresses and their ports onto a single public address.

Take an office whose ISP gives it one public address, 203.0.113.10, with private hosts in 192.168.1.0/24. Three connections leave at once:

Private address and portAfter PATDestination
192.168.1.21:51000203.0.113.10:40001198.51.100.80, TCP 443
192.168.1.22:51000203.0.113.10:40002198.51.100.80, TCP 443
192.168.1.23:62310203.0.113.10:40003198.51.100.25, UDP 53

Two hosts picked the same source port, 51000, so the router gives them different public ports. When replies come back, the public port tells the router which private host gets each one. The public port numbers here are illustrative; each device chooses its own.

Inbound traffic is the other half. If the office runs a web server at 192.168.1.50, one-to-one NAT would need a second public address. With only one, the router can forward a single port instead, for example 203.0.113.10:443 to 192.168.1.50:443.

FHRP and the virtual IP: a failover story

Hosts usually get one default gateway, often from DHCP. RFC 5798 points out that a single default router is a single point of failure: if it dies, hosts on that subnet are cut off. A first hop redundancy protocol fixes that without touching the hosts.

Take VLAN 10, 10.20.10.0/24, with two routers:

  • R1 has 10.20.10.2 and R2 has 10.20.10.3.
  • Both share a virtual IP, 10.20.10.1, and DHCP hands out 10.20.10.1 as every host's gateway.
  • An election makes one router responsible for the virtual IP. VRRP, the IETF standard in RFC 5798, calls that router the Master.
  • R1 fails. R2 takes over 10.20.10.1, and hosts keep sending to the same gateway address with no change.

VRRP is one vendor-neutral FHRP. Vendors also have their own protocols, and the exam objective names only the general idea, FHRP with a VIP. FHRP protects against failure of a gateway device; it does not repair a missing or incorrectly configured gateway address on a host. Diagnosing a wrong gateway is worked as a diagnosis in the service and performance troubleshooting guide.

The free set's other routing item puts two routers in front of one user VLAN and asks how hosts keep a single gateway when either router fails. With the failover story fresh, choose the gateway design for the two-router VLAN item.

Subinterfaces: one router port, several VLANs

A subinterface splits one physical router interface into several logical ones. The classic use, often called router-on-a-stick, routes between VLANs over a single 802.1Q trunk link to a switch:

  • Subinterface .10 tags its frames with VLAN 10 and holds the gateway 10.20.10.1/24.
  • Subinterface .20 tags VLAN 20 and holds 10.20.20.1/24.
  • Traffic from VLAN 10 to VLAN 20 goes up the trunk to the router and back down with the other tag.

Interface naming and commands differ by platform, so learn the design, not the syntax. A Layer 3 switch with SVIs does the same job inside the switch, which the switching guide covers along with trunks.

For the prefix arithmetic behind every row of the routing table, see the subnetting guide.

Trust the source

Official sources

Exam policies can change. Use these primary sources for the most current details.