LinuxQuestions.org
Review your favorite Linux distribution.
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 10-12-2007, 02:59 AM   #1
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Rep: Reputation: 30
Using IPTABLES on Multihomed Box


Hey guys in linux box i have 2 interfaces when using the INPUT,FORWARD, and OUTPUT chains Do you have to specify the interfaces were packets come and go?
 
Old 10-12-2007, 05:50 AM   #2
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
Technically you don't have to, but you most likely will if you are using a box that has more than one interface to it. Google "IPTables Tutorial" and select the first link. This will have everything you will ever want / need to know about IPTables.

HTH,

Centinul
 
Old 10-12-2007, 07:07 PM   #3
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
yeah ive been reading that tutorial actually but i dont know if i missed or didnt undsertand something coz i cant find anything saying what interfaces should packets go when there going to leave the firewall. and thinking about it, i think thats the job a router, right? does iptables do the routing to?
 
Old 10-12-2007, 07:23 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by SBN View Post
Hey guys in linux box i have 2 interfaces when using the INPUT,FORWARD, and OUTPUT chains Do you have to specify the interfaces were packets come and go?
Sometimes you'll want to specify that a rule only applies to packets coming into a certain interface. Other times you won't. For example, say I have a box with two interfaces, one for the LAN (let say it's eth0) and one for the WAN (let say it's eth1). I want to allow connections into my SSH daemon. I could do a:
Code:
iptables -A INPUT -p TCP --dport 22 -j ACCEPT
That would work, but it would allow people on both my LAN and WAN networks to connect. If I only want people on my LAN to connect, I need to specify the LAN interface:
Code:
iptables -A INPUT -p TCP -i eth0 --dport 22 -j ACCEPT
Now any packets which hit the WAN interface won't match this rule, and hence won't be sent to ACCEPT by it.

Quote:
i cant find anything saying what interfaces should packets go when there going to leave the firewall.
This is specified in your IP routing table. You can look at it with this command:
Code:
route

Last edited by win32sux; 10-12-2007 at 07:40 PM.
 
Old 10-12-2007, 07:48 PM   #5
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
Talking

ok thank you everything is becoming clearer...

 
  


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
UDP Response with a Multihomed NIC shinepuppy Linux - Networking 0 11-01-2006 08:53 AM
Routing Problem on Multihomed Machine rlh989 Linux - Networking 1 06-21-2006 10:33 PM
Multihomed Firewall (Working, but no Internet?) ridertech Linux - Networking 3 06-27-2005 11:52 PM
MultiHomed Network Problems w/ SuSe 9.2 rfn_jhardy Linux - Networking 1 05-11-2005 05:50 AM
Multihomed host routing problem.. srns Linux - Networking 3 10-15-2004 03:26 PM

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

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