plink.exe 免费的ssh工具putty里的一个命令行运行的软件.
ssh帐号:申请外网的ssh帐号,若DNS解析有问题要用IP登陆.得到帐号密码服务器名或IP.
去官网下载最新版的plink.exehttp://www.chiark.greenend.org.uk/~sgtatham/putty/download.html我是放在 D:\putty\plink.exe
开始 -> cmd 回车后弹出DOS窗口.C:\Users\Administrator>d:D:\>cd puttyD:\putty>plink -ssh username@ssh.server.com -pw passwordUsing username 'username'.Last login: Tue Mar 4 02:14:41 2014 from xxx.xxx.xxx.xxx> w 5:48AM up 21:13, 0 users, load averages: 0.07, 0.11, 0.08USER TTY FROM LOGIN@ IDLE WHAT> exitlogoutD:\putty>注:username,password,ssh.server.com用您的帐号,密码,服务器名.如果登陆有问题就查原因,成功就继续.
设定要透明访问的网站修改hosts,编辑前要关闭杀毒或安全防护软件.用记事本打开 C:\Windows\System32\drivers\etc\hosts 增加网站名保存.192.168.0.122 www.hostname.com192.168.0.123 member.server.com这里用两个举例,可以设置多个常用的网站.
网卡属性tcp/ip设置属性,设置本机网卡ip,掩码,网关,DNS,高级里添加多个ip.自己用就添加微软虚拟网卡,网卡属性tcp/ip设置不同网段ip和掩码,不用设置网关和DNS,在高级里添加多个ip.本机网卡IP设置:192.168.0.121高级里添加IP:192.168.0.122,192.168.0.123,掩码:255.255.255.255
创建个proxy.bat,以后可双击运行.将-ssh换成-N就不会出现ssh提示符D:\putty>echo D:\putty\plink.exe -ssh -L 192.168.0.122:80:www.hostname.com:80 -L 192.168.0.123:80:member.server.com:80 username@ssh.server.com -pw password > proxy.batD:\putty>proxy开另一DOS窗查看监听是否正常netstat -an TCP 192.168.0.122:80 0.0.0.0:0 LISTENING TCP 192.168.0.123:80 0.0.0.0:0 LISTENING
用浏览器打开设定的两个网站应该能正常打开访问.
新增加线路不稳定掉线或重新拨号换IP, 透明代理断开连接的问题, 在bat中加两行即可解决.:masterplink.exe ......goto master