环境:
CentOS Linux release 7.2.1511 (Core)
Linux server 3.10.0-1062.4.1.el7.x86_64
安装epel仓库
yum install -y epel-release
安装xl2tpd和ppp
yum -y install xl2tpd ppp
客户端:
修改xl2tpd配置文件
[root@server ~]# vim /etc/xl2tpd/xl2tpd.conf
[lac test] #名称
name = user #用户名
lns = IP address #L2tp-服务端IP
pppoptfile = /etc/ppp/peers/test.l2tpd #拨号文件
ppp debug = yes
修改ppp配置文件
[root@server ~]# vim /etc/ppp/peers/LDZZ.l2tpd
remotename test
user "user" #用户名
password "password" #密码
unit 0
nodeflate
nobsdcomp
noauth
persist
nopcomp
noaccomp
maxfail 5
debug
启动xl2tpd
systemctl start xl2tpd
VPN拨号-连接
echo 'c test'>/var/run/xl2tpd/l2tp-control
VPN拨号-断开
echo 'd test'>/var/run/xl2tpd/l2tp-control
VPN拨号-成功
ppp1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 172.16.253.130 peer 172.16.253.129/32 scope global ppp1
valid_lft forever preferred_lft forever
注:以上资料来自互联网,已实际测试。
网友评论