Deny or block access from Specific IP Address by IPtables Firewall

Deny or block access from Specific IP Address by IPtables Firewall

iptables

When we notify IP Address which is trying to attack our Server.

We can use IPtables to block or ban that IP Address temporarily.

iptables -A INPUT -s “$IP” -j DROP

iptables -A INPUT -s x.x.x.x -j DROP

We also can use IPtables to block specific Network

iptables -A INPUT -s x.x.x.x/24 -j DROP

Example:

iptables -A INPUT -s 44.21.24.100 -j DROP
iptables -A INPUT -s 44.21.24.101 -j DROP
iptables -A INPUT -s 44.21.24.102 -j DROP

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

That’s it. Thanks for using ITHelpblog.com.


 

 

Tags:  

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>