[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

iptables and nat



Hi,

I'm fiddling arround with iptables and I have some problems
understading how the tables and chains work with SNAT.

My network is setup as following:
eth0 is a static ip address
eth1 has ip 10.0.0.254 and connects to a switch with two other
computers on it.

When a packet comes from the internet with destination one of the
computers on the local lan, which route does it take?

Is it put straight away through the FORWARD chain or does it go
through the INPUT chain first?  

And when does the addresstanslation take place?  (I'm using SNAT)
When do I have to put the local address in the rules and when not?

And the other way arround (local lan -> internet)?

Am I correct when a packet from the local lan wants to go to the
gateway it goes straight through to the INPUT chain, gets processed
and goes to the OUTPUT?

And am I correct if I say that when I packet from the internet wants
to go to the static ip (e.g. apache running on the firewall) it is:
INPUT; process; OUPUT?

Thanks in advance,

-- 
Rudy Gevaert                rudy@zeus.UGent.be
Web page                    http://www.webworm.org
GNU/Linux user and Savannah hacker http://savannah.gnu.org
Love sometimes expresses itself in sacrifice.
        -- Kirk, "Metamorphosis", stardate 3220.3



Reply to: