LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-23-2004, 01:56 AM   #1
jomy
Member
 
Registered: Jul 2004
Location: UAE
Distribution: RedHat
Posts: 93

Rep: Reputation: 15
specifying a range of IP in IPTABLES


Hi,


How can I specify a range of IP Addresses in iptables.

for eg:

iptables -A INPUT -s 192.168.0.20 -j ACCEPT

How can I give a range here if I want to allow input for the range of ip addresses from 192.168.0.20-192.168.0.30


Regards,

Jomy
 
Old 12-23-2004, 07:30 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
The usual way iptables works is using a netmask to do this. So the kind of rule to accept all of 192.168.0.0 would be

iptables -A INPUT -s 192.168.0.0/24 -j ACCEPT

However since you want to be more specific, you might try

iptables -A INPUT -s 192.168.0.20-192.168.0.30 -j ACCEPT

I know that sort of range specification works in the NAT and DNAT tables, but I've never tried it with INPUT.

You also might have a look throught the iptables tutorial for more info.
 
  


Reply



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 - dropping an ip *range* chibi Linux - Security 6 12-17-2005 08:22 PM
iptables allowing a range adm1329 Linux - Networking 2 02-01-2005 01:04 PM
ip range in iptables masterlloyd Linux - Security 1 01-11-2005 02:00 AM
how to do this.. IPTABLES IP Range DROP latino Linux - Security 1 01-02-2004 01:41 AM
iptables: source range Carlee Linux - Security 8 09-01-2003 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:59 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
Open Source Consulting | Domain Registration