$ inxi -S
System: Host: ryzen Kernel: 4.20.12-042012-generic x86_64 bits: 64 Desktop: KDE Plasma 5.12.6
Distro: Ubuntu 18.04.1 LTS
Подключаюсь к VPN по L2TP/IPsec, но через некоторое время связь пропадает, просто перестают пинговаться ip-адреса в той локалке. В качестве обхода удается поднять сеть переподключением.
Использую вот это
$ dpkg -l | grep 'libreswan'
ii libreswan 3.23-4 amd64 Internet Key Exchange daemon
$ dpkg -l | grep 'l2tp'
ii xl2tpd 1.3.10-1ubuntu1 amd64 layer 2 tunneling protocol implementation
$ cat /etc/ipsec.conf
# /etc/ipsec.conf - Libreswan IPsec configuration file
#
# Manual: ipsec.conf.5
config setup
# Normally, pluto logs via syslog. If you want to log to a file,
# specify below or to disable logging, eg for embedded systems, use
# the file name /dev/null
# Note: SElinux policies might prevent pluto writing to a log file at
# an unusual location.
#logfile=/var/log/pluto.log
#
# Do not enable debug options to debug configuration issues!
#
# plutodebug "all", "none" or a combation from below:
# "raw crypt parsing emitting control controlmore kernel pfkey
# natt x509 dpd dns oppo oppoinfo private".
# Note: "private" is not included with "all", as it can show confidential
# information. It must be specifically specified
# examples:
# plutodebug="control parsing"
# plutodebug="all crypt"
# Again: only enable plutodebug when asked by a developer
#plutodebug=none
#
# NAT-TRAVERSAL support
# exclude networks used on server side by adding %v4:!a.b.c.0/24
# It seems that T-Mobile in the US and Rogers/Fido in Canada are
# using 25/8 as "private" address space on their wireless networks.
# This range has never been announced via BGP (at least up to 2015)
virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:25.0.0.0/8,%v4:100.64.0.0/10,%v6:fd00::/8,%v6:fe80::/10
nat_traversal=yes
protostack=netkey # default is auto, which will try netkey first
plutoopts="--interface=enp30s0" # Replace eth0 with your network interface or use %defaultroute to use default route
# For example connections, see your distribution's documentation directory,
# or https://libreswan.org/wiki/
#
# There is also a lot of information in the manual page, "man ipsec.conf"
#
# It is best to add your IPsec connections as separate files in /etc/ipsec.d/
conn L2TP-PSK
authby=secret
pfs=no
auto=add
keyingtries=3
dpddelay=30
dpdtimeout=120
dpdaction=clear
rekey=yes
ikelifetime=8h
keylife=1h
type=transport
left=192.168.1.2 # Replace with your local IP address (private, behind NAT IP is okay as well)
leftprotoport=17/1701
right=X.X.X.X # Replace with your VPN server's IP
rightid=10.0.0.207
rightprotoport=17/1701
include /etc/ipsec.d/*.conf
$ cat /etc/xl2tpd/xl2tpd.conf
[lac vpn-name]
lns = X.X.X.X
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd.client
length bit = yes
systemctl start ipsec.service
sleep 2
systemctl start xl2tpd.service
ipsec auto --up L2TP-PSK
echo "c vpn-name" > /var/run/xl2tpd/l2tp-control
sleep 2
ip route add 10.0.0.0/21 via 10.10.0.1 dev ppp0