Centos 6.6 x64 L2tp配置:
1.
yum install ppp libpcap-devel openswan
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/xl2tpd-1.3.6-2.el6.x86_64.rpm
[root@localhost /]# cd /etc/xl2tpd/
l2tp-secrets testvpn.options
[root@localhost /]# cd /etc/xl2tpd/
[root@localhost xl2tpd]# vim testvpn.options
[global]
access control = no
port = 1701
[lac testvpn]
name = mytest
lns = 203.180.155.13
pppoptfile = /etc/ppp/peers/testvpn.l2tpd
ppp debug = no
[root@localhost xl2tpd]# vim /etc/ppp/peers/testvpn.l2tpd
remotename testvpn
user "user1"
password "password1"
unit 0
lock
nodeflate
nobsdcomp
noauth
persist
nopcomp
noaccomp
maxfail 5
debug
2. 检查目录/var/run/xl2tpd是否存在。不存在的话,手动新建一个。
[root@localhost run]# mkdir /var/run/xl2tpd
3.启动xl2tpd
[root@localhost /]# xl2tpd -c /etc/xl2tpd/testvpn.options
建立vpn连接
[root@localhost /]# echo 'c testvpn' >/var/run/xl2tpd/l2tp-control
断开vpn连接
[root@localhost /]# echo 'd testvpn' >/var/run/xl2tpd/l2tp-control