Tag Archives: aws

install pptpd vpn server @linodn/@aws

@aws // amazon instance

#wget https://gist.github.com/raw/666241/e8f3030a9e7066b8deb0a3d9ec761360e2d94227/pptpd.sh
#sh pptpd.sh

#vi /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
username  pptpd  passwd *

set security groups

Connection Method

Protocol

From Port

To Port

Source (IP or group)

-

tcp

1723

1723

0.0.0.0/0

-

tcp

47

47

0.0.0.0/0

-

udp

47

47

0.0.0.0/0

——————————————————————————————————

@linodn // centos5.5 32bit

#yum -y install rpm-build gcc

#yum -y install ppp

get pptpd rpm http://poptop.sourceforge.net/yum/stable/packages/

#rpm -ivh pptpd-1.3.4-2.rhel5.i386.rpm

# vi /etc/pptpd.conf

option /etc/ppp/pptpd-options

logwtmp

# 第一次配置时开启debug, 用于排错, 配置完成后可注释.

debug

# PPTP Wan IP

localip 173.230.132.139

# PPTP Client IP

remoteip 173.230.132.140-200

vi /etc/ppp/pptpd-options

# 默认

name pptpd

# 默认

refuse-pap

refuse-chap

refuse-mschap

require-mschap-v2

require-mppe-128

# PPTP 客户端拨号后, 分配的DNS, 我写的是 [OpenDNS]

ms-dns 208.67.222.222

ms-dns 208.67.220.220

# 默认

proxyarp

# 默认

nodefaultroute

# [注意] 指定pptp.log文件路径

logfile /var/log/pptpd.log

# 如果没有指定 pptpd.log 会报错:

#GRE: read(fd=,buffer=,len=) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax a

nd pppd logs

# 默认

lock

# 默认

nobsdcomp

# PPTP 客户端如果没有任何流量, 1小时自动断开拨号连接 (单位: 秒)

idle 3600

Set Forward/iptables

#vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

#sysctl -p

#/sbin/iptables -t nat -A POSTROUTING -s 173.230.132.0/255.255.255.0 -o eth0 -j MASQUERADE

#iptables-save

set username

#vi /etc/ppp/chap-secrets

# Secrets for authentication using CHAP

# client        server  secret                  IP addresses

otto pptpd Otto123! *

viva pptpd vivaz5 *

start pptpd

# /etc/init.d/pptpd start