1. 程式人生 > >PPTP-V.P.N安裝與使用

PPTP-V.P.N安裝與使用

1.環境檢查

[[email protected] dev]# cat /dev/ppp
cat: /dev/ppp: 沒有那個裝置或地址
[[email protected] dev]# getenforce
Disabled
[[email protected] dev]# /etc/init.d/iptables status
iptables:未執行防火牆。

2.安裝PPTP

2.1更改yum源

由於本身的yum源中沒有PPTP包,所以需要更改yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

2.2下載PPTP

yum install -y pptpd

3.配置PPTP

sed -i.ori '$a localip 10.0.0.200\nremoteip 172.16.1.120-200' /etc/pptpd.conf

引數說明:

引數 說明
localip PPTP伺服器公網IP地址
remoteip PPTP伺服器分配給客戶端連線的內網地址

3.1配置賬號密碼

echo "name * 123456 *" >>/etc/ppp/chap-secrets

設定說明:

內容 說明
name 設定登入賬戶名字
第一個“*” 對應VPN伺服器的名字,可用*代替
123456 登入賬戶的密碼
第二個“*” 分配給客戶的IP地址,可用“*”代替。

4.啟動PPTP

通過連線工具另啟視窗

tailf /var/log/messages

4.1啟動PPTP

/etc/init.d/pptpd start

觀察/var/log/messages

[
[email protected]
~]# netstat -luntp|grep pptp tcp 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN 26490/pptpd

表示PPTP已經啟動成功

客戶端連線(Windows8)

 

5.解決連線斷網問題

6.設定核心轉發

vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
sysctl -p