2

I know how to add all from a 111.222.63.xx:

sudo ufw allow from 111.222.63.0/24

But say I want to allow all from 111.222.xxx.xxx so all from 111.222.1.X all from 111.222.2.x, etc. How would would I do that, I tried all sorts of combinations, but none seem to work.

1 Answer 1

3

The /24 decides the range. If you want to allow all from 111.222.X.Y, use /16: 111.222.0.0/16. This is CIDR notation. In an IP address W.X.Y.Z, each of W, X, Y and Z uses 8 bits (an octect). The /24 is the mask, which decides how many bits of the address, starting from W, is to be considered for an operation. So /24 means the first three octects, W, X and Y. /16 is the first two octects, W and X, and so on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .