Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

routing subnets

Hi All,

I currently have a route set in my router like the following:

ip route <next hop>

It has come to my attention that inside my wan I will have need to route something like the following:

ip route <next hop2>

Do I enter this just as it is above seeing as the entire /21 is stated in the first route but need to go to different places. I guess I am asking if the second will work even if I have the first.




Re: routing subnets

Yeap, it will work. The router does it's routing table look up and does it matching with the longest mask.

Please rate helpful posts.


Re: routing subnets

your new route will work although........

the 30 bit ip route does step into the 21 bit ip route boundries, as is technically a host of

a simple new route to the new 30 bit subnet will work for two networks connected but as the network edge expands and routing protocols are used, this will become an issue that may need to be corrected.

i would think of separating the two subnets logically within a single supernet.


Re: routing subnets

It depends.

The biggest issue will be a device on the /21 that attempts to get to the /30 net. It will think that it is local and ARP for it. If the router that owns the gate for the /21 is running proxy arp and also contains the route to the /30 it will respond and correctly route the packet. If it does not have the specific route or proxy arp is not enabled it will not work.

Traffic flowing from the /30 to the /21 will work since that traffic is normal layer 3.

New Member

Re: routing subnets

hmm, well maybe more info will help.

The deal is, my provider asked someone at my company for a /21 before I was employed here and it was given. the wan routers were given addresses from this /21. I am reworking my entire WAN but I wish for them to run in tandem so that I convernt sites over at my pace. For the new WAN, I am still using addresses inside this /21 but out through a different interface. I need a way to route the new wan, but for ease the engineer before me just did a route for the entire /21 out through a specific interface. The route I have currently will go away after I get all of my sites converted, but for the mean time I need to be able to route to them. What is the best way for me to handle this if not what I have stated above?



Re: routing subnets

if you could provide all the subnets in use then it will be ez to determine what we have to work with as far as moving forward.

keep in mind it will be a best practice to keep all subnets as small as possible while still allowing room for growth but also in a heirarchy that allows for subnet(s) additions.

ie: if you have 390 hosts that need to talk to the network and you expect mild expansion of the number of hosts, then perhaps a 2046 host subnet is too inefficient. try to subnet it even further if possible.

how many hosts on your subnet? this subnet can hold upto 2046 hosts. (quite a bit in todays subnetted, VLANed world)

Re: routing subnets

Routes are chosen and built in the routing table based on the routing protocol's administrative distance. The routes learned from the routing protocol with the lowest administrative distance are installed in the routing table. If there are multiple paths to the same destination from a single routing protocol, then the multiple paths would have the same administrative distance and the best path is selected based on the metrics. With your example both are static routes which would give them the same administrative distance.

Making Forwarding Decisions

Let's look at the three routes we just installed in the routing table, and see how they look on the router.

router# show ip route


D [90/25789217] via

R [120/4] via

O [110/229840] via


If a packet arrives on a router interface destined for, which route would the router choose? It depends on the prefix length, or the number of bits set in the subnet mask. Longer prefixes are always preferred over shorter ones when forwarding a packet.

In this case, a packet destined to is directed toward, because falls within the network ( to It also falls within the other two routes available, but the has the longest prefix within the routing table (26 bits verses 24 or 19 bits).

Likewise, if a packet destined for arrives on one of the router's interfaces, it's forwarded to, because doesn't fall within ( through, but it does fall within the destination ( through Again, it also falls into the range covered by, but has a longer prefix length.

In your case packets destined to or .42 it will take the route with the longest prefix match which is and for packets destined to it will take the because it does not fall into subnet and the longest prefix matching that destination is

Please rate helpful posts.


Re: routing subnets

If there is no overlap at the device level you should be fine. Routers always use the most specific route.

It is end devices that you do not want to overlap.

As long as the routers on this /21 network have some kind of default route back to this core router it will work. When you move each segment it will lose this route and should take the default back. The main router will have the new route to the new interface and will work. Again you will need some form of default route back to this core router.