My Home Router
wan IP : A.B.C.D
lan IP : 192.168.36.1
My work server behind Firewall
IP : 172.28.1.151
Setup:
1. Enable dropbear (sshd) on my home router, listen on port 22
dropbear -a -p 22
2. Create ssh-tunnel from work server, forward data from port 8223 of my home router to work server port 22, thus i can connect work server out from firewall.
autossh -M 8899 -NR 8223:localhost:22 root@A.B.C.D -p22 -vvv
3. Enable ssh SOCK5 proxy on my work server, because dropbear could not support SOCK5. Use port 10080 as SOCK5 proxy.
ssh -N -f -D 172.28.1.151:10080 user@localhost
4. Estableished ssh tunnel from my home router, and forward data from port 8920 to remote (my work server) 10080 port.
ssh -f -NT -g -L 8920:172.28.1.151:10080 -W 49512 -K 60 user@127.0.0.1 -p8223
5. Now my home router act a SOCK5 proxy server.
SOCK5 ://192.168.36.1:8920
Config SOCK5 proxy on IOS
1. Create one PAC (Proxy Auto Config) file on my home router.
touch /var/www/sock5.pac
2. Add config
cat > /var/www/sock5.pac << EOF
function FindProxyForURL(url, host)
{
if (isInNet(host, "192.168.36.0", "255.255.255.0"))
return "DIRECT";
return "SOCKS 192.168.36.1:8920";
}
EOF
3. Enable HTTP proxy on IOS, choose auto-config, fill in URL
阅读(997) | 评论(0) | 转发(0) |