How to Block An IP from Accessing My Linux Server?

How to block an IP from accessing my Linux Server

In this tutorial we will learn how to block an IP or subnet address from your linux server or operating system.
In order to block an IP on Linux, we need to make use of the 'iptables' tool

Step 1. Log into the Linux shell as the root user.

Step 2 Type in the following command :

iptables -A input -s IP.ADD.RE.SS -j drop
service iptables save

Replace IP.ADD.RE.SS with the address you wish to block.

If you wish to unblock an IP address from the server, simply replace 'IP.ADD.RE.SS' with the address you wish to Unblock :

iptables -D input -s  IP.ADD.RE.SS  -j drop
service iptables save
© 2021 WPOven Inc. All rights reserved. WPOven® and WordPress® are registered trademarks.
WPOven INC is more than just a managed WordPress Hosting that offers more secured unlimited website hosting with it’s CDN ready worldwide Datacentres.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram