使用Google搜索

用Google搜索学术问题, 需要爬梯, 配置了一把.

阿里云ECS主机, 选择新加坡的, 最基本的资源就行. 操作系统选择CentOS 7.3, 配置PPTP.

  • 安装软件
yum install ppp iptables pptpd iptables-services -y
  • 配置参数

vi /etc/pptpd.conf

localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245

vi /etc/ppp/options.pptpd

ms-dns 8.8.8.8
ms-dns 223.5.5.5

vi /etc/ppp/chap-secrets

用户名    pptpd    密码    *
  • 配置系统参数
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p
  • 添加iptables转发规则
 1 iptables -F
 2 iptables -A INPUT -i lo -j ACCEPT
 3 iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT
 4 iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
 5 iptables -A INPUT -p tcp --dport 22 -j ACCEPT
 6 iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
 7 iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
 8 iptables -A INPUT -p gre -j ACCEPT
 9 iptables -A OUTPUT -p gre -j ACCEPT
10 service iptables save
  • 启动服务
1 systemctl enable pptpd.service
2 systemctl enable iptables.service
3 systemctl restart pptpd.service
4 systemctl restart iptables.service
5 netstat -tunlp|grep 1723

上面是服务端的配置, 因为是用的云主机, 需要把1723端口放通.

管理控制台==>安全组配置==>配置规则
  

授权策略 协议类型 端口范围 授权类型 授权对象 描述 优先级
允许 自定义TCP 1723/1723 地址段访问 0.0.0.0/0 VPN 100

接下来就是在Windows主机配置VPN客户端.

可以参考这篇文章: https://jingyan.baidu.com/article/ce09321b23cf7c2bff858fb8.html

posted @ 2017-07-31 10:50  FlyInDance  阅读(209)  评论(0编辑  收藏  举报