September 15, 2019, 10:21:44 PM

News : Linux Help Community Forum..

Author Topic: IPTABLES  (Read 3358 times)

Offline michael

  • New Member
  • Posts: 1
« on: December 23, 2003, 09:32:53 PM »
Hello everybody !!!

Please guide me regarding iptables, I am really confused about SNAT, DNAT, INPUT , OUTPUT and FORWARD.

For eg :
eth0 - is the external IP.
eth1 - is the internal IP.

I am understanding like this is this correct ....

SNAT - Means connection made from the internal IP. (eth1)
DNAT - Means connection going out to the internet from the eth0. (external outgoing)
(iptables -A forward -d -p tcp -s -j ACCEPT)

INPUT - Means connection coming in to the eth0
OUTPUT - Means connection going to the eth0
FORWARD - Means connection made from eth1 to the eth0.

Is this correct, please let me know the result, how to go with this..

Thank you.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
« Reply #1 on: December 25, 2003, 06:35:48 AM »
Well.. you are getting it wrong..
Iptables are used to define rules for firewall , packet filtering, etc. Here SNAT means altering the source address of the packet coming from the source you specified.
DNAT means altering the destination of  the packet.

INPUT is used nat , filter chains and is used to for the packets coming into the box itself ie. from the source you specified.
OUTPUT is also used in chains for the packets which are generated localy on the box.
Forward is for the packets which will be routed through the box.

Also the rule specified by you will give the error as you have not specified that which chain or table it should look for ie. ther is no conditions..