4

I need to list all 192.168.1.X ips in one line. Will 192.168.1.* work?

iptables -A INPUT -p tcp --dport 22 -s 192.168.0.*/24 -j ACCEPT

Is what im wondering. This is not a router but rather a computer (Debian Jessie, x64)

1
  • 2
    Did you want "192.168.1.x" as in your text, or "192.168.0.x" as in your code snippet? Sep 20, 2016 at 13:03

1 Answer 1

9

Thats what the /24 is, it marks the CIDR block.

To allow all IPs for 192.168.1.*, you would use

192.168.1.0/24

Where as a single IP would be

192.168.1.123/32
0

You must log in to answer this question.

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