I have a little router here that does this:
+---------- ppp0 (no fwmark) | internal eth0 ------------o Box o--+ external | +---------- eth2 (fwmark 2)
ppp0 is a fast ADSL line at provider A, eth2 is a slow SDSL line at provider B
I don't use load balancing, the two providers are used for different purposes depending on the services used by the LAN users.
I have a little fwmark Masq/SNAT configuration with a dual default route that masquerades the internal LAN onto both external providers. The fwmark is set depending on the destination port or destination address, e.g. we send mail over eth2, while web browsing is done over ppp0. This is transparent for the users and has been working fine for quite some time now.
The box itself also replies correctly to external requests. It runs a web server and we can reach it from outside on both ppp0's and eth2's IP address.
My problem is that I now want to use port forwarding for packets coming from both of the external networks.
Port forwarding for ppp0 works fine: requests coming in on from ppp0 are forwarded correctly to the internal IP, the responding packets return through ppp0.
However, packets coming in from eth2 are not answered on eth2, but on ppp0, as well. While the incoming packets are forwarded correctly to the internal IP, the responding packets use the wrong route.
I have tried to set fwmark 2 on all the "mangle" tables for packets arriving on eth2, yet it still responds on ppp0.
Is there anyone who did something similar? Somehow I think that this can't really be that obscure to do...
Thanks,
Hanno