LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-12-2003, 11:37 AM   #1
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Rep: Reputation: 30
iptables Question


I'm just now starting to mess with setting up my linux box as a router. I have it up and runnig now, but I don't entirely understand how. The question I have is, what causes a packet to go to the FORWARD chain? My default policy for INPUT is ACCEPT and I have no rules. Same for OUTPUT. All the rules are on the FORWARD chain, but I don't see what causes packets to jump to that chain. Help?
 
Old 12-12-2003, 02:19 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
FORWARD is used for packets that must pass through the box to get to their destination.

For local packets, the destination ip address is somewhere in the Internet, so the routing table decides they have to go thru' FORWARD. This is called using the box as a Gateway.

For incoming packets, the nat PREROUTING table needs to give the packets an address that is in the local network before they go thru' the FORWARD chain. This is called DNAT, 'destination network address translation'.

Have a read of his tutorial for extra indepth info.

Last edited by peter_robb; 12-12-2003 at 02:20 PM.
 
Old 12-13-2003, 03:20 PM   #3
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Original Poster
Rep: Reputation: 30
I don't think I understand yet.

When a packet is received, the first chain it hits is the INPUT chain, right? And if there are no rules on the INPUT chain and the default policy for that chain is ACCEPT, then what happens after it hits the default policy? There's no jump involved. Does it automatically go to the FORWARD chain at that point or what?

Also, how do you indicate that all incoming packets on a particular interface are destined for the local machine, and not to be routed? I want my linux machine to run a few servers (HTTP, VNC, FTP, SSH, etc), and it has to respond to incoming requests rather than dropping or forwarding them.
 
Old 12-14-2003, 12:02 AM   #4
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Original Poster
Rep: Reputation: 30
Okay, wow I'm an idiot. I totally understand how the FORWARD chain is used now. I just was misreading your post in a terrible way.

Now I just need to know how to indicate that incoming requests on certain protocols need to be handled by the linux box (on which the firewall runs).
 
  


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 question THE RADICAL Linux - Security 4 12-15-2005 03:12 AM
iptables question iomari Linux - Security 4 01-13-2005 12:14 AM
Iptables Question? unixfreak Linux - Security 1 09-01-2004 08:23 PM
IPtables Question jacovds Linux - Security 10 11-17-2003 09:46 AM
iptables question Texicle Slackware 7 01-19-2003 12:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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