cat /etc/xl2tpd/xl2tpd.conf
[global]
debug tunnel = yes
[lac name]
lns = xxx.xxx.xxx.xxx
pppoptfile = /etc/ppp/peers/name.l2tpd
ppp debug = yes
length bit = yes
redial = yes
redial timeout = 2
autodial = yes
lns
:l2tp server IP地址。pppoptfile
:l2tp client配置文件。
cat /etc/ppp/peers/name.l2tpd
remotename vyos
ipcp-accept-local
ipcp-accept-remote
refuse-eap
require-mschap-v2
noccp
noauth
idle 1800
mtu 1410
mru 1410
defaultroute
noipdefault
debug
connect-delay 5000
name centos
password centos
persist
maxfail 0
remotename
:设置xl2tpd.conf配置文件中的名称。defaultroute
:将vpn设置为默认路由,默认情况所有流量都从vpn进行传输。noipdefault
:不设置分配的默认IP地址,配置后将由l2tp server分配IP。