03-12-2011 06:14 PM - edited 03-04-2019 11:43 AM
Hi, I imagine I need to build one ACL to match the following addresses:
135.7.183.0
135.7.184.0
I wrote the third octets in binary:
10110111 = 183
10111000 = 184
Then I did AND operation between 183 and 184 in binary:
10110000 = 176
and XOR operation as well to find mask:
10110111 = 183
10111000 = 184
Doing XOR is:
00001111 = 15
So in my calculation (I already used other methods), the access-list would be
access-list 1 permit 135.7.176.0 0.0.15.0
The problem is that this does not seem to match 183 and 184. What am I missing here please? It seems so simple but I do not know why this is failing...
Solved! Go to Solution.
03-12-2011 11:06 PM
Not sure what you are trying to do,
Are you trying to match this-
135.7.183.0/24
135.7.184.0/24
FYI- in 135.7.183.0/24 > 135.7.183.1- 135.7.183.254 is the host range, 135.7.183.0 is subnet id and 135.7.183.255 is the broadcast address.
The easiest way to do the above would be
access-list 1 permit 135.7.183.0 0.0.0.255
access-lsit 1 permit 135.7.184.0 0.0.0.255
Use the foll for better understanding:
http://www.subnet-calculator.com/subnet.php?net_class=B
Please rate the post if it helps.
03-12-2011 11:06 PM
Not sure what you are trying to do,
Are you trying to match this-
135.7.183.0/24
135.7.184.0/24
FYI- in 135.7.183.0/24 > 135.7.183.1- 135.7.183.254 is the host range, 135.7.183.0 is subnet id and 135.7.183.255 is the broadcast address.
The easiest way to do the above would be
access-list 1 permit 135.7.183.0 0.0.0.255
access-lsit 1 permit 135.7.184.0 0.0.0.255
Use the foll for better understanding:
http://www.subnet-calculator.com/subnet.php?net_class=B
Please rate the post if it helps.
03-13-2011 08:40 AM
In this case mask was not given. It is stricly match the 138.7.183.0 and 138.7.184.0 addresses (not network).
So OK I just wanted to confirm I was not getting crazy. In this case it is not possible to aggregate this into one entry. Thanks.
03-13-2011 12:16 AM
Hi
The logic that you used is correct, the only reason that this is not matching the traffic is because you have left the last octect as 0 in the mask. To match all the traffic the in both the subnets you need to have .255 in the mask in the last octet as shown below:
access-list 1 permit 135.7.176.0 0.0.15.255
else it would try to match only the network addresses 135.7.183.0 and 135.7.184.0 and will deny rest of the subnet IPs.
Regards,
Sujit
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide