LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-28-2010, 08:53 AM   #1
brgsousa
Member
 
Registered: Aug 2007
Location: Salvador, Brazil
Distribution: Debian, Ubuntu
Posts: 185

Rep: Reputation: 15
Iptables: specifying more than one network


Hi!
How can I add one more network to whis statement?
iptables -A INPUT -s ! 10.0.0.0/8 -j DROP

It should be something like
iptables -A INPUT -s ! 10.0.0.0/8,192.168.1.0/24 -j DROP

How can I make it possible?

Regards,
 
Old 09-28-2010, 08:59 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
just use two rules. or three. Don't specifically drop, drop / reject by default and explicitly allow:

iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -j DROP
 
Old 09-28-2010, 09:06 AM   #3
brgsousa
Member
 
Registered: Aug 2007
Location: Salvador, Brazil
Distribution: Debian, Ubuntu
Posts: 185

Original Poster
Rep: Reputation: 15
Yeah...
I was aware of that. The deal is I thought there was a way to do that...

But thanks anyway!
 
  


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
iptables cross network mad_penguin Linux - Newbie 4 10-26-2009 01:15 PM
Iptables for my network aamdevan Linux - Security 1 04-04-2009 11:46 AM
iptables: how to take a whole network in account? xpucto Linux - Security 2 03-15-2007 08:12 AM
Iptables-- internal network HopelessLinuxNewbie Linux - Security 3 07-27-2005 08:49 PM
iptables - network mask Metroid Linux - Security 4 11-09-2004 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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