LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Quick iptables IP address ban? (https://www.linuxquestions.org/questions/linux-networking-3/quick-iptables-ip-address-ban-256645/)

Davus 11-18-2004 08:37 PM

Quick iptables IP address ban?
 
Hi, is there a quick iptables command that can be used to deny all traffic from a specified IP address? (Yes, I realize the data will still arrive, but the kernel will simply drop it.)
This would be useful in random situations, to just suddenly 'turn off' my server to a certain IP address. Thanks.

-Dave

Butt-Ugly 11-18-2004 08:47 PM

Something simple like this shoud be enough.

iptables -I INPUT -s xxx.xxx.xxx.xxx -j DROP

Davus 11-18-2004 08:53 PM

*Goes to test it*
I'll do this:

My laptop will ping the server, infinate loop. Then from my Linux desktop I'll do that command while SSH'd into the server and see if it drops. Thanks!

Uhh... Oops, it worked, banned desktop instead of laptop, got the addresses confused. Thanks. *SSH's in with PuTTY on laptop to fix my mistake* :$

Mm'kay, a simple iptables -F from my mom's box on PuTTY cleared it, I got bored and banned my laptop too.


All times are GMT -5. The time now is 10:56 AM.