Rule of routing #3 Longest Match

Consider the network such as the following.

On the back side of the Router4, there are the NW adresses of - The IP packet from PC#1 destined to these networks is like to through the Router1 - Router2 - Router4. In such a case, it is so efficient setting static route to summarized route with NextHop Router2 on Router1 rather than setting one by one /24 network addresses.

On the other hand, the network between Router3 and Router4 , is closer to Router3 than Router2, so you would like to set routing for with NextHop to Router3.

However, this are included in the range of of static route with NextHop to Router2 described earlier. Then,which route Router1 selects, Router2 or Router3?

In such a case, by the rule of Longest Match, Router2 is chosen.

This Longest Match, to enable the route information of a finer network preferentially (Longer subnetmask is preferred), that is a rule. Because of the fine more of the network of than, it is given priority, for example, when an IP packet destined for have come that can be transferred to the Router3.

It should be noted that the longest match takes precedence over the AD value.It is the administrative distance value is the AD value .

Default Route

Rule as described in Part 2, when the destination IP of the packet will come not in the routing table, the router will discard the packet, but it does not happen so much in reality.

In most cases, on the routing table are there the Default Route which is applied the previous Longest Match.

The Default Route represents the destination network address as, and it indicates that all of IP addresses is included.

By setting the Default Route, even though it is hard to find the route in Routing Table Entry according to the Longest Match order, it is inevitable to match to Default Route at last.

In the real world we set the Default Route to the exit of the Internet in most case.

For example, in figure earlier, when the Internet is connected to the previous router 3 it can be configured as shown below.

* of [S*] indicates the Default Route.


Copied title and URL