[problem]
You want to forward all traffic from a port on your box, to another host/port combination.
[/problem]
[solution]
The command in the example will port forward, from the local box – any traffic sent to port 8081, will be sent to port 8080 on www.example.com:
[/solution]
[example]
ssh -x -g -L 8081:www.example.com:8080 localhost
Don’t forget, if you need to open LINUX (FC4) firewall, do this (as root):
vi /etc/sysconfig/iptables # add following line then save, exit
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
/etc/init.d/iptables restart
[/example]
[reference]
[tags]Port forwarding, SSH, Unix Coding School[/tags]
- Linux Man Pages – crontab command
- Linux Man Pages – ssh command
- Linux Man Pages – vim command
- Linux Man Pages – iptables command
[/reference]
If you have found my website useful, please consider buying me a coffee below 😉