Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Madhuri Patwardhan <madhuri@cc.iitb.ac.in>
To: netfilter@lists.netfilter.org
Subject: rerouting after postrouting in NAT table
Date: Fri, 17 Oct 2003 13:05:01 +0530	[thread overview]
Message-ID: <3F8F9BA5.1090502@cc.iitb.ac.in> (raw)


Hi,

I would like to choose the appropriate routing table using the packet 
source address which is altered by the NAT table post-routing chain.
Is it possible? I have given the detailed scenerio below.

This is what I have:

I have a linux box with connections to two WAN links.
We are doing load balancing using Ultra monkey software. The same linux 
box also works as a Linux director and directs the packets to real 
servers. The real servers have private IP's. It is similar to the 
example given on the ultramonkey site: 
http://www.ultramonkey.org/2.0.1/topologies/lb-eg.html

On the Linux Director box (which has two WAN links), masquerading for 
the real server's private IP's happens with the following command.

/sbin/iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.168.6.0/24
(as given in the example on ultramonkey site, which is mentioned above)

So, in the POSTROUTING chain the source address gets changed to one of 
the WAN links public IP.

I would like to route the reply packets on the same WAN link on which 
the query came.

For example:

I have two WAN links whose IP ranges are 203.199.51.0/24(WAN link X) and 
203.197.74.128/25 (WAN link Y).

A packet comes on WAN link X destined to a address 203.199.51.159, which 
is a virtual IP of the Linux Director on the Linux box.

This packet is handed over to the real server which generates reply and 
sends the packet back to Linux Director. The Linux Director changes the 
source IP to 203.199.51.159 as per the iptables masqurade rule mentioned 
above in the NAT tables post-routing chain.

I have created two routing tables one with a default route of WAN link X 
and the other with a default route of WAN link Y. Depending on the 
source address, in this case 203.199.51.159 I would like it to choose 
the appropriate routing table and hence WAN link X.

Is this possible? What I am wondering is since it is in the post routing 
chain that the source address is changed, is it possible that rerouting 
will happen again and the appropriate default route will be chosen after 
postrouting chain is traversed?


If any part needs better explaination please let me know. I would really 
appreciate any pointers/clues.


Thanks in advance.

Madhuri



             reply	other threads:[~2003-10-17  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-17  7:35 Madhuri Patwardhan [this message]
2003-10-17 12:40 ` rerouting after postrouting in NAT table Ray Leach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F8F9BA5.1090502@cc.iitb.ac.in \
    --to=madhuri@cc.iitb.ac.in \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox