CentOS 安装 PPTP VPN 客户端安装脚本

运行pon example连接

运行poff example断开连接

#!/bin/sh

yum install -y ppp pptp pptp-setup

#

#

# pptpsetup --create example --server 10.2.3.4 --username user1 --password password1

# vi /etc/ppp/chap-secrets

# vi /etc/ppp/peers/example

# cp /usr/share/doc/ppp-2.4.5/scripts/pon /root/bin/pon

# cp /usr/share/doc/ppp-2.4.5/scripts/poff /root/bin/poff

# 测试

# pppd call example logfd 2 nodetach debug dump refuse-eap require-mppe persist

#

#

# 根据需要添加路由

cat > /etc/ppp/ip-up.local <<"EOF"

#!/bin/bash

/sbin/route add -net 10.3.0.0/16 dev $1

EOF

cat > /etc/ppp/chap-secrets <<EOF

# Secrets for authentication using CHAP

# client server  secret IP addresses

# added by pptpsetup for example

user1 example "password1" *

EOF

cat > /etc/ppp/peers/example <<EOF

# written by pptpsetup

pty "pptp 10.2.3.4 --nolaunchpppd"

lock

noauth

nobsdcomp

nodeflate

name zhaoyi

remotename example

ipparam example

#logfd 2

#nodetach

#debug

#dump

#defaultroute

persist #断线重拨

require-mppe-128

refuse-pap

refuse-chap

refuse-eap

refuse-mschap

EOF

mkdir /root/bin

cp /usr/share/doc/ppp-2.4.5/scripts/pon /root/bin

cp /usr/share/doc/ppp-2.4.5/scripts/poff /root/bin

相关推荐