IP Connectivity

493 questions

Question 141Question

Refer to the following routing table output from a Cisco router:

text
Codes: C - connected, S - static, O - OSPF, D - EIGRP

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
O 10.1.0.0/16 [110/20] via 192.168.1.2, 00:05:12, GigabitEthernet0/0
D 10.1.4.0/22 [90/307200] via 192.168.1.6, 00:12:33, GigabitEthernet0/1
S 10.1.4.0/24 [1/0] via 192.168.1.10, 01:45:00, GigabitEthernet0/2
O 10.1.4.128/25 [110/10] via 192.168.1.14, 00:02:15, GigabitEthernet0/3

A packet arrives at the router with a destination IP address of 10.1.4.13010.1.4.130. Which exit interface will the router use to forward this packet?

Show answer & explanation

Answer: GigabitEthernet0/3, because the route to 10.1.4.128/25 has the longest matching prefix length for the destination IP address.

Answer

The router forwards the packet out interface GigabitEthernet0/3 because 10.1.4.128/25 is the longest prefix match for destination 10.1.4.130.
When a router receives an IP packet, it compares the destination IP address against all entries in its routing table. The fundamental rule of IP route selection is Longest Prefix Match (LPM). Since 10.1.4.130 matches 10.1.4.128/25 (/25 bit match), 10.1.4.0/24 (/24 bit match), 10.1.4.0/22 (/22 bit match), and 10.1.0.0/16 (/16 bit match), the router selects 10.1.4.128/25 because /25 is the longest (most specific) prefix length. Consequently, traffic is forwarded via GigabitEthernet0/3.

Step-by-Step Solution

1
Identify candidate routes matching destination IP 10.1.4.130.
The candidate routes are: 10.1.0.0/16, 10.1.4.0/22, 10.1.4.0/24, and 10.1.4.128/25.
All four routes contain IP address 10.1.4.130 within their range.
2
Determine the prefix length for each matching candidate route.
Prefix lengths are /16, /22, /24, and /25.
Longest Prefix Match (LPM) rule dictates that the route with the most specific subnet mask (highest prefix number) is selected first.
3
Select the route with the longest prefix match.
10.1.4.128/25 (/25) is the longest match, which forwards out GigabitEthernet0/3.
Administrative Distance (AD) and metric are ignored when prefix lengths differ among candidate routes.

Key Concept

Router Forwarding Decision Logic (Longest Prefix Match precedence over Administrative Distance and Metric)
Question 142Question

A network administrator executes the command `show ip ospf interface gigabitethernet 0/0` on two interconnecting routers to troubleshoot an OSPF neighbor issue.

Output from Router R1:
text
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.1.12.1/24, Area 0
Process ID 10, Router ID 1.1.1.1, Network Type BROADCAST
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Output from Router R2:
text
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.1.12.2/24, Area 1
Process ID 20, Router ID 2.2.2.2, Network Type BROADCAST
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Which condition is preventing R1 and R2 from establishing an OSPF neighbor adjacency?

Show answer & explanation

Answer: The OSPF Area IDs configured on the connected interfaces do not match.

Answer

The OSPF Area IDs configured on the connected interfaces do not match.
For two OSPF routers to establish a neighbor adjacency across a direct link, several key parameters in their exchanged Hello packets must match. One mandatory matching parameter is the Area ID. Because Router R1 is configured in Area 0 and Router R2 is configured in Area 1 on their interconnecting interfaces, the routers will discard each other's Hello packets and remain in the DOWN state.

Step-by-Step Solution

1
Inspect the CLI output for interface parameters sent in OSPF Hello packets.
Router R1 has interface GigabitEthernet0/0 assigned to Area 0, while Router R2 has interface GigabitEthernet0/0 assigned to Area 1.
For OSPF neighbors to form an adjacency over a common link, the Area ID field in their exchanged Hello packets must match exactly.
2
Verify other OSPF Hello packet parameters for compatibility.
Both routers share identical IP subnets (10.1.12.0/24) and matching timers (Hello 10, Dead 40). Both have unique Router IDs (1.1.1.1 and 2.2.2.2).
Process IDs (10 vs 20) are locally significant and do not affect neighbor relationships across a link.

Key Concept

OSPF Neighbor Adjacency Requirements
Estimated Time:1m 15s
Question 143Question

A network administrator needs to configure a floating static default route on a Cisco IOS router to serve as a backup to an existing OSPF-learned default route (Administrative Distance of 110). Place the operational steps in the correct sequential order to configure, validate normal operation, and verify failover behavior of this backup route.

Drag items to arrange them in the correct order

Show answer & explanation

Answer

The correct operational sequence begins by analyzing the primary protocol AD (110), navigating to global configuration mode, defining the floating static default route with a higher AD value (120), verifying that the route remains inactive in the routing table during normal operations, and finally testing link failover to confirm RIB insertion.
The workflow follows standard Cisco IOS network administration practices: planning parameters (AD selection), configuration entry, syntax application, baseline verification (confirming inactivity while primary is up), and failover validation (confirming activation when primary drops).

Step-by-Step Solution

1
Determine the primary route's Administrative Distance.
Identified OSPF AD as 110, requiring a floating static route AD > 110 (e.g., 120).
Floating static routes rely on a higher AD than the active routing source so they remain inactive until the primary route fails.
2
Access configuration mode.
Router prompt changes to `Router(config)#`.
Cisco IOS static route creation requires global configuration access.
3
Apply the static route configuration.
Configured `ip route 0.0.0.0 0.0.0.0 203.0.113.2 120`.
Defines a default route (`0.0.0.0 0.0.0.0`) pointing to next-hop `203.0.113.2` with an AD argument of `120`.
4
Verify initial routing table state.
Confirmed OSPF route is active in RIB and static route is absent.
Ensures the floating route does not preempt the primary dynamic path while the primary path is healthy.
5
Test path failover under fault conditions.
Static route `S* 0.0.0.0/0 [120/0] via 203.0.113.2` appears in `show ip route` output upon primary interface shutdown.
Validates proper failover functionality when the primary route is removed from the routing table.

Key Concept

Floating Static Route Lifecycle and Failover Validation
Estimated Time:2m 0s
Question 144Question

An engineer is configuring a backup link on router R2 to reach the internal network 10.50.0.0/1610.50.0.0/16. The primary path is currently learned dynamically via OSPF, which has a default administrative distance of 110. Which Cisco IOS command correctly configures a floating static route that remains inactive unless the primary OSPF route fails?

Show answer & explanation

Answer: ip route 10.50.0.0 255.255.0.0 172.16.12.2 120

Answer

The command 'ip route 10.50.0.0 255.255.0.0 172.16.12.2 120' correctly configures the floating static route.
A floating static route acts as a secondary path that is installed into the routing table only when the primary path fails. To achieve this behavior, the static route must be configured with an Administrative Distance (AD) higher than that of the primary routing protocol. Since OSPF has a default AD of 110, setting the static route AD to 120 ensures it stays in reserve.

Step-by-Step Solution

1
Identify the primary route's Administrative Distance (AD)
OSPF has a default AD of 110.
Floating static routes must have an AD strictly greater than the primary route's AD to remain hidden in the routing table until the primary path drops.
2
Verify Cisco IOS IPv4 static routing syntax
The correct format is 'ip route <destination-network> <subnet-mask> <next-hop-ip> [distance]'.
Standard subnet masks (dotted-decimal) are mandatory in Cisco IOS static routing syntax.
3
Select the option with an AD greater than 110 and proper subnet mask syntax
The command specifying an AD of 120 with mask 255.255.0.0 meets both requirements.
An AD of 120 ensures the static route is kept in backup state while OSPF is active.

Key Concept

Floating Static Route Administrative Distance Selection
Question 145Question

A Cisco router, R1, initializes its OSPFv2 routing process without an explicit router-id configuration. R1 has three interfaces with the following states:
- Loopback0: IP address 172.16.100.1/32 (Line protocol UP, Operational state UP)
- Loopback1: IP address 192.168.50.1/32 (Line protocol DOWN, Operational state DOWN)
- GigabitEthernet0/0: IP address 10.0.12.1/24 (Line protocol UP, Operational state UP, MTU 1500)

After the OSPF process starts operating and selects its Router ID, a network engineer enters the command 'router-id 1.1.1.1' under the OSPF configuration mode on R1, but does not reload the router or issue the 'clear ip ospf process' command.

R1 then sends an initial OSPF Hello packet out GigabitEthernet0/0 to neighboring router R2. Router R2 has its connected interface configured in the same OSPF area with matching timers, but with an interface MTU of 1400 bytes. When R2 receives this initial Hello packet from R1 (which does not yet list R2's Router ID in its neighbor field), which OSPF Router ID will R1 use in the packet header, and what state will R2 record for neighbor R1 upon processing this packet?

Show answer & explanation

Answer: Router ID: 172.16.100.1; Neighbor State on R2: Init

Answer

Router ID: 172.16.100.1; Neighbor State on R2: Init
The correct answer specifies Router ID 172.16.100.1 and Init state. R1 selects 172.16.100.1 because Loopback0 is the highest operational loopback interface when OSPF starts. Configuring a manual router-id later has no effect until the OSPF process is restarted. When R2 receives R1's first Hello packet (which lacks R2's Router ID in its neighbor list), R2 records R1 in the Init state. MTU differences do not prevent entering Init state.

Step-by-Step Solution

1
Determine the active OSPF Router ID on R1 at process initialization
Loopback0 (172.16.100.1) is chosen as the Router ID
OSPF Router ID selection logic evaluates: 1) manual 'router-id' setting, 2) highest IP address among operational (UP/UP) loopback interfaces, 3) highest IP address among operational non-loopback interfaces. Loopback1 is DOWN/DOWN, so it is ignored. Loopback0 (172.16.100.1) is the highest active loopback IP.
2
Evaluate the impact of configuring 'router-id 1.1.1.1' after process startup
The active Router ID remains 172.16.100.1
OSPF Router ID election is non-preemptive. Changing the router ID under the OSPF process does not take effect until the OSPF process is explicitly restarted using 'clear ip ospf process' or the router is rebooted.
3
Evaluate the OSPF neighbor state recorded by R2 upon receiving R1's initial Hello packet
R2 transitions R1 to the Init state
When a router receives an OSPF Hello packet from a neighbor that does not contain its own Router ID in the Received Neighbor field, it places that neighbor into the Init state. MTU mismatches affect Database Description (DBD) exchanges during ExStart/Exchange states, not the initial Hello exchange.

Key Concept

OSPFv2 Router ID selection non-preemptiveness and finite state machine transition rules upon Hello packet reception.
Estimated Time:2m 0s
Question 146Question

A network administrator needs to configure a static IPv6 route on a Cisco router to reach the destination network 2001:db8:acad:1::/64 using the next-hop router's link-local address fe80::1 via local interface GigabitEthernet0/0/1. Which Cisco IOS command correctly accomplishes this configuration?

Show answer & explanation

Answer: ipv6 route 2001:db8:acad:1::/64 GigabitEthernet0/0/1 fe80::1

Answer

The command 'ipv6 route 2001:db8:acad:1::/64 GigabitEthernet0/0/1 fe80::1' correctly configures the IPv6 static route using a link-local address with the mandatory local exit interface.
The correct command specifies 'ipv6 route' followed by the target IPv6 network prefix/length (2001:db8:acad:1::/64), the local exit interface (GigabitEthernet0/0/1), and the next-hop link-local address (fe80::1). In Cisco IOS, link-local addresses cannot be used as static route next-hops without identifying the local exit interface.

Step-by-Step Solution

1
Identify the destination IPv6 prefix and length
Destination prefix is 2001:db8:acad:1::/64.
IPv6 static routes require CIDR prefix notation (/64).
2
Evaluate next-hop address requirements
The next-hop address fe80::1 is a link-local address.
Link-local addresses (fe80::/10 range) are non-global and exist on every interface, making them ambiguous to the routing table without an exit interface context.
3
Formulate the correct Cisco IOS IPv6 static route command syntax
Command format: ipv6 route <destination-prefix/mask> <exit-interface> <link-local-next-hop>
Cisco IOS requires both the local exit interface and the link-local next-hop address for fully specified static routes using link-local next-hops.

Key Concept

Fully specified IPv6 static routes using link-local next-hop addresses
Question 147Question

Examine the following Cisco router IP routing table output:

text
R1# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

172.24.0.0/16 is subnetted, 4 subnets
S 172.24.0.0/16 [1/0] via 10.10.10.1
D 172.24.16.0/24 [90/307200] via 10.10.20.1
O 172.24.16.64/26 [110/40] via 10.10.30.1
R 172.24.16.80/28 [120/2] via 10.10.40.1

Router R1 receives an IP packet destined for 172.24.16.85172.24.16.85. Which next-hop IP address will router R1 select to forward this packet?

Show answer & explanation

Answer: 10.10.40.1

Answer

10.10.40.1
When a router makes a forwarding decision, it evaluates matching routes using Longest Prefix Match (LPM) as the top priority criterion. Because 172.24.16.85172.24.16.85 matches 172.24.16.80/28172.24.16.80/28 (range .80–.95), the /28/28 route has the longest prefix length (28 bits) among all candidates. Thus, next-hop 10.10.40.1 is selected regardless of RIP having a higher Administrative Distance (120) than Static (1), EIGRP (90), or OSPF (110).

Step-by-Step Solution

1
Determine which routing table entries match the target destination IP 172.24.16.85172.24.16.85.
Matches found: 172.24.0.0/16172.24.0.0/16, 172.24.16.0/24172.24.16.0/24, 172.24.16.64/26172.24.16.64/26 (range .64 to .127), and 172.24.16.80/28172.24.16.80/28 (range .80 to .95).
The destination address 172.24.16.85172.24.16.85 falls within the address ranges of all four configured subnets.
2
Apply the router forwarding lookup order logic (Longest Prefix Match).
The /28/28 prefix is selected over /26/26, /24/24, and /16/16 because 2828 is the maximum number of matching prefix bits.
Routers always evaluate prefix length first. Administrative Distance is only evaluated when comparing identical prefixes learned from different sources.
3
Identify the next-hop IP associated with the winning /28/28 route entry.
The next-hop address for 172.24.16.80/28172.24.16.80/28 is 10.10.40.110.10.40.1.
The packet is forwarded out to the next hop specified in the /28/28 RIP route entry despite its higher AD.

Key Concept

Longest Prefix Match (LPM) precedence in Cisco IPv4 routing lookup decision logic
Estimated Time:2m 0s
Question 148Question

A Cisco router receives an IP packet destined for host 172.16.35.67172.16.35.67. The routing table contains multiple candidate routes that match this destination IP address. Place the routing decision criteria in the correct order of precedence used by the router to make its forwarding decision, from first evaluated (highest precedence) at the top to last evaluated (lowest precedence) at the bottom.

Drag items to arrange them in the correct order

Show answer & explanation

Answer

The correct sequence of router forwarding decision logic criteria from highest to lowest precedence is: 1) Longest Prefix Match, 2) Lowest Administrative Distance, 3) Lowest Metric, and 4) Equal-Cost Load Balancing.
When forwarding an IP packet, a Cisco router evaluates candidate routes in a strict multi-tier hierarchy. First, Longest Prefix Match (LPM) determines the best route by selecting the entry with the most specific subnet mask. Second, if multiple routes match with the exact same subnet mask length, the router compares Administrative Distance (AD) to select the most trustworthy route source. Third, if routes share the exact same prefix length and come from the same routing protocol, the router selects the path with the lowest metric. Finally, if prefix length, AD, and metric are all identical, equal-cost load balancing is applied.

Step-by-Step Solution

1
Evaluate mask length specificity (Longest Prefix Match).
The router compares the destination address against all routing table entries and isolates candidate routes matching the highest number of left-to-right network bits (longest subnet mask).
Longest Prefix Match is the primary decision rule in IP packet forwarding and overrides AD and metric.
2
Compare Administrative Distance (AD) for identical prefix lengths.
If candidate routes share the exact same prefix length (e.g., two /24/24 routes), the router compares route sources and selects the one with the lowest AD value.
Administrative Distance defines the believability or trustworthiness of the route source.
3
Compare routing protocol Metric for identical prefix length and route source.
If multiple candidate routes share the exact same prefix length and originate from the same routing protocol (same AD), the router selects the path with the lowest metric value.
Metric measures the cost or desirability of a specific path within a routing protocol domain.
4
Execute Equal-Cost Multi-Path (ECMP) load balancing.
If candidate routes for the exact same prefix length have identical AD and metric values, the router installs multiple paths in the Forwarding Information Base (FIB) and distributes traffic across them.
Equal-cost load balancing optimizes link usage when multiple best paths exist.

Key Concept

Router Forwarding Decision Hierarchy (LPM -> AD -> Metric -> ECMP)
Estimated Time:2m 0s
Question 149Question

A network administrator needs to manually configure a floating static route on a Cisco IOS router to serve as a backup path. Arrange the required command components in the correct sequential order from left to right as typed in the CLI.

Drag items to arrange them in the correct order

Show answer & explanation

Answer

The correct sequence for configuring a floating IPv4 static route in Cisco IOS is: `ip route` keyword, destination network address, subnet mask, next-hop IPv4 address (or exit interface), and administrative distance.
The standard Cisco IOS syntax for configuring an IPv4 static route is `ip route <destination-prefix> <subnet-mask> {ip-address | exit-interface} [distance]`. Placing `ip route` first, followed by the destination network prefix, subnet mask, next-hop IP address, and finally the administrative distance creates a valid floating static route.

Step-by-Step Solution

1
Identify the global configuration command mode keyword
Start with `ip route`.
Cisco IOS requires the keyword `ip route` to initiate an IPv4 static route entry.
2
Specify target destination network parameters
Provide the destination network IP (`192.168.20.0`) followed by its subnet mask (`255.255.255.0`).
The router must know which destination address block this route applies to.
3
Define forwarding path
Specify the next-hop IP address (`10.1.1.2`) or local exit interface.
The router requires explicit instructions on where to send matching packets.
4
Configure administrative distance for backup behavior
Append an administrative distance value greater than the primary protocol's AD (e.g., `130`).
Setting an AD higher than the primary route (such as OSPF AD 110) ensures the static route remains floating until the primary fails.

Key Concept

Cisco IOS IPv4 Static Route Command Syntax and Floating Route Configuration
Question 150Question

Refer to the following Cisco CLI routing table output:

text
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

S 172.31.50.0/24 [1/0] via 10.1.1.1, GigabitEthernet0/0/1
D 172.31.50.64/28 [90/307200] via 10.2.2.2, GigabitEthernet0/0/2
O 172.31.50.64/29 [110/20] via 10.3.3.3, GigabitEthernet0/0/3
R 172.31.50.68/30 [120/1] via 10.4.4.4, GigabitEthernet0/0/4

A router receives an IP packet addressed to 172.31.50.67172.31.50.67. Which next-hop IP address will the router select to forward this packet?

Show answer & explanation

Answer: 10.3.3.3

Answer

The router forwards the packet to next-hop IP address 10.3.3.3 via interface GigabitEthernet0/0/3.
The correct choice identifies 10.3.3.3 as the next hop because the route 172.31.50.64/29 has the longest matching prefix (/29) among all valid candidate routes covering destination IP 172.31.50.67. A router always prefers the most specific route (longest prefix length) regardless of Administrative Distance or metric.

Step-by-Step Solution

1
Evaluate the target destination IP against all candidate routes in the routing table.
Destination IP 172.31.50.67172.31.50.67 is checked against each prefix mask.
The router must first find all matching subnets.
2
Determine subnet boundaries for candidate routes.
- 172.31.50.0/24 covers 172.31.50.0 to 172.31.50.255 (Match, length /24)
- 172.31.50.64/28 covers 172.31.50.64 to 172.31.50.79 (Match, length /28)
- 172.31.50.64/29 covers 172.31.50.64 to 172.31.50.71 (Match, length /29)
- 172.31.50.68/30 covers 172.31.50.68 to 172.31.50.71 (No match, 67 is outside range)
Routes must cover the target address to be valid candidates.
3
Apply the Longest Prefix Match (LPM) rule among all valid candidate routes.
The valid matching prefixes are /24, /28, and /29. The longest prefix match is /29 (172.31.50.64/29).
Longest Prefix Match is the absolute first criterion used by a router when forwarding packets, taking precedence over Administrative Distance and Metric.
4
Identify the next-hop IP address for the longest prefix match route.
The route 172.31.50.64/29 specifies next-hop IP 10.3.3.3.
Packets are forwarded to the next-hop specified by the winning route.

Key Concept

Longest Prefix Match (LPM) Logic
Question 151Question

Refer to the following routing table output from a Cisco router:

text
Gateway of last resort is 192.168.1.1 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 192.168.1.1
D 172.31.0.0/16 [90/2172416] via 10.1.1.1, 01:24:12, GigabitEthernet0/0
O 172.31.45.0/24 [110/20] via 10.2.2.2, 00:45:10, GigabitEthernet0/1
S 172.31.45.128/26 [1/0] via 10.3.3.3
D 172.31.45.128/27 [90/307200] via 10.4.4.4, 02:11:05, GigabitEthernet0/2

The router receives an IP packet with a destination address of 172.31.45.138172.31.45.138. Which next-hop IP address will the router choose to forward this packet?

Show answer & explanation

Answer: 10.4.4.4

Answer

The router will forward the packet to next-hop IP address 10.4.4.4.
When forwarding a packet, a Cisco router compares the destination IP address against all network entries in the routing table and selects the route with the longest prefix match (the most specific subnet mask). The destination address 172.31.45.138 matches 172.31.45.128/27 (host range .128–.159), which has a 27-bit mask length. This is more specific than the /26, /24, /16, or default /0 routes. Therefore, the router forwards the packet to next-hop 10.4.4.4 via GigabitEthernet0/2.

Step-by-Step Solution

1
Determine which routing entries encompass the destination IP address 172.31.45.138.
The destination address 172.31.45.138 falls within the ranges for 0.0.0.0/0, 172.31.0.0/16, 172.31.45.0/24, 172.31.45.128/26 (range 172.31.45.128 to 172.31.45.191), and 172.31.45.128/27 (range 172.31.45.128 to 172.31.45.159).
A router evaluates all matching routes in its routing table before selecting the forwarding path.
2
Apply the Longest Prefix Match (LPM) rule among all valid matching routes.
Prefix lengths are /0, /16, /24, /26, and /27. The route with the longest prefix length is 172.31.45.128/27.
Routers always prioritize the most specific route (longest subnet mask / prefix length) regardless of administrative distance or metric.
3
Identify the next-hop IP associated with the winning route 172.31.45.128/27.
The route specifies 'via 10.4.4.4, GigabitEthernet0/2'.
The packet must be forwarded to the next-hop interface/IP designated by the longest matching routing table entry.

Key Concept

Longest Prefix Match (LPM) precedence in router forwarding logic
Question 152Question

An engineer is troubleshooting packet forwarding on router R1. A packet arrives at R1 with a destination IP address of 172.16.45.100.

Refer to the command output from R1:

text
R1# show ip route
Gateway of last resort is 10.0.0.5 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 10.0.0.5
S 172.16.0.0/16 [1/0] via 10.0.0.1
O 172.16.45.0/24 [110/20] via 10.0.0.2
B 172.16.45.96/28 [20/0] via 10.0.0.4

Which next-hop IP address will router R1 use to forward this packet?

Show answer & explanation

Answer: 10.0.0.4

Answer

Router R1 will forward the packet to the next-hop IP address 10.0.0.4 based on the Longest Prefix Match rule.
When a router receives a packet, it compares the destination IP address against all routes in the routing table. If multiple routes match, the router strictly prefers the route with the most specific (longest) subnet mask (Longest Prefix Match). In this scenario, 172.16.45.100 matches 0.0.0.0/0, 172.16.0.0/16, 172.16.45.0/24, and 172.16.45.96/28. The /28 prefix is the longest match, so the packet is routed via next-hop 10.0.0.4.

Step-by-Step Solution

1
Identify all candidate routes matching the destination address 172.16.45.100.
The destination address matches 0.0.0.0/0, 172.16.0.0/16, 172.16.45.0/24, and 172.16.45.96/28.
172.16.45.96/28 spans usable IP range 172.16.45.97 to 172.16.45.110, which includes 172.16.45.100.
2
Compare prefix lengths of all matching candidate routes.
Prefix lengths are /0, /16, /24, and /28.
Router forwarding logic relies first on Longest Prefix Match (LPM) to choose the most specific route.
3
Select the route with the most specific (longest) prefix mask.
The route B 172.16.45.96/28 with next-hop 10.0.0.4 has the longest mask (/28).
LPM supersedes Administrative Distance and Metric during route selection.

Key Concept

Router Forwarding Decision Logic & Longest Prefix Match
Question 153Question

Refer to the following partial output from a Cisco router's routing table:

text
Codes: C - connected, S - static, O - OSPF, D - EIGRP

O 172.16.10.0/24 [110/20] via 10.1.1.1, GigabitEthernet0/0
D 172.16.10.64/26 [90/307200] via 10.1.1.2, GigabitEthernet0/1
S 172.16.10.64/27 [1/0] via 10.1.1.3, GigabitEthernet0/2

The router receives an IP packet with a destination IP address of 172.16.10.68. Which statements correctly describe how the router handles this forwarding decision? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: The router selects the static route to 172.16.10.64/27 because it has the longest prefix match for the destination address.; The packet is forwarded out interface GigabitEthernet0/2 toward next-hop IP address 10.1.1.3.

Answer

The router selects the static route to 172.16.10.64/27 because it has the longest prefix match, and forwards the packet out GigabitEthernet0/2 toward next-hop 10.1.1.3.
When forwarding a packet, a router compares the destination IP address against all known routes and chooses the entry with the longest prefix match (most specific netmask). The subnet 172.16.10.64/27 has a 27-bit mask, making it the longest match among the candidates. Consequently, the router routes the packet out GigabitEthernet0/2 to next-hop 10.1.1.3.

Step-by-Step Solution

1
Evaluate destination host IP against candidate subnet ranges in the routing table.
Destination 172.16.10.68 matches 172.16.10.0/24, 172.16.10.64/26, and 172.16.10.64/27.
All three routes encompass the target address within their subnet ranges.
2
Apply the Longest Prefix Match (LPM) rule.
172.16.10.64/27 has a 27-bit mask, which is longer than /26 and /24.
Routers always prefer the route with the most specific (longest) subnet mask first, regardless of administrative distance or metric.
3
Determine the forwarding action based on the selected route entry.
The route specifies exit interface GigabitEthernet0/2 and next-hop 10.1.1.3.
The router forwards the packet using the egress interface and next-hop associated with the winning LPM route.

Key Concept

Router Forwarding Decision Logic & Longest Prefix Match
Question 154Question

A network engineer is analyzing the forwarding behavior of router R1 for traffic destined to IP address 172.20.16.45172.20.16.45. The router currently has an active OSPFv2 process that learns prefix 172.20.16.0/20172.20.16.0/20 (Administrative Distance 110). Additionally, the administrator configures three IPv4 static routes on R1:

- Command 1: `ip route 172.20.16.0 255.255.240.0 10.0.0.2 115`
- Command 2: `ip route 172.20.16.0 255.255.255.0 10.0.1.2`
- Command 3: `ip route 172.20.16.32 255.255.255.224 10.0.2.2 120`

Assuming all next-hop IP addresses (10.0.0.210.0.0.2, 10.0.1.210.0.1.2, and 10.0.2.210.0.2.2) are reachable via directly connected subnets, which route will router R1 use to forward the packet destined to 172.20.16.45172.20.16.45, and why?

Show answer & explanation

Answer: The static route from Command 3 via next-hop 10.0.2.2, because it is installed in the routing table and has the longest prefix match (/27) for the destination IP address.

Answer

The router forwards the packet via the static route from Command 3 (next-hop 10.0.2.2) because it is installed in the routing table and provides the longest prefix match (/27) for IP address 172.20.16.45.
The correct answer identifies that the static route configured in Command 3 via next-hop 10.0.2.2 is installed in the routing table and selected via the Longest Prefix Match rule. AD comparison only suppresses a route when another protocol offers the exact same destination prefix and mask with a lower AD. Because Command 3 specifies 172.20.16.32/27, no exact match conflict exists with OSPF (172.20.16.0/20) or Command 2 (172.20.16.0/24), allowing Command 3 into the routing table. When forwarding a packet to 172.20.16.45, the router evaluates all installed routes matching the IP address and picks /27 as the longest prefix match.

Step-by-Step Solution

1
Evaluate Routing Information Base (RIB) installation for each static route based on Administrative Distance (AD).
Command 1 (172.20.16.0/20, AD 115) matches OSPF prefix 172.20.16.0/20 (AD 110). Because OSPF AD < 115, Command 1 is not installed (floating static route). Command 2 (172.20.16.0/24, default AD 1) and Command 3 (172.20.16.32/27, AD 120) have unique prefixes, so AD comparison against OSPF does not prevent their installation.
Administrative Distance is only compared between routes with identical prefix and subnet mask definitions.
2
Determine which installed RIB entries match destination IP 172.20.16.45.
Matching installed routes: OSPF (172.20.16.0/20), Command 2 static route (172.20.16.0/24), and Command 3 static route (172.20.16.32/27).
172.20.16.45 falls within the host ranges of all three installed subnets: /20 (172.20.16.0 - 172.20.31.255), /24 (172.20.16.0 - 172.20.16.255), and /27 (172.20.16.32 - 172.20.16.63).
3
Apply router forwarding decision logic to select the active path for the packet.
Select 172.20.16.32/27 via next-hop 10.0.2.2.
Routers select paths based on the Longest Prefix Match (LPM) rule. A /27 prefix (27 mask bits) is longer and more specific than /24 or /20.

Key Concept

Routing Table Installation (AD Comparison for Exact Matches) vs Packet Forwarding Logic (Longest Prefix Match)
Question 155Question

A Cisco router receives an Ethernet frame containing an IPv4 packet destined for a remote host. Place the router's forwarding decision steps in the exact chronological order in which they are evaluated from initial packet reception to egress frame transmission.

Drag items to arrange them in the correct order

Show answer & explanation

Answer

The correct sequence starts with extracting the destination IPv4 address, performing the Longest Prefix Match search, resolving ties using Administrative Distance, comparing metrics for remaining identical protocol routes, and finally rewriting Layer 2 headers to forward out the exit interface.
The router processes forwarding logic sequentially: destination IP extraction happens first, followed by selecting candidate routes based strictly on Longest Prefix Match (LPM). If multiple routes share the identical prefix length, Administrative Distance (AD) determines the trusted protocol source. If AD is also equal, metric cost breaks the tie. Once the best path is chosen, Layer 2 header rewriting and egress transmission occur as the final step.

Step-by-Step Solution

1
Examine incoming packet header.
Destination IP address is retrieved for routing lookup.
The router requires the destination address to query the routing table.
2
Perform Longest Prefix Match (LPM) evaluation.
Routing table entries with the highest number of matching network bits are selected.
LPM is always the primary criterion for route selection, overriding AD and metric.
3
Evaluate Administrative Distance (AD).
The route from the routing protocol with the lowest AD is selected if prefix lengths match.
AD measures route source trustworthiness.
4
Evaluate metric cost.
The route with the lowest metric cost is chosen if prefix lengths and AD are equal.
Metric measures path cost within a single routing protocol instance.
5
Perform egress frame encapsulation and transmission.
New source and destination MAC addresses are populated, ARP/ND is queried if necessary, and the frame is transmitted out the exit interface.
Layer 2 rewrites are required for adjacent next-hop framing.

Key Concept

Router Forwarding Decision Logic Priority (LPM -> AD -> Metric -> L2 Encapsulation)
Question 156Question

Refer to the following routing table excerpt from a Cisco router:

text
O 10.20.0.0/16 [110/50] via 172.16.1.1, 01:12:35, GigabitEthernet0/0
D 10.20.10.0/24 [90/307200] via 172.16.2.1, 00:45:10, GigabitEthernet0/1
S 10.20.10.128/25 [1/0] via 172.16.3.1

A packet arrives at the router destined for host IP address 10.20.10.130. Which two statements correctly describe how the router evaluates its routing table components to forward this packet? (Select two.)

Select all that apply

Show answer & explanation

Answer: The router forwards the packet using the static route (10.20.10.128/25) because /25 is the longest matching prefix for destination 10.20.10.130.; The router evaluates prefix length prior to checking administrative distance or metric when making forwarding decisions.

Answer

The router selects the static route (10.20.10.128/25) because /25 is the longest matching prefix for destination 10.20.10.130, and the router evaluates prefix length prior to checking administrative distance or metric when making forwarding decisions.
When forwarding a packet, a Cisco router first identifies all routes that match the destination IP address and selects the route with the longest prefix length (most specific subnet mask). Since 10.20.10.128/25 matches destination 10.20.10.130 with 25 matching network bits, it is selected over the /24 and /16 routes. Administrative distance and metrics are only evaluated during route selection when prefix lengths are identical.

Step-by-Step Solution

1
Compare the destination IP address 10.20.10.130 against all prefix entries in the routing table.
The destination address matches 10.20.0.0/16, 10.20.10.0/24, and 10.20.10.128/25.
Routing forwarding decisions start by identifying all matching routes.
2
Determine the prefix length of each matching route.
The prefix lengths are /16, /24, and /25.
The router applies the longest prefix match rule to find the most specific network path.
3
Select the route with the highest number of matching network bits.
The /25 route (10.20.10.128/25) is chosen regardless of administrative distance or metric values.
Longest prefix match always takes precedence over administrative distance and metric values during forwarding lookup.

Key Concept

Longest Prefix Match Rule in Cisco Routing Tables
Question 157Question

Examine the following Cisco IPv4 routing table snippet:

text
Codes: C - connected, S - static, R - RIP, B - BGP, D - EIGRP, O - OSPF
Gateway of last resort is 10.1.1.254 to network 0.0.0.0

S 192.168.100.0/24 [1/0] via 10.1.1.1
D 192.168.100.160/27 [90/2170112] via 10.1.1.2
O 192.168.100.176/28 [110/40] via 10.1.1.3, GigabitEthernet0/0/2
S 192.168.100.180/30 [1/0] via 10.1.1.4
S* 0.0.0.0/0 [1/0] via 10.1.1.254

Which next-hop IP address will the router select to forward an incoming packet destined for host 192.168.100.178?

Show answer & explanation

Answer: 10.1.1.3

Answer

10.1.1.3
When a router receives a packet, it first evaluates all matching routes in the routing table using the Longest Prefix Match (LPM) rule. The destination address 192.168.100.178 matches four routes in the table: 0.0.0.0/0, 192.168.100.0/24, 192.168.100.160/27 (range .160–.191), and 192.168.100.176/28 (range .176–.191). Among these valid matches, 192.168.100.176/28 has the longest subnet mask (/28 = 28 matching bits). Therefore, the router selects this route and forwards the packet to next-hop IP 10.1.1.3.

Step-by-Step Solution

1
Identify all matching candidate routes for destination IP 192.168.100.178.
Candidate matching routes are 0.0.0.0/0, 192.168.100.0/24, 192.168.100.160/27, and 192.168.100.176/28.
Route 192.168.100.180/30 covers range .180-.183 and does NOT match IP .178.
2
Compare the prefix lengths of all valid matching candidate routes.
Prefix lengths are /0, /24, /27, and /28.
Router forwarding logic relies on Longest Prefix Match (LPM) as the primary criteria before Administrative Distance or Metric are evaluated.
3
Select the route with the longest prefix mask.
The route for 192.168.100.176/28 has the longest matching prefix (/28).
192.168.100.176/28 matches 28 bits, which is longer than /27, /24, or /0.
4
Determine the next-hop IP associated with the winning route.
The next-hop IP is 10.1.1.3.
The routing entry specifies 'O 192.168.100.176/28 [110/40] via 10.1.1.3'.

Key Concept

Router Forwarding Decision Logic (Longest Prefix Match precedence over Administrative Distance and Metric)
Question 158Question

Refer to the following routing table snippet from a Cisco router:

text
Codes: C - connected, S - static, O - OSPF, D - EIGRP

Gateway of last resort is not set

O 10.50.16.0/20 [110/50] via 192.168.1.1, 00:04:12, GigabitEthernet0/0
D 10.50.24.0/22 [90/307200] via 192.168.2.2, 00:12:45, GigabitEthernet0/1
S 10.50.25.0/24 [1/0] via 192.168.3.3
O 10.50.25.128/26 [110/30] via 192.168.4.4, 00:01:10, GigabitEthernet0/2

A packet arriving at the router is destined for host address 10.50.25.14010.50.25.140. Which two statements accurately describe how the router processes and forwards this packet? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: The router selects the route entry 10.50.25.128/26 because /26 represents the longest matching prefix for the destination address.; The packet will be forwarded out of interface GigabitEthernet0/2 toward next-hop IP 192.168.4.4.

Answer

The router selects the route entry for 10.50.25.128/26 because /26 is the longest prefix match for destination IP 10.50.25.140, and consequently forwards the packet out of interface GigabitEthernet0/2 to next-hop 192.168.4.4.
When a router receives an IP packet, it compares the destination IP address against all routing table entries and selects the route with the most specific subnet mask (longest prefix match). Address 10.50.25.14010.50.25.140 matches 10.50.25.128/2610.50.25.128/26 (range 10.50.25.12810.50.25.128 to 10.50.25.19110.50.25.191). Because /26/26 is longer than /24/24, /22/22, and /20/20, the router chooses this route and forwards the traffic via interface GigabitEthernet0/2 to next-hop 192.168.4.4192.168.4.4.

Step-by-Step Solution

1
Determine which routing table entries match the destination IP address 10.50.25.140.
All four routes match the destination: 10.50.16.0/20, 10.50.24.0/22, 10.50.25.0/24, and 10.50.25.128/26.
10.50.25.140 falls within the address range of each of these four subnet prefixes.
2
Apply the Longest Prefix Match (LPM) rule to select the best route.
The route 10.50.25.128/26 is chosen because its prefix length (/26) is the most specific.
Prefix length always takes priority over Administrative Distance and routing metrics during route lookup.
3
Identify the forwarding exit interface and next-hop address associated with the winning route.
Next-hop: 192.168.4.4, Exit interface: GigabitEthernet0/2.
The routing table entry specifies these forwarding parameters for 10.50.25.128/26.

Key Concept

Router Forwarding Decision Logic (Longest Prefix Match)
Question 159Question

Examine the following IPv4 routing table output from a Cisco router:

text
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

192.168.10.0/24 is subnetted, 3 subnets
O 192.168.10.0/24 [110/20] via 10.1.1.1, 00:05:12, GigabitEthernet0/0
D 192.168.10.0/28 [90/307200] via 10.1.1.2, 00:12:45, GigabitEthernet0/1
S 192.168.10.0/26 [1/0] via 10.1.1.3

The router receives a packet destined for IP address 192.168.10.14. Which next-hop IP address will the router use to forward this packet?

Show answer & explanation

Answer: 10.1.1.2

Answer

The router forwards the packet to next-hop address 10.1.1.2 because 192.168.10.0/28 is the longest prefix match for destination IP address 192.168.10.14.
When a router receives a packet, it compares the destination IP address against all entries in its routing table and selects the route with the most specific match (longest subnet mask length). Destination IP 192.168.10.14 matches the /24, /26, and /28 prefixes. Because /28 is the longest prefix mask (255.255.255.240), the router uses the route pointing to next-hop 10.1.1.2.

Step-by-Step Solution

1
Evaluate all routing table entries to determine which prefixes contain destination IP 192.168.10.14.
The IP address 192.168.10.14 falls within 192.168.10.0/24 (host range .1 to .254), 192.168.10.0/26 (host range .1 to .62), and 192.168.10.0/28 (host range .1 to .14).
Before comparing protocol metrics or administrative distance, the router must identify all candidate routes matching the destination IP.
2
Apply the Longest Prefix Match (LPM) rule by comparing the subnet mask lengths of matching routes.
The prefix length /28 is longer (more specific) than /26 and /24.
Cisco routers always prefer the route with the longest matching prefix length regardless of administrative distance or metric.
3
Identify the next-hop address associated with the chosen /28 route entry.
The entry 'D 192.168.10.0/28 ... via 10.1.1.2' specifies next-hop 10.1.1.2.
The forwarding decision uses the next-hop IP associated with the longest matching route entry.

Key Concept

Longest Prefix Match Rule
Question 160Question

Refer to the following partial routing table output from router R1:

text
Codes: C - connected, S - static, R - RIP, B - BGP, O - OSPF, D - EIGRP

Gateway of last resort is 192.168.5.2 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 192.168.5.2
B 10.140.0.0/16 [20/0] via 192.168.4.2, 01:22:00, GigabitEthernet0/0/0
S 10.140.24.0/24 [1/0] via 192.168.3.2
O 10.140.24.0/25 [110/20] via 192.168.1.2, 00:14:22, GigabitEthernet0/0/1
D 10.140.24.64/28 [90/307200] via 192.168.2.2, 00:05:10, GigabitEthernet0/0/2

Router R1 receives an IP packet addressed to 10.140.24.6710.140.24.67. Which egress interface and next-hop IP address will R1 use to forward this packet?

Show answer & explanation

Answer: Interface GigabitEthernet0/0/2 with next-hop IP address 192.168.2.2

Answer

Interface GigabitEthernet0/0/2 with next-hop IP address 192.168.2.2
When a router makes a packet forwarding decision, it evaluates all matching routing table entries using the Longest Prefix Match (LPM) rule first. For destination IP 10.140.24.6710.140.24.67, the matching prefixes are /0/0, /16/16, /24/24, /25/25, and /28/28. The /28/28 prefix (10.140.24.64/2810.140.24.64/28) is the most specific match. Therefore, R1 forwards the packet to next-hop 192.168.2.2192.168.2.2 out interface GigabitEthernet0/0/2.

Step-by-Step Solution

1
Evaluate all candidate routes in the routing table to find which subnets contain the target IP 10.140.24.6710.140.24.67.
Candidate matching routes are: 0.0.0.0/00.0.0.0/0, 10.140.0.0/1610.140.0.0/16, 10.140.24.0/2410.140.24.0/24, 10.140.24.0/2510.140.24.0/25 (range .0–.127), and 10.140.24.64/2810.140.24.64/28 (range .64–.79).
Before comparing administrative distance or metric, a router determines all routes that mathematically match the destination address.
2
Determine the prefix length (number of subnet mask bits) for each matching candidate route.
0.0.0.0/00.0.0.0/0 has prefix length /0; 10.140.0.0/1610.140.0.0/16 has prefix length /16; 10.140.24.0/2410.140.24.0/24 has /24; 10.140.24.0/2510.140.24.0/25 has /25; 10.140.24.64/2810.140.24.64/28 has /28.
The fundamental forwarding rule (Longest Prefix Match) dictates that the route with the highest number of matching network bits is chosen.
3
Select the route with the longest prefix match.
The route 10.140.24.64/2810.140.24.64/28 has the longest prefix length (/28 > /25 > /24 > /16 > /0).
The router selects 10.140.24.64/2810.140.24.64/28 pointing to next-hop 192.168.2.2192.168.2.2 via exit interface GigabitEthernet0/0/2. Administrative distance is not evaluated across routes with different prefix lengths.

Key Concept

Longest Prefix Match Rule
Estimated Time:1m 30s
PreviousPage 8 / 25Next