STUDY WHILE YOU ARE BORING


  • 首頁

  • 搜索

  • 技术

  • Tags

  • 关于我

阿里云VPN 服务器部署攻略 for CentOS

發表於 March 5, 2014   |   作者: Tim   |   分类: 日记   |   评论

为什么?难道想国内穿国内?

纯粹练手,为祖国贡献

步骤来了

  • 首先需要安装 ppp pptpd iptables

yum install -y ppp iptables
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm

rpm -ivh pptpd-1.4.0-1.el6.x86_64.rpm

  • 配置/etc/ppp/option.pptpd

name pptpd
refuse-pap

refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
idle 2592000
ms-dns 114.114.114.114
ms-dns 8.8.4.4

  • vi /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client server secret IP addresses

myusername pptpd mypassword *

  • vi /etc/pptpd.conf

option /etc/ppp/options.pptpd
logwtmp

localip 192.168.9.1
remoteip 192.168.9.11-30

  • /etc/sysctl.conf

修改 net.ipv4.ip_forward = 1

  • sysctl -p
  • 启动 service pptpd start
  • service iptables start
  • iptables -t nat -A POSTROUTING -o eth1 -s 192.168.9.0/24 -j MASQUERADE

注意,需要 ifconfig 查看外网ip的对应网卡,我的是 eth1

  • service iptables save
  • 开机自动启动

chkconfig iptables on
chkconfig pptpd on

FAQ

  • windows vpn 连接服务器,提示 741不支持加密类型

需要在vpn连接属性-》安全-》数据加密-》选择【可选加密】

  • 如果连接上不能上网

vi /etc/sysconfig/iptables

检查 —to-source 后面的ip是否是公网ip,笔者试过 填写了eth1,但是保存的是内网ip导致折腾了半天。

  • iptables 配置错误,清空所有规则

iptables -t nat -F

none
应用不支持 Retina ?
Mac 相同程序不同窗口切换快捷按键【快捷键】

钜添

54 文章
2 分類
1 页面
GitHub 日记技术
php apache centos macos mysql https shadowsocks mac 微信 ups svn javascript outline accesskey Chrome Extension letsencrypt ssl free certification certbo wildcard renew cloudflare pgsql 归档 binlog isset array_key_exists redmine axure
© 2021 钜添   |   文章 RSS     |  登录
由 Typecho 强力驱动
主題 - NexT
Send message encrypted and private - Msg2
Build your Under Construction Page without hosting - UnderConstruct.IO