Answer the question
In order to leave comments, you need to log in
Trouble receiving telegram notifications when connecting to a VPN server?
I want to set up notifications in telegrams when connecting to a vpn server. I do it according to the instructions https://www.your-it-consultant.ru/post/libreswan-i...
Created a bot, created a script, made it executable, launched the script, a test notification came to the cart, now you need to bind it to connect events and disconnect, I do as described in the instructions in the /usr/lib/ipsec/_updown file and add the following lines:
case "$PLUTO_VERB:$1" in
....
up-client:)
# connection to my client subnet coming up
# If you are doing a custom version, firewall commands go here.
/usr/local/bin/tg_say.sh User ${PLUTO_USERNAME} with ip ${PLUTO_PEER} is CONNECTED
;;
down-client:)
# connection to my client subnet going down
# If you are doing a custom version, firewall commands go here.
/usr/local/bin/tg_say.sh User ${PLUTO_USERNAME} with ip ${PLUTO_PEER} is disconnected
;;
....
Answer the question
In order to leave comments, you need to log in
Because the article is about Pluto and IKEv1, and you use IKEv2 and Charon.
Just in case, I’ll write a solution here: I
added a parameter to /etc/ipsec.conf:
leftupdown=/usr/lib/ipsec/_updown
and added 2 lines in the /usr/lib/ipsec/_updown script itself:
...
case "$PLUTO_VERB:$1" in
...
up-client:)
# connection to my client subnet coming up
# If you are doing a custom version, firewall commands go here.
/usr/local/bin/tg_say.sh User ${PLUTO_USERNAME} with ip ${PLUTO_PEER} is CONNECTED
;;
down-client:)
# connection to my client subnet going down
# If you are doing a custom version, firewall commands go here.
/usr/local/bin/tg_say.sh User ${PLUTO_USERNAME} with ip ${PLUTO_PEER} is disconnected
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question