Differences
This shows you the differences between two versions of the page.
server-administration:blocking-using-iptables [2009-10-14 22:56:32] garrett.plasky created |
server-administration:blocking-using-iptables [2011-07-01 19:12:54] (current) garrett.plasky Approved |
||
---|---|---|---|
Line 2: | Line 2: | ||
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: | 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: | ||
- | <code console># iptables -I INPUT -s xx.xx.xx.xx -j DROP</code> | + | <sxh shell> |
To block a range, such as xx.xx.xx.* specify the CIDR block as follows: | To block a range, such as xx.xx.xx.* specify the CIDR block as follows: | ||
- | <code console># iptables -I INPUT -s xx.xx.xx.0/ | + | <sxh shell> |
If you wanted to later remove this entry you would replace the -I with -D as follows: | If you wanted to later remove this entry you would replace the -I with -D as follows: | ||
- | <code console># iptables -D INPUT -s xx.xx.xx.xx -j DROP | + | <sxh shell> |
- | # iptables -D INPUT -s xx.xx.xx.0/ | + | iptables -D INPUT -s xx.xx.xx.0/ |
{{tag> | {{tag> |