Monday, August 14, 2006
Redirect a port on Linux
Randomly I had a need to redirect a request from the local LAN to another machine on the local LAN. Don't ask... Actually this would also come in handy for, for instance, services which can only be configured to listen on 127.0.0.1 (such as SSH dynamic port forwarding) that you want to export to the world at large. If there is an easy way to do this with IPTables, I can't find it (I'm not acting as a gateway to any systems so rules in the FORWARD chain don't count). A userspace util, rinetd, will accept connections on port A and send them to IP and port B.