添加fedora官方源,然后安装ppp和pptpd
rpm -Uvh http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
1 |
rpm -Uvh http: //dl .fedoraproject.org /pub/epel/7/x86_64/e/epel-release-7-5 .noarch.rpm |
2 |
yum -y install ppp pptpd |
配置pptpd.conf
配置options.pptpd
1 |
vi /etc/ppp/options .pptpd |
配置VPN登陆账号和密码
1 |
vi /etc/ppp/chap-secrets |
配置sysctl.conf
添加下面的iptables转发规则(直接在SSH运行下面命令即可)
1 |
iptables -t nat -A POSTROUTING -s 10.0.10.0 /24 -o eth0 -j MASQUERADE |
2 |
iptables -t nat -A POSTROUTING -s 10.0.10.0 /24 -j SNAT --to- source VPS公网IP |
系统一重启转发规则就会失效,我们需要将配置写入rc.local, 使其开机自动设置
运行下面的命令赋予rc.loacl执行权限
1 |
chmod +x /etc/rc .d /rc . local |
启动pptpd和添加开机启动pptpd
2 |
systemctl enable pptpd.service |
(责任编辑:IT) |