LAN Routing
cancel
Showing results for 
Search instead for 
Did you mean: 

Help to written a subnet in ACLs

nandoin
Occasional Contributor

Help to written a subnet in ACLs

Hello everyone!

I'm having troubles when going to configure ACLs in Switch 1920 and 5120.

E.g: I need to apply an ACL like this:

rule permit ip source (192.168.50.128/28 - 255.255.255.240) destination any

how do I write the subnet in the correct format? I know /24 is written this way 0.0.0.255 and how /30 /29 /28 /27 are written?

 

Thanks!

1 REPLY
Philippe_D
Advisor

Re: Help to written a subnet in ACLs

Basically you write the hostbits as a 1 and the network bits as a 0.

So it is as you said the exact oposite of a subnet mask.

/24 = 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255 = 0.0.0.255

for a /30 this means that you have 2 host bits 1 and 2 1+2 = 3  That means a /30 would be 0.0.0.3

/29 = 1 + 2 + 4 = 7 = 0.0.0.7

/28 = 1 + 2 + 4 + 8 = 15 = 0.0.0.15

/27 = 1 + 2 + 4 + 8 + 16 = 31 = 0.0.0.31