Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-18-2004, 08:37 PM   #1
Registered: Jul 2004
Location: Mesquite, Texas
Distribution: currently retired
Posts: 31

Rep: Reputation: 15
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.

Old 11-18-2004, 08:47 PM   #2
Registered: Nov 2004
Location: Brisbane, Australia
Distribution: Fedora Core 5
Posts: 89

Rep: Reputation: 15
Something simple like this shoud be enough.

iptables -I INPUT -s -j DROP
Old 11-18-2004, 08:53 PM   #3
Registered: Jul 2004
Location: Mesquite, Texas
Distribution: currently retired
Posts: 31

Original Poster
Rep: Reputation: 15
*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.

Last edited by Davus; 11-18-2004 at 08:57 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables ban rule hypton Linux - Networking 1 03-09-2004 10:42 PM
using iptables to ban a subnet? Sm0k3 Linux - Networking 4 01-24-2004 03:25 PM
quick iptables question peok Linux - Networking 6 11-11-2003 02:34 PM
Should i use the eth0 ip address of my internet ip address when applying iptables ForumKid Linux - Security 2 01-03-2002 08:54 AM
Quick IP address question Jimbo Mahoney Linux - Networking 2 08-16-2001 05:50 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration