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

subnet masking

can anyone explain to me (or point me to some links) about the effects of masking in the command, ip route destination_ip next_hop_ip.

New Member

Re: subnet masking

That will turn every bit on for the address mask, meaning that the route you specified is for that single host (/32).

Re: subnet masking

A packet whose destination ip matches this route, will use this route. All other ip addresses ( ones from the same destination network) wont use this route.

New Member

Re: subnet masking

This sets up a route to a specific host. What this is typically used for is to route traffic for one particular host differently than other hosts on his subnet. For example:

ip route

ip route

All traffic for subnet is routed through However, all traffic for host (as indicated by his mask) is routed through May be the host is special and deserves to have its traffic routed throgh a dedicated link. Remember the router always picks the matching route with the longest subnet mask to use. This is true no matter the order of the routes in the table, or source (routing protocol or static) of the route.

Another use for this trick is to "blackhole" undesirable destinations for short periods of time. For example, if you find someone visiting a porno web site at say,, you can use the following command to blackhole him:

ip route null 0

This drops all traffic to the porno site only.

Have fun!

CreatePlease to create content