BIP KB:
How To Block IP Addresses Using IPtables
Article By samantha
![]() |
The following article describes various ways to block IPs using the built-in RedHat firewall, iptables. The following command will drop all incoming connections from IP xx.xx.xx.xx: |
iptables -I INPUT -s xx.xx.xx.xx -j DROP
To block a range, such as xx.xx.xx.* specify the CIDR block as follows:
iptables -I INPUT -s xx.xx.xx.0/24 -j DROP
If you wanted to later remove this entry you would replace the -I with -D as follows:
iptables -D INPUT -s xx.xx.xx.xx -j DROP
iptables -D INPUT -s xx.xx.xx.0/24 -j DROP
Tags: don't wait to educate, Linux, Firewall, how-to, iptables
Spin Up A VPS Server In No Time Flat
Simple Setup
Full Root Access
Straightforward Pricing
DEPLOY A SECURE VPS SERVER TODAY!Leave a Reply
Feedbacks
![]() This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. |