To improve the user experience on this site we use cookies. I agree | I disagree

Check VPN connection

In category Routers .


For indication if the IPsec tunnel is established you can use command "stroke" (/usr/libexec/ipsec/stroke). The script below is very simple example which checks every 5 seconds whether IPsec tunnel is established. If it is then USER LED is lights.

Simple example script (
num=1 # number of IPSec [1,2,3,4]
while true
  /usr/libexec/ipsec/stroke status | awk "/ipsec$num/" | grep INSTALLED
  if [ "$sts" = "0" ]; then
    led on
    led off
  sleep 5

Copy the script to e.g. root folder and finelly execute it from Startup Script, see below.

Startup Script:
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here.

sh /root/ &

You can also use a technique described in this arcticle How can I create my own script?



The OpenVPN tunnel is a bit problematic because there is not exist "management" port in the routers so it is not possible to indicate that VPN connection is established. Nevertheless you can use the OpenVPN Up/Down script for indicaton that the OpenVPN is started.

Create two very simple scripts.
led on
led off

Then copy these scripts to e.g. root folder and finaly add line below to Extra Option of OpenVPN configuration on web GUI.

--script-security 2 --up /root/ --down /root/


The checking of OpenVPN tunnel is useable only for indicate if VPN tunnel is running. It doesn't indicate that the connection is established!





To the FAQ overview