Centos 7 安裝V*N(pptpd)腳本

DwaHTHQ 8年前發布 | 51K 次閱讀 CentOS

來自: http://my.oschina.net/sunchp/blog/617784


#!/bin/bash

yum install -y perl

rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/p/pptpd-1.4.0-2.el7.x86_64.rpm

 

echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd

echo "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpd

 

echo "localip 9.9.0.1" >> /etc/pptpd.conf

echo "remoteip 9.9.0.10-200" >> /etc/pptpd.conf

 

echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf

sysctl -p

 

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i eth0 -p tcp --dport 1723 -j ACCEPT

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT

firewall-cmd --permanent --direct --add-rule ipv4 filter POSTROUTING 0 -t nat -o eth0 -j MASQUERADE

firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i ppp+ -o eth0 -j ACCEPT

firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i eth0 -o ppp+ -j ACCEPT

firewall-cmd --reload

 

echo "account pptpd password *" >> /etc/ppp/chap-secrets

 

systemctl restart pptpd

netstat -an|grep tcp|grep 1723

 

 本文由用戶 DwaHTHQ 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!