Kernel
egrep -i 'l2tp|ppp' .config
CONFIG_L2TP=m
# CONFIG_L2TP_DEBUGFS is not set
CONFIG_L2TP_V3=y
CONFIG_L2TP_IP=m
CONFIG_L2TP_ETH=m
CONFIG_PPP=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=m
# CONFIG_PPP_MULTILINK is not set
CONFIG_PPPOE=m
CONFIG_PPPOL2TP=m
CONFIG_PPP_ASYNC=m
# CONFIG_PPP_SYNC_TTY is not set
emerge -av net-dialup/ppp net-dialup/xl2tpd
/etc/xl2tpd/xl2tpd.conf:
[global]
access control = yes
[lac provider]
lns = <authorization_server>
redial = yes
redial timeout = 10
require chap = yes
require authentication = no
name = <your_login>
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tp
require pap = no
autodial = yes
/etc/ppp/options.l2tp:
name <your_login>
remotename l2tp
ipparam provider
connect /bin/true
nodeflate
nobsdcomp
persist
maxfail 0
nopcomp
noaccomp
mru 1460
mtu 1460
/etc/ppp/chap-secrets:
<your_login >* <your_password>
add to /etc/ppp/ip-up
ip rout add <your_net>/<> via <your_gateway> dev $1
add to /etc/ppp/ip-down
ip rout del <your_net>/<> via <your_gateway> dev $1
/etc/init.d/xl2tpd start
Let's add xl2tpd to default runlevel, using rc-update:
$ sudo rc-update add xl2tpd default