Posted: Tue Jan 06, 2009 3:18 Post subject: Block IP Address
I have a Linksys WRT54GS v7.2 Router with DD-WRT Micro and i want to know how to block a ip address using telnet. not just block them from accessing 1 port, i want to block them from the entire router.
Can you guys please provide me how to block a IP address and how to unblock a IP address using Telnet.
if you just use Run commands, or even telnet, there is the possibility that the rules get lost when the interface restarts. Save firewall is the safest way once you're sure the rules work correctly.
However, do not store iptables -D in a firewall script without some checks in place to make sure it deletes the right thing. Otherwise you run the risk of deleting the wrong lines and breaking the configuration.
if you just use Run commands, or even telnet, there is the possibility that the rules get lost when the interface restarts. Save firewall is the safest way once you're sure the rules work correctly.
However, do not store iptables -D in a firewall script without some checks in place to make sure it deletes the right thing. Otherwise you run the risk of deleting the wrong lines and breaking the configuration.
Alright, Also for this iptables drop command this blocks me from connecting to the ip and the ip connecting to me correct?
this blocks me from connecting to the ip ... correct?
Not necessarily. It blocks the IP from connecting to you.
If you want to block in the other direction, you also need something like:
iptables -I FORWARD -s 192.168.1.0/24 -d IP_TO_BLOCK -j DROP
It's fairly easy to understand. -s is the source address and -d is the destination. -I means Insert a rule into the FORWARD chain and -j DROP means DROP.
In other words, if packet is sourced from 192.168.1.0/24 destined to IP_TO_BLOCK, it is DROPped.