0

Does static routing (that is based on admin configured routing table) supports subnetting? If so how does the route is beeing picked? Does the network mask send along with IP address is used instead of the mask associated with the route record to determine the right route to select?

2 Answers 2

2

A routing table has the destination network and mask (or mask length from which the mask can be figured), and the next hop for the route.

When you statically configure a route, you must supply all three pieces: Destination network, Mask (or Mask Length), and Next Hop address (or interface).

For example, in a Cisco router, a static route configuration looks like:

ip route 172.31.0.0 255.255.0.0 172.31.6.6

or

ip route 192.168.1.0 255.255.0.0 Ethernet0

You may have multiple, overlapping or equal networks in the routing table. A router will choose the route with the longest match in the routing table. That is, basically, the longest network mask.

For example if you have a packet destined for 10.1.2.3, and your routing table has:

10.0.0.0/8   10.9.8.7
10.1.0.0/16  10.8.7.6
10.1.2.0/24  10.7.6.5

The the packet will be forwarded to 10.7.6.5 because that route has the longest match, even though all three routes match the destination address on the packet.

How a router deals with equal length matches can get complicated, and it can depend on configurations or how the router learned about the route. Routers learn routes in three ways:

  1. Directly connected networks
  2. Statically configured routes
  3. From another router through a routing protocol

Equal routes are generally preferred in that order because the certainty of a route is usually in that order. Some routers let you modify that.

4
  • What do You mean "Routers learn routes in three ways"? Does it mean that just routing table is build in these 3 steps?
    – Mulligan
    Feb 27, 2017 at 9:48
  • No. It means that a router can learn about routes in any or all of those three ways.
    – Ron Maupin
    Feb 27, 2017 at 11:11
  • Can You clear the first way "Directly connected networks"? Does this way involves a dynamic routing?
    – Mulligan
    Feb 28, 2017 at 9:40
  • No, that is the last way. A directly connected network is just what it sounds like. It is a network that is directly connected to the router. The router inherently knows about the network because it is configured on one of the router's interfaces.
    – Ron Maupin
    Feb 28, 2017 at 14:11
0

Static routing support both classful and classless addresses. Usually when we use classless addresses, It is also subnetted. Some dynamic routing protocol not supported subnetting and classless address like RIPv1. So, there is no issue with static routing from subnetting.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .