Shrewsoft [1] provides a command line interface for setting up the vpn tunnel automatically without any user intervention, such as by using the following command
ikec -u username -p password -r configuration -a
IS there any way to detect if the connect attempt was successful such as by reading live logs and how can we terminate the vpn tunnel after some time using the command line. Any help will be appreciable.
By looking at the terminal output from ikec -u username -p password -r configuration -a
, you can tell if the connection was successful; if the output has a line ii : tunnel enabled
, that means the connection was successful and should work. If you get a message such as >> : detached from key daemon
or failed to connect to key daemon
, it means there was a problem with the connection (https://askubuntu.com/a/793336/705434 suggests running sudo /usr/sbin/iked
for a solution to this particular error). To exit the ikec command, just type q
into the terminal.
EDIT: it looks like this page (https://gist.github.com/fschabmeyer/22b759994cf852df7e9b) has a shell script that can handle the detection, you should be able to add a case to exit the command automatically after a certain amount of time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With