Understand, Learn and Implement.. LINUX / UNIX DEVOPS CONTAINERS OPENSHIFT KUBERNETES DEVOPS TOOLS VIRTUALIZATION STORAGE BACKUP SCRIPTS MONITORING MIDDLEWARE

Monday, January 19, 2015

Blocking an IP address in Linux

Sometimes, you may need to ban the IP address which is vulnerabe or some security threat alerts.

In Linux, banning an IP address can be done very easily with netfilter/iptables framework:
$ sudo iptables -A INPUT -s 192.168.248.128 -p TCP -j DROP
If you want to ban a whole IP address block, you can also do it as easily:
$ sudo iptables -A INPUT -s 192.168.248.0/24 -p TCP -j DROP

0 comments:

Post a Comment