MTCRE Lab 1.5 - More Specific Routes
In IP routing, routers must make forwarding decisions when multiple routes to overlapping networks exist in the routing table. The longest-prefix match (also known as more specific route selection) is a fundamental principle that governs how routers choose the best path when multiple routes could potentially match a destination IP address.
When a router receives a packet, it examines all routes in its routing table that could reach the destination. If multiple routes match, the router always selects the route with the longest subnet mask (most specific prefix). This allows network administrators to create exception routes for specific subnets while maintaining broader default routes for general traffic.
For example, if a routing table contains:
- Route A: 10.0.0.0/8 via Gateway X
- Route B: 10.10.10.0/24 via Gateway Y
A packet destined for 10.10.10.5 matches both routes, but the router will choose Route B because /24 is more specific than /8. Meanwhile, a packet destined for 10.20.30.40 only matches Route A and will use Gateway X.
This lab demonstrates the longest-prefix match principle using a practical network topology. You will configure overlapping static routes with different prefix lengths and observe how RouterOS 7.x selects the most specific route for packet forwarding. Understanding this concept is critical for routing optimization, traffic engineering, and troubleshooting routing issues.
Terminology Definitions
Longest-Prefix Match (LPM): A routing algorithm where the router selects the route with the longest subnet mask (most specific prefix) when multiple routes match a destination IP address. This is also called "most specific route selection."
Prefix Length: The number of bits in the subnet mask that define the network portion of an IP address, expressed in CIDR notation (e.g., /24 means 24 bits are used for the network). Longer prefixes (e.g., /24) are more specific than shorter prefixes (e.g., /8).
Route Specificity: A measure of how precisely a route defines a destination network. A route to 192.168.1.0/24 is more specific than a route to 192.168.0.0/16, which in turn is more specific than a route to 0.0.0.0/0 (default route).
Overlapping Routes: Multiple routes in a routing table that cover the same or partially overlapping IP address ranges. For example, 10.0.0.0/8 and 10.10.10.0/24 overlap because the /24 network is contained within the /8 network.
Static Route: A manually configured route that does not change unless explicitly modified by an administrator. Static routes remain in the routing table regardless of network topology changes.
Default Route: A route to 0.0.0.0/0, which matches all possible IP addresses. It is the least specific route and is used only when no more specific route matches the destination.
Forwarding Information Base (FIB): The routing table used by the router's forwarding engine to make packet forwarding decisions. Only active routes are installed in the FIB.
Lab
Network Topology
This lab uses the following topology:
- VPC connected to R1 (192.168.1.0/24)
- R1 connected to R2 (192.168.12.0/24)
- R1 connected to R3 (192.168.13.0/24)
- R2 connected to R4 (192.168.14.0/24)
- R3 connected to R4 (192.168.15.0/24)
- R4 has a loopback interface (10.10.10.1/24)
Lab Objectives
By completing this lab, you will:
- Configure overlapping static routes with different prefix lengths
- Observe longest-prefix match route selection in action
- Use traceroute to verify which path traffic takes based on route specificity
- Understand how to create exception routes for specific subnets
- Learn to read and interpret the RouterOS routing table