VPN

1:检查是否支持PPTP

#返回OK

modprobe ppp-compress- && echo ok
ok

2:安装ppp

yum install -y ppp

3:导入EPEL源

rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum repolist

yum -y update

4:安装pptpd

yum install -y pptpd

5:修改/etc/pptpd.conf文件

#102行、103行,去掉注释
localip 192.168.0.1
remoteip 192.168.0.214,192.168.0.245

6:修改/etc/ppp/options.pptpd文件

ms-dns 8.8.8.8
ms-dns 8.8.4.4

7:配置VPN账号密码

vim /etc/ppp/chap-secrets
用户名 pptpd 密码 *
每个字段之间用tab键隔开 *表示用任意IP连接VPN都可以
样例:登录账号为test 密码为test 这样写:
test pptpd test *

8:修改/etc/sysctl.conf文件

net.ipv4.ip_forward=

输入命令生效:sysctl -p

9:  修改防火墙设置

创建并编辑文件
vim /usr/lib/firewalld/services/pptpd.xml <?xml version="1.0" encoding="utf-8"?>
<service>
<short>pptpd</short>
<description>PPTP</description>
<port protocol="tcp" port=""/>
</service>

10:重启防火墙

systemctl start firewalld.service

firewall-cmd --reload

11:添加规则

firewall-cmd --permanent --zone=public --add-service=pptpd
firewall-cmd --add-masquerade
firewall-cmd --permanent --zone=public --add-port=/tcp
firewall-cmd --permanent --zone=public --add-port=/tcp
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT -p gre -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT -p gre -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD -i ppp+ -o eth0 -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD -i eth0 -o ppp+ -j ACCEPT
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -I POSTROUTING -o eth0 -j MASQUERADE -s 192.168.0.0/

12:重启服务器

firewall-cmd --reload
systemctl restart pptpd

13:配置开启自启

systemctl enable pptpd.service
systemctl enable firewalld

14:Windows访问VPN

  .打开 网络和共享中心
.选择 设置新的连接或网络 --> 连接到工作区 --> 使用我的Internet连接(VPN)
.Internet地址 填入服务器ip
.输入上面配置的用户名和密码,连接即可

问题处理

1:无法连接PPTPD

不能上网的原因:Windows自带的vpn链接功能有一个选项——“在远程网络上使用默认网关”,默认这个选项是开启的,这样的后果就是不能将发 送到本地局域网的数据(比如网页的请求)发送到VPN网络中.由于VPN网络中没有设置处理这些数据的策略或路由,导致访问不能到达.把这个选项关闭就可 以上网了,具体操作如下:

1、选择PPTP VPN连接的 网络 属性中的TCP/IP连接属性

2、选择高级

3、将 常规标签上的“ 在远程网络上使用默认网关”前面的勾选去掉.

4、断开并重新连接PPTP VPN网络.

Centos7.x 安装 pptp的更多相关文章

  1. Centos7下安装pptp客户端

    1.使用yum安装ppp和pptp yum install ppp pptp 2.配置pptp pptpsetup --create vpn连接名称(自定义) --server VPN服务器IP -- ...

  2. CentOS7安装PPTP

    CentOS7安装PPTP VPN(开启firewall防火墙) 1       准备一个CentOS7服务器 2       检查是否支持PPTP && echo ok #返回OK ...

  3. 在centos7上安装Jenkins

    在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...

  4. CentOS7 Jenkins安装

    CentOS7 Jenkins安装 CentOS7 Jenkins安装 Download 从Jenkins下载apache-tomcat-8.0.18.tar.gz Install 安装 上传RPM文 ...

  5. 在 CentOS7 上安装 zookeeper-3.4.9 服务

    在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...

  6. 在 CentOS7 上安装 MongoDB

    在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...

  7. 在 CentOS7 上安装 MySQL5.7

    在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...

  8. 在 CentOS7 上安装 Tomcat9

    在 CentOS7 上安装 Tomcat9 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目 ...

  9. 在CentOS7上安装JDK1.8

    在CentOS7上安装JDK1.8 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目录 to ...

随机推荐

  1. hihocoder #1152 Lucky Substrings 【字符串处理问题】strsub()函数+set集合去重

    #1152 : Lucky Substrings时间限制:10000ms单点时限:1000ms内存限制:256MB描述A string s is LUCKY if and only if the nu ...

  2. make和rest用法

    位置(position):下一个要读取或写入的数据的索引.缓冲区的位置不能为负,并且不能大于其限制(limit). 标记(mark)与重置(reset):标记是一个索引,通过Buffer中的mark( ...

  3. centos 7 部署 mysql 报错记录

    1. Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY 这是由于yum安装了旧版本的GPG keys造成的,解决办法就是 引用  rpm --i ...

  4. 无言以队Alpha阶段项目复审

    小组的名字和链接 优点 缺点,bug报告 (至少140字) 最终名次 (无并列) 甜美女孩 http://www.cnblogs.com/serendipity-zeng/p/9937832.html ...

  5. <%!%>声明的变量和在<%%>中声明的变量的区别

    通过写一个demo,查看Jsp_Servlet源码可知: <%!%>声明的变量是类似类的成员变量,<%%>中的变量是方法中的变量. 参考博客: http://www.cnblo ...

  6. struts2 validate手动验证

    我们前面学习struts2知道,struts2通过拦截器实现了一些验证操作. 比如,如果是不能转换的类型在action中接受的话会跳转到错误页面,错误信息中会包含对应的错误信息,例如: 首先我们了解一 ...

  7. unreal network

    frame move buffer: save move position recive server sync:All moves earlier than the ClientAdjustPosi ...

  8. hdu-5795 A Simple Nim(组合游戏)

    题目链接: A Simple Nim Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Other ...

  9. 集训Day13

    我这个肥宅一点都不快乐嘤嘤嘤 bzoj3456 求n个点的无向简单连通图的个数 我们可以用容斥推出递推式 首先我们令为 于是有 这样就是可以用CDQ分治解决的一类递推式了 不是那么明显的变形一下得到 ...

  10. DDP入门

    DDP,即动态动态规划,可以用于解决一类带修改的DP问题. 我们从一个比较简单的东西入手,最大子段和. 带修改的最大子段和其实是常规问题了,经典的解决方法是用线段树维护从左,右开始的最大子段和和区间最 ...