LinuxQuestions.org
Visit Jeremy's Blog.
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 06-04-2006, 12:47 PM   #1
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Rep: Reputation: 15
multiple sources with iptables


how can i accept two sources not in the same subnet to the same port in iptables?
 
Old 06-04-2006, 01:21 PM   #2
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Rep: Reputation: 30
I think this is what you are asking!?!

Code:
LAN="eth1"
WIFI_IP_RANGE="192.168.1.0/24"
LAN_IP_RANGE="192.168.0.0/24"

.....
$IPTABLES -A INPUT -p ALL -i $LAN -s $LAN_IP_RANGE -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $LAN -s $WIFI_IP_RANGE -j ACCEPT
 
Old 06-04-2006, 01:23 PM   #3
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Rep: Reputation: 30
oops,didn't read question properly

change -p ALL to -p n where n is the port number of interest.
 
Old 06-04-2006, 06:58 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 79
Quote:
Originally Posted by slzckboy
oops,didn't read question properly

change -p ALL to -p n where n is the port number of interest.
Someone must be tired . The -p option is for protocol. So you use
`iptables -p tcp' with either sport or dport, depending on what you want.
 
Old 06-05-2006, 01:27 AM   #5
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Rep: Reputation: 30
sorry for confusion.
 
  


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
snd-hda-intel sound from multiple sources at once wingcom Linux - Hardware 9 03-16-2006 01:51 PM
Sound from multiple sources Adrohak Linux - Software 5 05-01-2005 10:40 AM
Using same header file in multiple sources george_mercury Programming 2 02-25-2005 01:50 PM
gdb and multiple sources melinda_sayang Programming 0 04-03-2004 09:35 PM
NForce2 + 2.4.22 : Not able to play multiple sound sources muflon Linux - Hardware 0 09-21-2003 01:11 PM

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

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