linux中配置pptp服务器配置的方法
1、验证内核是否加载了MPPE模块:
modprobeppp-compress-18&&echoMPPEisok
2、安装所需的软件包:
yum-yinstallppp
wgetftp://rpmfind.net/linux/epel/7/x86_64/p/pptpd-1.4.0-2.el7.x86_64.rpm
rpm-ivhpptpd-1.4.0-2.el7.x86_64.rpm
3、配置PPP和PPTP的配置文件:
grep^[^#]/etc/ppp/options.pptpd
vi/etc/ppp/options.pptpd
namepptpd #refuse-pap #refuse-chap #refuse-mschap require-mschap-v2 require-mppe-128 ms-dns8.8.8.8 ms-dns8.8.4.4 proxyarp lock nobsdcomp novj novjccomp nologfd
vi/etc/ppp/chap-secrets
usernamepptpdpasswd*
vi/etc/pptpd.conf
option/etc/ppp/options.pptpd logwtmp localip192.168.0.1 remoteip192.168.0.207-217
4、打开内核的IP转发功能:
vi/etc/sysctl.conf
net.ipv4.ip_forward=1
/sbin/sysctl-p
5、配置防火墙和NAT转发
yuminstalliptables-services systemctlstopfirewalld.service systemctldisablefirewalld.service systemctlenableiptables.service systemctlstartiptables.service
开启包转发:
iptables-tnat-APOSTROUTING-s192.168.0.0/24-oeno16777736-jMASQUERADE serviceiptablessave serviceiptablesrestart
开放端口和gre协议:
iptables-AINPUT-ptcp-mstate--stateNEW,RELATED,ESTABLISHED-mtcp--dport1723-jACCEPT iptables-AINPUT-pgre-mstate--stateNEW,RELATED,ESTABLISHED-jACCEPT iptables-tnat-APOSTROUTING-s192.168.0.0/24-oeno16777736-jMASQUERADE
添加规则:
iptables-AINPUT-pgre-jACCEPT iptables-AINPUT-ptcp-mtcp--dport1723-jACCEPT iptables-AINPUT-mstate--stateRELATED,ESTABLISHED-jACCEPT iptables-AFORWARD-s192.168.0.0/24-oeno16777736-jACCEPT iptables-AFORWARD-d192.168.0.0/24-ieno16777736-jACCEPT iptables-tnat-APOSTROUTING-s192.168.0.0/24-oeno16777736-jMASQUERADE serviceiptablessave
启动和查看服务:
systemctlstartpptpd systemctlenablepptpd systemctlstatuspptpd
6.查看pptpd服务进程和端口:
#ps-ef|greppptpd root251001014:19?00:00:00/usr/sbin/pptpd-f root2546324275014:52pts/000:00:00grep--color=autopptpd #netstat-nutap|greppptpd tcp000.0.0.0:17230.0.0.0:*LISTEN25100/pptpd
以上就是小编为大家带来的linux中配置pptp服务器配置的方法全部内容了,希望大家多多支持毛票票~