Can I use route or some other tool to tell my linux box that it should connect to localhost instead of a given IP (of some other machine on the internet, not on the same subnet)?

2 Answers 2


One way is to configure another loopback address. Assuming you have one loopback already:

ifconfig lo:1 inet xxx.xxx.xxx.xxx netmask up

Note: This will need to be added to a start-up script since each time you reboot, this configuration is lost.


rinetd will listen on a IP/port and forward it to an IP/port of your choosing. It doesn't care about what subnet either IP is in.

I haven't checked nc (netcat)'s options too closely but it might be able to do that too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.