I am trying to use iptables to redirect outbound traffic to an external ip address as if it were inbound traffic. My setup is as follows;
NET A NET B |------| |------| |--| |SERVER|<----->|DD-WRT|<----->|FW|<--> WAN |------| | |------| |--| | |------| | | COMP |<--| |------|
Where SERVER and COMP are both computers on network A, and DD-WRT is a router connecting networks A and B, and FW is a large firewall connecting network B to the WAN.
I have port forwards set up properly on my DD-WRT router and the large Firewall to forward packets to SERVER when external computers attempt to connect to FW. However, when COMP attempts to connect to FW, the packets are dropped because FW does not recognize that packets coming internally destined for the WAN address are meant to be routed according to the external rules.
Therefore, I would like to somehow route the packets emanating from COMP destined for FW's WAN address to appear to the DD-WRT as if they are instead destined for it's Network B address, as I know it is capable of routing these types of packets properly.
If anyone else has a better suggestion, I would of course be glad to hear it!