cancel
Showing results for
Did you mean:
Announcements
New Member

(netmask is 0.0.0.6) ? Why is it written like this?

-- from cisco router access-list

permit ip 209.110.32.105 0.0.0.6 any

-------

Why is the netmask written by 0.0.0.6 ?

thanks!

5 REPLIES
Red

Re: (netmask is 0.0.0.6) ? Why is it written like this?

This is the decimal representation of a binary digit. The last eight bits of the mask are 0000 0110. The number 105 in binary is: 0110 1001.

Your access-list matches all odd numbers between 105 an 111.

Leo

New Member

Re: (netmask is 0.0.0.6) ? Why is it written like this?

This is not a subnet mask. The 0.0.0.6 are access list parameters to define the portion of the Ip address that should be examined. This is also called wildcard mask. If we convert this into binary we will have the following:

Decimal Binary

Ip 209.110.32.105 11010001.01101110.00100000.01101001

Result 209.110.32.105 to 111 11010001.01101110.00100000.01101xx1

The last two x means that every address that does not have these binary positions in 1s will be blocked, thus, address between 105 and 111 will be allowed.

More generally, the wildcard mask means the following:

Bit positions of binary 0 mean that the access list compares the corresponding bit position in the IP address and makes sure it is equal to the same bit position in the address configured in the access-list statement. Bit positions of binary 1 are wildcards, those bit positions are immediately considered to be a match.

Red

Re: (netmask is 0.0.0.6) ? Why is it written like this?

You make one mistake in your reasoning:

as the least significant bit is not in the wildcard, the numbers will have to end with a one to pass the access-list. Thus as I already stated, this list only matches the odd numbers between 105 and 111.

105, 107, 109, 111 will pass.

106, 108, 110 wil fail while their LSB equals zero.

New Member

Re: (netmask is 0.0.0.6) ? Why is it written like this?

You're right. I assumed it was understood that since the last bit ends in 1 all binary numbers to be allowed would have to end in 1 for the given range. Now I understand why there was something "odd" missing in my answer.:-)

New Member