August 01, 2014, 03:53:38 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: IPTABLES  (Read 1788 times)

Offline michael

  • New Member
  • Posts: 1
IPTABLES
« 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 www.google.com -p tcp -s 192.168.1.1 -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.
MichaelMadan.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
IPTABLES
« Reply #1 on: December 25, 2003, 06:35:48 AM »
Well.. you are getting it wrong..
So..
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..