HostOnNet Blog

iptables

iptables is firewall used in linux servers. This is a command line tool. Most other firewalls like uwf, csf, apf etc actually use iptables to do the blocking, they are just programs make it easy to work with iptables.

List Firewall rules

iptables -L -n

Flush Firewall rules

iptables -F

Block an IP

In this example, we block IP subnet 192.64.86.31/24.

iptables -I INPUT -s 192.64.86.31/24 -j DROP

Posted in Linux