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. g2o的一般过程

    1.自己定义顶点类.边类或者用已经有的.1.1定义顶点例子class CurveFittingVertex: public g2o::BaseVertex<3, Eigen::Vector3d& ...

  2. 如何使用安信可 ESP 系列一体化开发环境【转】

    本文转载自:http://wiki.ai-thinker.com/ai_ide_use 关于 Problems 报错 注意:Eclipse 只是一个代码编写工具,它并不能读取 makefile 里面的 ...

  3. python之tkinter_1

    以下内容来自:https://blog.csdn.net/wangyiyan315/article/details/16361065 from tkinter import * # 导入tkinter ...

  4. iOS开发 - 如何跳到系统设置里的各种设置界面

    在iOS开发中,有时会有跳转系统设置界面的需求,例如提示用户打开蓝牙或者WIFI,提醒用户打开推送或者位置权限等.在iOS6之后,第三方应用需要跳转系统设置界面,需要在URL type中添加一个pre ...

  5. 分享知识-快乐自己:2017IDEA破解教程

    首先 修改host文件: 文件路径:C:\Windows\System32\drivers\etc\hosts 修改:将“0.0.0.0 account.jetbrains.com”追加到hosts文 ...

  6. c# json 排版

    public static string PraseToJson(string json) { try { JsonSerializer s = new JsonSerializer(); JsonR ...

  7. Android Studio的技巧

    1.快速添加add unimplements methods:  右键generate 2.快速添加try-catch:左边就有一个小电灯,然后可以选. 3.格式化OPTION + CMD + L ( ...

  8. yum 命令用法

    [root@hdp01 ~]# yum list available |grep ambari  ######列出可安装的程序包ambari-infra-solr.noarch 2.6.1.5-3 a ...

  9. ogg日常运维命令

    1.查看历史记录.快捷执行历史中的一条命令 GGSCI (11g) 32> h 23: view param exta24: info all25: lag exta.... GGSCI (11 ...

  10. transition插件

    $("#box").transition({ opacity: 0.1, scale: 0.3 }); $("#box").transition({ opaci ...