Hi datopdog,
Thanks very much for your reply, it's working a treat. I got a bit confused with all the different IP settings, so thought I'd post my solution here.
The Yahoo IM server runs off several hostnames, but the primary one I'm aware of is scs.msg.yahoo.com. This currently resolves to 66.163.181.167 and is used in the following scripts.
Please also not I'm running CentOS 5 so seem to have a slightly different iptables syntax to the one suggested. Its man page suggested that for my version, the DNAT target was valid in the OUTPUT, not POSTROUTING chain.
I've then modified my Yahoo client to use localhost:5050 as its server.
Once again thanks to datopdog for a great answer.
Cheers
K.
Client machine
tunnelyim.sh
Code:
#!/bin/bash
ssh -fN -L 5050:66.163.181.167:5050 -l myusername RELAY_HOST_IP
Relay machine
fwdyim.sh
Code:
#!/bin/bash
if [ "`whoami`" != "root" ] ; then
echo "you must be root to execute this script"
exit 1
fi
for protocol in tcp udp ; do
/sbin/iptables -t nat -I OUTPUT -p $protocol --dport 5050 -j DNAT --to-destination 66.163.181.167
done