Install PPTP or Softether VPN on Ubuntu 12.04 Server

PPTP VPN Server Setup:

aptitude -y install ppp pptpd

vi /etc/pptpd.conf
localip 10.8.0.1
remoteip 10.8.0.2-254

vi /etc/ppp/pptpd-options
require-mschap-v2
require-mppe-128
ms-dns 223.5.5.5
ms-dns 223.6.6.6

vi /etc/ppp/chap-secrets
vpnuser * 123456 *

vi /etc/sysctl.conf
net.ipv4.ip_forward = 1

sysctl -p

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

vi /etc/rc.local
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
exit 0

service pptpd restart


Softether VPN Server Setup:

aptitude -y install make gcc

2. tar zxf softether-vpnserver-v4.10-9505-beta-2014.10.03-linux-x64-64bit.tar.gz

3. cd vpnserver
make
cd ..
mv vpnserver /usr/local/ (考虑到日志,建议安装到独立的挂载分区,不小于30G;或者配置syslog send function)
cd /usr/local/vpnserver/
chmod 600 *
chmod 700 vpnserver
chmod 700 vpncmd

4. vi /etc/init.d/vpnserver
#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server 4.10
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

mkdir /var/lock/subsys

chmod 755 /etc/init.d/vpnserver
service vpnserver start
update-rc.d vpnserver defaults

cd /usr/local/vpnserver
./vpncmd
3
check

netstat -ltunp | grep vpnserver

本文出自 “Ilovecat(个人笔记)” 博客,请务必保留此出处http://hj192837.blog.51cto.com/655995/1577580

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。