LinuxQuestions.org
Help answer threads with 0 replies.
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 01-19-2011, 11:42 AM   #1
sketch429
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
Question iptables with multiple NIC


hey, im trying to set up an iptables firewall.

my setup is as follows (netkit setup btw):

admin pc -- eth0 @ 192.168.1.161/24 --- lanA
-- eth1 @ 146.192.161.112/24 --- lanB
-- eth2 @ 10.10.121.116/24 --- lanC

lanA(intranet) -- database server @ 192.168.1.206
-- DNS @ 192.168.1.211

lanB -- gateway --eth0 @ 146.192.161.254
--eth1 @ 146.192.161.253
internet -- eth0 @ 146.192.161.113 ( purely for purposes of simulating internet traffic)

lanC -- web-server -- eth0 @ 10.10.121.211


I have iptables setup with default policies to DROP all traffic.

Now what i need to do is to allow intranet users (DB & DNS) access to web (tcp port 80) but deny any internet originating packets getting to the intranet.

i assume the use of state selecting (NEW,ESTABLISHED,RELATED) is to be used but i am at a loss as how to.

any help is greatly appreciated.

thanks

sketch
 
Old 01-19-2011, 12:23 PM   #2
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
The -i and -o parameters allow you to select incoming and outgoing (respectively) traffic on particular interfaces.

Then:
Code:
iptables -A FORWARD -o eth1 -p tcp -s 192.168.1.0/24 --dport 80 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
will allow traffic to port 80 out on the external interface from the lanA subnet, and any related traffic back in.
 
  


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 forward - multiple external to multiple internal astbis Linux - Networking 3 01-24-2008 04:27 PM
iptables configuration using multiple NIC karen.pertierra Linux - General 2 02-21-2007 02:09 AM
Multiple NIC Problem dklofas Linux - Networking 2 01-23-2006 11:58 AM
Samba 3 and multiple NIC Noerr Linux - Networking 0 01-08-2004 08:08 AM
Multiple IP on on NIC aceexpert Linux - General 3 05-28-2002 05:04 AM

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

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