This is my situation, I have 2 NICs, eth0, and eth1 that are both
connected to the internet.
I want to access eth0 through subnet 192.168.1.0/24 and eth1 through
subnet 192.168.2.0/24. This would allow me to have, say,
www.foo.com
available on eth0 through 192.168.1.1 and on eth1 through
192.168.2.1.
To achieve this I wanted to set up a route to eth0 on the
192.168.1.0/24 subnet and to eth1 on the 192.168.2.0/24 subnet in the
routing tables.
However, for it to make sense to the gateway after routing has
occurred, I would have to substitute in the IP of
www.foo.com after
the routing has occurred.
I'm wondering if it's possible to have a destination address
translation after routing. The iptables man page seems to indicate
that this is not possible as you can only combine DNAT with PREROUTING
and OUTPUT, and POSTROUTING with SNAT. Why is this?
Is there another way to achieve what I am trying to do?
Thanks in advance.