Block IP Addresses With IPtables:
This command will simply drop any packet coming from the address 25.55.55.55. To list the chains:
iptables -I INPUT -s 25.55.55.55 -j DROP
The -n sticks with just IP addresses, rather than resolving the name. This is useful if you have a lot of IP addresses. It can take a lot of time to resolve all of the addresses.
iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP all — 25.55.55.55 0.0.0.0/0
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP all — 25.55.55.55 0.0.0.0/0
If you later decide that you don’t want to drop packets from a particular host, use the -D option instead of -I:
iptables -D INPUT -s 25.55.55.55 -j DROP
Leave a Reply
You must be logged in to post a comment.