Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 05-16-2011, 08:40 AM   #1
LQ Newbie
Registered: May 2011
Posts: 1

Rep: Reputation: 0
Question Debian 6: iptables blocking certain IP ranges on a certain port range

Hi, I am currently running Debian 6. I would like to know if there is a way and how i would go about blocking a certain IP range from connecting to my server within a certain port range. Say for example.

i want to block ip range 123.123.123.* from connecting to my server on the ports 33000 - 43000. But, i want to allow them to connect on any other port range, and i want to be able to allow connections from my server to the blocked ip range on those same ports. so, blocking incoming only on the above port range.

using iptables.

Last edited by templar; 05-16-2011 at 09:04 AM.
Old 05-16-2011, 11:23 AM   #2
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 96
-A INPUT -p tcp -m tcp -s --dport 33000:43000 -j DROP
1 members found this post helpful.


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
Blocking an ip address range within iptables kaplan71 Linux - Security 4 03-31-2009 02:55 PM
iptables help please with blocking range of IPs lleb Linux - Software 7 02-26-2007 10:09 AM
Firestarter - iptables and blocking ranges ithawtewrong Linux - Security 4 11-04-2006 01:41 PM
Forwarding port ranges using iptables --to ? ivj Linux - Networking 13 10-13-2004 03:05 AM
Blocking Iptables Ranges SuperSadSmile Linux - Security 6 02-09-2004 02:57 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:37 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