remotename配置后面是xl2tpd.conf的lac后的名字
linuxl2tp客户端配置
配置完成后
客户端/etc/xl2tpd/xl2tpd.conf其中lactestvpn配置中的ins是l2tp服务器的wan地址
[global]
port = 1701
access control = no
ipsec saref = no
[lac testvpn]
name = axk1
lns = 192.168.204.130
pppoptfile = /etc/ppp/options.xl2tpd
ppp debug = yes
启动服务端
先安装xl2tpd和ppp组件
sudo apt-get install xl2tpd ppp
[global]
ipsec saref = no
debug tunnel = yes
debug avp = yes
debug network = yes
debug state = yes
access control = no
port = 1701
auth file = /etc/ppp/chap-secrets
[lns default]
ip range = 10.0.0.2-10.0.0.10
local ip = 10.0.0.1
require chap = yes
refuse pap = yes
require authentication = yes
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
lock
noauth
dump
logfd 2
mtu 1400
mru 1400
ms-dns 10.0.0.1
lcp-echo-failure 12
lcp-echo-interval 5
require-mschap-v2
nomppe
# Secrets for authentication using CHAP
# client server secret IP addresses
axk1 * axk *
开启ip转发
sudo service xl2tpd restart
或者
xl2tpd -D>xl2tpd.log 直接启动也可以 -D之后可以生成log到xl2tpd.log
服务端配置
linux配置xl2tpd客户端,也是需要xl2tpdppp两个组件
然后执行启动客户端xl2tpd
客户端配置
按行添加格式如下
用户名 * 密码 *
user后面跟用户名password后面跟密码对应服务端/etc/ppp/chap-secrets文件配置
remotename testvpn
user "axk1"
password "axk"
unit 0
lock
nodeflate
nobsdcomp
noauth
persist
nopcomp
noaccomp
maxfail 5
debug
运行成功并不代表已经连接
文章为作者独立观点,不代表股票交易接口观点