8

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.

4

1 回答 1

2

通过查看终端输出ikec -u username -p password -r configuration -a,您可以判断连接是否成功;如果输出有 line ii : tunnel enabled,则表示连接成功并且应该可以工作。如果您收到诸如>> : detached from key daemonor之类的消息failed to connect to key daemon,则表示连接存在问题(https://askubuntu.com/a/793336/705434建议运行sudo /usr/sbin/iked以解决此特定错误)。要退出 ikec 命令,只需q在终端中输入。

编辑:看起来这个页面(https://gist.github.com/fschabmeyer/22b759994cf852df7e9b)有一个可以处理检测的shell脚本,你应该能够添加一个案例以在一定数量后自动退出命令时间。

于 2017-07-11T14:01:28.090 回答