Subnet Mask

I have seen some subnet masks configured with all Zeros or


what is the difference ?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the net mask it says that you have an extranet as big as all the Internet if has such a net mask, theoretically he can ping every IP on the Internet (just theoretically)

the net mask it says that you have a subnet from only one host. For example if has such a net mask, he can ping only himself. He cannot ping any other host. Neither a host from the switch where is plugged in, with the IP, let's say,
jskfanAuthor Commented:
The way I know about
You are advertising just that IP address to other routers, which means other router do not know if you have other networks.

I saw that in wild card mask, but not in regular network mask
Fred MarshallPrincipalCommented:
Part of the answer will include "where?" you saw these.

For example, in a router rule, in conjunction with an IP address means "this IP address and no others".   I don't know that it's properly called a "subnet" mask but perhaps.  I say that because there is no proper networking subnet defined with network and broadcast addresses included in the "subnet".
The same subnet mask would not be used in a NIC configuration.
So, the use and context matter.

Probably not very appropriate here to repeat them, there are any number of good treatises if you Google.  (I don't often suggest that as it may be off-putting but in this case I believe that will serve you best).
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

jskfanAuthor Commented:
I meant when you are advertising a network off the router, not when assigning IP address to an interface.
what is the impact of using all zeros vs all 255s
all zeros on a router means the default route

On a routing table of a router: means that's the default route. If no other matches were found, the packet will follow the next hop specified on that line in a routing table means the next hop for only that host ( is the one specified at that line

The first line in a routing table is the default route and it has the lowest priority. Is used if no matches occurs.

The last line in a routing table has the maximum priority (first checked for a match)

The ruter order by himself the routes by net mask and distance

A routing table looks like in attach
How the routes are calculated:

For each entry in a routing table, perform a bit-wise logical AND between the destination IP address and the network mask. Compare the result with the network ID of the entry for a match.
The list of matching routes is compiled. The route that has the longest match (the route that matched the most amount of bits with the destination IP address) is chosen. The longest matching route is the most specific route to the destination IP address. If multiple entries with the longest match are found (multiple routes to the same network ID, for example), the router uses the lowest metric to select the best route.
Don JohnstonInstructorCommented:
Here's how I explain it:

The advertised network consists of an address and mask. The portion of the address that corresponds to 1's in the mask are relevant.  The portion of the address that corresponds to 0's are not (relevant).  So would mean that 172.16.1 are the relevant part of the network address.  The zeros in the mask simply mean that the portion of the address is not significant.

As for how the router uses these entries, assuming that you have a router with the following entries in the routing table: (Entry A) (Entry B) (Entry C) (Entry D) (Entry E)

If the router receives a packet with the destination address of, it will use entry A since that is a perfect match.  Routers will always prefer the longest match.

If the router receives a packet with the destination address of, it will use entry B since that is longest matching entry  (A is not a match at all and B is a longer match than C). Or put another way, is this packet going to 172.16.1.I-don't-care?

A packet with the destination address of will have the router using entry D. Or using the same analogy as above: Is this packet going to 172.I-don't-care.I-don't-care.I-don't-care? If yes, then entry D is the choice.  But remember, that's only if there isn't a longer match.

Finally, if the router receives a packet going to it will be forced to use entry E. And once again, that basically means the destination network of I-don't-care.I-don't-care.I-don't-care.I-don't-care.

Fred MarshallPrincipalCommented:
It appears that folks have confused a mask with a address.
The question is about masks.
jskfanAuthor Commented:
This is my question:

let' say you have R1

Router OSPF 1

To my understanding you are advertising single IP address instead of a subnet

I am not sure about this when you advertise
Don JohnstonInstructorCommented:
Not correct.

The network statement in OSPF does not (specifically) indicate a network to advertise. It indicates which interfaces OSPF is enabled on. Now when OSPF is enabled on an interface, the network connected to that interface is advertised.

In your example, OSPF is enabled on the interface with an IP address of (exactly)


network (area 2)

Would enable OSPF on any interface with an IP address of 10.10.anything.anything.

OSPF network statements use wildcard (or inverse) masks which basically mean that they are the opposite of traditional masks.  Which means that 0's indicate the relevant part of the address and 1's indicate the part of the address which is not relevant.

Context is important in these types of questions. ;-)
jskfanAuthor Commented:
I believe I saw the example in BGP to correct my self.

I am still not sure the difference between
Don JohnstonInstructorCommented:
Well in BGP, the network statement does indicate a network to advertise.
I am still not sure the difference between
That depends entirely on where this statement would be used.

In BGP, you would never use the all zeros mask since that would mean that the entire address you're advertising is not relevant.  An all ones could be used but that would be highly unlikely.

The thing is this.  The mask values are very dependent on where it's used.  i.e. a BGP network statement, an OSPF network statement, a static route, etc.

So before we can go any further, we must know where this mask will be used.
Fred MarshallPrincipalCommented:
Don Johnston is echoing what I said earlier with good reason.
It all depends on the use / where / what kind of machine and what settings specifically and the context if there's any context left after the first part.

I suppose I could get silly just to make sure there's understanding: is 11111111 11111111 11111111 11111111
and                   is 00000000 00000000 00000000 00000000

So, that shows a clear difference.
But I don't think that's what you're asking.
I think the question is this:
"What is the difference in MEANING / INTERPRETATION of the two?"
And, that's why it depends a lot on where it's used because the meaning / interpretation / intent will vary.

Most places will mean what I said earlier:  "this IP address and no other".  This might be used in a firewall rule where you list the scope of IP addresses that the rule applies to.  It might be used in a web filter to refer to a single public address.  etc.

I can't give you a good example of a mask that's and I think others have said it won't work in many contexts.

So maybe trying to differentiate between the two is a hard way to go.  Maybe figuring out when to use one of them in some useful context is a good way.  Then figure out when to use the other one in some useful context would also be a good way.  But to somehow compare them is rather like apples and oranges.

I believe it's much more common for to be a mask, as you've asked about.  And, is more likely to be used as an address as in "default route".  But, again, the interpretations vary.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
Thank you.....I will read about it later
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.