LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 05-16-2011, 09:40 AM   #1
templar
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 10:04 AM.
 
Old 05-16-2011, 12:23 PM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

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


Reply


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


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

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