PPTP(Point to Point Tunneling Protocol),即點對點隧道協議。該協議是在PPP協議的基礎上開發的一種新的加強型安全協議,支持多協議虛擬專用網,能夠經過密碼驗證協議(PAP)、可擴展認證協議(EAP)等方法加強安全性。可使遠程用戶經過撥入ISP、經過直接鏈接Internet或其餘網絡安全地訪問企業網。linux
1.PPTP協議算法
使用MS-CHAP v2驗證方法,也能夠選擇安全性更好的EAP-TLS證書驗證方法。身份驗證完成後,以後雙方所發送的數據能夠利用MPPE加密法來加密,僅支持128位的RC4加密算法vim
2.L2TP/IPSec協議centos
支持IPSec的預共享密鑰與計算機證書兩種身份驗證方法,計算機證書方法安全性較高,預共享密鑰方法應僅做爲測試時使用。身份驗證完成後,以後雙方所發送的數據則利用IPSec ESP的3DES或AES加密方法瀏覽器
3.SSTP協議安全
採用HTTPS協議,所以能夠經過SSL安全措施來確保傳輸安全性。而HTTPS是企業廣泛採用的協議。服務器
1. 實驗環境拓撲圖網絡
2. 實驗環境規劃ssh
角色tcp |
外網IP地址(NAT) |
內網IP地址(LAN) |
PPTP-Client |
Eth0:192.168.1.11 |
|
PPTP-Server |
Eth0:192.168.1.242(公網) |
Eth0:172.16.30.30 |
內網FTP服務器 |
Eth0:172.16.30.31 |
3. 查看系統版本
[root@PPTP-server ~]# cat /etc/redhat-release
4. 查看主機名
[root@PPTP-server ~]# hostname
5. 關閉防火牆
[root@PPTP-server ~]# systemctl stop ebtables firewalld
[root@PPTP-server ~]# systemctl disable ebtables firewalld
6. 關閉selinux
[root@PPTP-server ~]# vim /etc/sysconfig/selinux
[root@PPTP-server ~]# setenforce 0
[root@PPTP-server ~]# getenforce
7. 給PPTP-Server第二塊網卡設置IP地址。
[root@PPTP-server ~]# nmcli connection add type ethernet con-name eth1 ifname ens37 ipv4.method manual ipv4.addresses 172.16.30.30/24 ipv4.gateway 172.16.30.1
1.配置epel源, 安裝PPTP 相關軟件
[root@PPTP-server ~]# wget -O /etc/yum.repos.d/centos.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2.安裝PPTP軟件包
[root@PPTP-server ~]# yum -y install epel-release ppp pptp pptpd
3.開啓內核轉發
(1)編輯配置文件
[root@PPTP-server ~]# vim /usr/lib/sysctl.d/00-system.conf
添加如下內容:
net.ipv4.ip_forward = 1
保存退出
(2)將配置文件中的信息刷一遍
[root@PPTP-server ~]# sysctl -p /usr/lib/sysctl.d/00-system.conf
4.配置客戶端上⽹ DNS , 如客戶端不須要分配 DNS 可不配置
[root@PPTP-server ~]# vim /etc/ppp/options.pptpd
5.設置 PPTP撥號的帳號密碼
[root@PPTP-server ~]# vim /etc/ppp/chap-secrets
# client server secret IP addresses
chenjf * chenjf123 *
6.分配 PPTP 撥號地址段, 注意和內⽹相同地址
[root@PPTP-server ~]# vim /etc/pptpd.conf
#添加本機公⽹IP(localip)
localip 192.168.1.242
#分配PPTP⽤戶的內⽹⽹段(remoteip)
remoteip 172.16.30.130-200
7.啓動 pptpd 服務並加⼊開機⾃啓動
[root@PPTP-server ~]# systemctl start pptpd
[root@PPTP-server ~]# systemctl enable pptpd
[root@PPTP-server ~]# systemctl status pptpd
8.檢查tcp1723端⼝是否開啓
[root@PPTP-server ~]# ss -lntup | grep 1723
1.在win7客戶端ping PPTP-server外網地址
2.在客戶端ping內⽹地址172.16.30.30是⽆法ping通,說明沒法直接鏈接。
3.打開⽹絡共享中⼼,點擊-->設置新的鏈接或⽹絡
4.選擇鏈接到⼯做區域
5.使⽤Internet鏈接到虛擬專用網絡服務
6.填寫PPTP服務器IP地址以及名稱,而後點擊下⼀步
7.填寫在PPTP-Server上配置好的⽤戶名以及密碼, 而後點擊鏈接
8.PPTP鏈接成功
9.測試是否可以鏈接172.16.30.31這臺內⽹服務器
10.打開文件資源管理器在路徑欄輸入ftp://172.16.30.31
11.打開網絡設備器查看ppp網卡IP地址
12.pptp默認鏈接是會經過pptp的默認⽹關來進⾏上⽹,若咱們想經過本身本地網關訪問上網,咱們取消默認使⽤撥號鏈接上⽹功能便可
13.斷開pptp撥號鏈接便可使用本地網關上網
14.打開瀏覽器訪問一下www.baidu.com
1.以 CentOS7.5 爲客戶端安裝軟件包
[root@pptp-client ~]# yum -y install ppp pptp pptp-setup
2.客戶端鏈接×××服務端
運⾏ pptpsetup --create test --server SERVER_IP --username ⽤戶名 --password 密碼 --encrypt --start 鏈接 PPTP 服務端。
您須要填寫實際配置pptp 服務端的 IP 地址、⽤戶名和密碼。
[root@PPTP-client ~]# pptpsetup --create test --server 192.168.1.242 --username chenjf --password chenjf123 --encrypt --start
3.檢查分配地址段
[root@PPTP-client ~]# ifconfig | grep -A 5 ppp
4.添加默認路由
[root@PPTP-client ~]# ip route replace default dev ppp0
5.咱們能夠ping 172.16.30.31 ssh root@172.16.30.31
此時證實PPTP撥號鏈接成功。
以下這類錯誤和pptp客戶端撥號提示鏈接691錯誤相似
1. 檢查 ebtables和selinux,以及客戶端防⽕牆。
systemctl status ebtables #查看ebtables防火牆的運行狀態
systemctl status firewalld #查看firewall防火牆的運行狀態
2. 若是是雲主機請檢查安全組⼊⼝和出⼝是否運⾏1723端⼝訪問。
3. 若是是物理主機須要向IDC瞭解是否關閉此端⼝, 或路由不⽀持此協議。