cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
405
Views
0
Helpful
3
Replies

subnet masking

gkandakai
Level 1
Level 1

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

3 Replies 3

james.feger
Level 1
Level 1

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

thisisshanky
Level 11
Level 11

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.

Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus

rng4
Level 1
Level 1

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 10.1.0.0 255.255.255.0 10.2.1.1

ip route 10.1.0.11 255.255.255.255 10.2.2.1

All traffic for subnet 10.1.0.0/24 is routed through 10.2.1.1. However, all traffic for host 10.1.0.11 (as indicated by his 255.255.255.255 mask) is routed through 10.2.2.1. May be the host 10.1.0.11 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, 10.99.99.99, you can use the following command to blackhole him:

ip route 10.99.99.99 255.255.255.255 null 0

This drops all traffic to the porno site only.

Have fun!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: