Originally Posted by
superm1
Well two options. If you are just needing web browsing, use the -D forward option. Set up a local SOCKS proxy in your web browser.
If you need more, forward a VPN connection over the SSH tunnel.
Thanks for your reply. I investigated both options and neither were suitable. The proxy did not work because I required multiple connections. The VPN connection did not work because I did not have root access to the sshd server.
Instead I came up with a less-than-elegant method and used rinetd. It is suitable for the temporary time I need the connection. To do this I did the following:
1) Set up virtual network devices
Code:
sudo ifconfig eth0:1 192.168.0.128 netmask 255.255.255.0
sudo ifconfig eth0:2 192.168.0.129 netmask 255.255.255.0
2) for all the web servers I wanted to connect to I added them in the /etc/hosts file and pointed them to the virtual network device:
Code:
192.168.0.128 webserver1.com
192.168.0.129 webserver2.com
3) Then I needed to redirect the localhost ports with rinetd. In the /etc/rinetd.conf file I added the following:
Code:
allow 192.168.0.*
# bindadress bindport connectaddress connectport
192.168.0.128 80 127.0.0.1 82
192.168.0.129 80 127.0.0.1 81
4) Then I set up my SSH tunnel
Code:
sudo ssh -f simon@$SSHD_SERVER -L 81:123.123.0.1:80 -L 82:123.123.0.2:80
This acted like a transparent proxy. Although the method is not ideal, it works. This would be much more elegant using iptables.
Bookmarks