# Lets block ip address in server with iptables

For example block all inbound traffic for 192.168.122.12 ip address.

iptables -A INPUT -s 192.168.122.12 -j DROP

And other example, block all subnet.

iptables -A INPUT -s 192.168.1.1/24 -j DROP

and after changing save the commands.

service iptables save

Thanks for reading.