modification l2tp ipsec server with telegram login notification and manual text file configuration
202
20220330 telegram notification user login
20220324 enable debug log
20220324 manual user configuration

create file getlog2.sh on host /root/docker/l2tp directory
tail -f /var/log/syslog | while read line
do case "$line" in
*"CHAP Response"*)
user=$(echo $line| cut -d'"' -f 2)
echo $user
id=$line
id=${id#*<}
id=${id%>*}
echo $id;
curl -s "https://api.telegram.org/botxxxx:xxxx/sendMessage?chat_id=xxxx&text=Login:%20$user%0AID:%20$id" \
esac
done
change telegram api url with your own.
create chap-secret file
"username" l2tpd "password" ipaddress
example:
"rahma" l2tpd "hahaha" 192.168.42.2
"man" l2tpd "hihihi" *
create passwd file whose contents are secret
generate secret
openssl passwd -1 'hahaha'
put the output to passwd file
rahma:$1$qotwM2ib$wv0OCXFqj3r2ZbLgWco40/:xauth-psk
man:$1$Fsu0wn9I$yd/QIqMZNmgOKNus5P/0Y.:xauth-psk
create file ipsec.secrets
%any %any : PSK "hahaha"

Run container
docker run \
--name l2tp \
--restart=always \
-v ikev2-vpn-data:/etc/ipsec.d \
-v /lib/modules:/lib/modules:ro \
-v /root/docker/l2tp:/root \
-p 500:500/udp \
-p 4500:4500/udp \
-d --privileged \
tkjpedia/l2tp:202203301357
Content type
Image
Digest
Size
110.5 MB
Last updated
over 4 years ago
docker pull tkjpedia/l2tp:202203301357