Networking Forums

Networking Forums > Computer Networking > Linux Networking > Help with understanding how IPTables work

Reply
Thread Tools Display Modes

Help with understanding how IPTables work

 
 
Justin
Guest
Posts: n/a

 
      12-14-2004, 09:55 PM
Hi everyone!

I have scrutinized a fully working rc.firewall script I got from the
internet, because I
need customize it to forward some ports to an internal server, but I got
confused as
to how iptables actually works.

The script SNAT all packets going out of my external iface, which makes
perfect
sense as I have 192.168.x.x addresses internally. But packets being
forwarded from
the internet to my internal network aren't being DNATted explicitly by the
rc.firewall
script, so where is the DNAT happening? is it done by the ip forwarding
chain? or by
this connection tracking thing?

This is how I think iptables works (please correct me if I got it wrong,
thanks!):

Packet in==>Mangle==>Prerouting==>Routing==>Forward==>Pos trouting==>Out

or Input

I also find something really quite strange, I have my ext iface connected to
the ADSL
modem, but the modem has a fixed address of 192.168.0.1. I can access that
internally but I can't think why that should be, I thought 192.168.x.x
addresses aren't
supposed to be routed out? the script does forward all traffic going from
int iface to
ext iface, regardless of IP addresses, but if routing happens before the
filtering table,
surely such packets with class C destination IPs should never make it out?

Can someone help me clarify this, thanks!
sorry if this is a troll-ish question, I'm quite new to networking :-P


 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a

 
      12-15-2004, 05:13 AM
On 2004-12-14, Justin <(E-Mail Removed)> wrote:
> confused as to how iptables actually works.


The IPTable-howto is quite clear.
Davide

--
Buy a Pentium III so you can reboot faster.
 
Reply With Quote
 
Andy Furniss
Guest
Posts: n/a

 
      12-15-2004, 01:02 PM
Justin wrote:

> Hi everyone!
>
> I have scrutinized a fully working rc.firewall script I got from the
> internet, because I
> need customize it to forward some ports to an internal server, but I got
> confused as
> to how iptables actually works.


Have a look at the docs on www.netfilter.org
and the KPTD on www.docum.org

Andy.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PREROUTING Does not work -- IPTABLES stevehunter_1@hotmail.com Linux Networking 5 07-24-2008 03:02 PM
help understanding this behaviour SeriousSam Windows Networking 6 12-10-2007 10:02 PM
iptables --sport doesn't seem to work with REDIRECT jorge.hodge@gmail.com Linux Networking 0 10-09-2007 10:26 PM
Understanding the output of DMT Mortimer Broadband 1 08-07-2007 07:05 PM
iptables - will this work? Rage Linux Networking 3 08-26-2005 07:08 AM



1 2 3 4 5 6 7 8 9 10 11