Setup: PC I (Ubuntu 11.10, have sudo), Mac T (OS X 10.7.2, have sudo), Smart device S (barely configurable).
S can see to I on the local network, but can't see T. I and T can see each other.
There is a program that listens on T on port N. If someone connects to the program and does not speak its proprietary protocol or does not say anything upon connection, the program shuts down and has to be painfully manually restarted.
S must connect to T on port N and speak to the program. The actual IP S connects to is configurable.
I see that I have to set up some kind of relay from I, port N to T, port N, but so far I can't wrap my head around out how to do that. Hints are welcome.
A temporary solution (e.g. running ssh with some fancy keys) is preferable to a "permanent" one (like configuring iptables or something), since this is a temporary problem.