[Ilugc] about prerouting and postrouting

  • From: zenmurugan@xxxxxxxxx (Senthil Murugan)
  • Date: Wed May 18 09:36:25 2005

Colud any body please tell me what is pre-routing and post-routing and how
its working and if its possible could you please tell me with example,
|------------| where eth0 is my publicip -- eth0 | where eth1 is my private
ip
| |
-- eht1 |
|------------|


There are three tables available with iptables
    1. NAT
    2. Filter
    3. Mangle

In simple,
1. NAT table is responsible for address translation
2. Filter tables is responsible for Filtering the packets
3. Mangle table is  responsible for packet marking

There are many chains available,  such as prerouting, postrouting, INPUT, 
FORWARD, OUTPUT.

PREROUTING and POST ROUTING are only used by NAT and MANGLE tables.

PREROUTING  takesplace before all the routing table processes.That is, when 
the packet is arrived at your gateway, before that packet is processed, it 
gets done with the PREROUTING rule.

POSTROUTING takes place when the packet goes out from your system, that is, 
after all the processing and when the packet is about to leave the system, 
the postrouting rule will be executed.

There is a flowchart in the following  link which will give you  the overall 
packet flow in the iptables.

http://iptables-tutorial.frozentux.net/iptables-tutorial.html#TRAVERSINGGENERAL


Other related posts: