LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   route locally generated traffic to ip:port to localhost:port (http://www.linuxquestions.org/questions/linux-software-2/route-locally-generated-traffic-to-ip-port-to-localhost-port-300294/)

maenho 03-11-2005 02:58 AM

route locally generated traffic to ip:port to localhost:port
 
Hi,

For reasons to complex to explain I would like that if a local application requests for example to connect to www.google.be:80 it actually connects to 127.0.0.1:80 (or different port). How would I do this?

masand 03-11-2005 04:03 AM

u need to resolve the DNS locally i think

ivanatora 03-11-2005 04:08 AM

You can use iptables and the OUTPUT chain and nat to redirect the request:
iptables -t nat -A OUTPUT -m tcp -p tcp -d 11.11.11.11 --dport 80 -j DNAT --to-destination 127.0.0.1:80


All times are GMT -5. The time now is 12:32 AM.