День добрый всем!
Есть микротик, на котором настроен l2tp over ipsec. Все устройства конектится к нему без особых проблем. Но у меня есть маленькая хранилка на Ubuntu Server 16.04 LTS, без гуя (и не поставлю гуй, не упрашивайте). В отчем ситуация такая: ipsec поднимается и нормально работает, а вот l2tp постоянно падает. Вот мой конфиг:
Были установлены strongswan и xl2tpd
root@ms:/# uname -a
Linux ms 4.4.0-80-generic #101-Ubuntu SMP Thu Jun 8 15:35:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@ms:/etc# cat ipsec.conf
# ipsec.conf - strongSwan IPsec configuration file
# basic configuration
config setup
# strictcrlpolicy=yes
# uniqueids = no
# Add connections here.
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
keyexchange=ikev1
authby=secret
ike=aes128-sha1-modp1024,3des-sha1-modp1024!
esp=aes128-sha1-modp1024,3des-sha1-modp1024!
conn dl2tp
keyexchange=ikev1
left=%defaultroute
auto=add
authby=secret
type=transport
leftprotoport=17/1701
rightprotoport=17/1701
# set this to the ip address of your vpn server
right=some.host
root@ms:/etc/xl2tpd# cat xl2tpd.conf
[global]
ipsec saref = yes
[lac dl2tp]
lns = some.host
refuse chap = yes
refuse pap = yes
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tp
length bit = yes
root@ms:/etc/xl2tpd# cat /etc/ppp/options.l2tp
ipcp-accept-local
ipcp-accept-remote
#asyncmap 0
refuse-eap
require-mschap-v2
noccp
noauth
idle 1800
mtu 1410
mru 1410
defaultroute
usepeerdns
debug
lock
connect-delay 5000
в итоге перезагружаем сервисы
systemctl restart strongswan
systemctl restart xl2tpd
Поднимаем ipsec:
ipsec up dl2tp
Проверяем ipsec туннель:
root@ms:~# ipsec statusall
Status of IKE charon daemon (strongSwan 5.3.5, Linux 4.4.0-80-generic, x86_64):
uptime: 2 minutes, since Jun 09 14:05:12 2017
malloc: sbrk 2703360, mmap 0, used 352592, free 2350768
worker threads: 11 of 16 idle, 5/0/0/0 working, job queue: 0/0/0/0, scheduled: 0
loaded plugins: charon test-vectors aes rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp agent xcbc hmac gcm attr kernel-netlink resolve socket-default connmark stroke updown
Listening IP addresses:
10.0.1.3
Connections:
dl2tp: %any...some.host IKEv1
dl2tp: local: uses pre-shared key authentication
dl2tp: remote: [some.host] uses pre-shared key authentication
dl2tp: child: dynamic[udp/l2f] === dynamic[udp/l2f] TRANSPORT
Security Associations (0 up, 0 connecting):
none
Далее делаем магию:
echo "c dl2tp login password" > /var/run/xl2tpd/l2tp-control
Все поднимается на 5 минут и падает с ошибкой:
Jun 9 14:05:13 ms xl2tpd[21834]: "/etc/ppp/options.l2tp"
Jun 9 14:05:13 ms xl2tpd[21834]: "/dev/pts/2"
Jun 9 14:06:17 ms xl2tpd[21834]: Maximum retries exceeded for tunnel 22432. Closing.
Jun 9 14:06:17 ms xl2tpd[21834]: Terminating pppd: sending TERM signal to pid 21836
Jun 9 14:06:17 ms xl2tpd[21834]: Connection 8036 closed to 123.321.123.321, port 1701 (Timeout)
Jun 9 14:06:18 ms xl2tpd[21834]: check_control: Received out of order control packet on tunnel 8036 (got 3, expected 2)
Jun 9 14:06:18 ms xl2tpd[21834]: handle_packet: bad control packet!
при этом на каком то ядре (не помню на каком) все работало стабильно... что я делаю не так?