Iptables

From DiLab
Jump to: navigation, search

Block an IP address

You might have found an IP address attacking your linux computer, for example, by looking at the /var/log/auth.log file. You can use iptables to block the 11.22.33.44 IP address to and from your linux computer:

sudo iptables -I INPUT -s 11.22.33.44 -j DROP
sudo iptables -I OUTPUT -d 11.22.33.44 -j DROP

You can also see the status of the blocked IP addresses:

sudo iptables -vnL