How do you know if a site to site VPN tunnel is established in OpenVPN? Apart from pinging the other side, is there a command or something that shows the status of the tunnel?
How do you know if a site to site VPN tunnel is established in OpenVPN? Apart from pinging the other side, is there a command or something that shows the status of the tunnel?
In addition to what @quanta suggested:
"man openvpn" will tell you how to set up and use this interface (search for "--management")
OpenVPN in peer-to-peer (1.x), server (2.x) and client (2.x) mode produces different outputs, but it will let you see if it is connected. In server mode it will list all connected clients.
OpenVPN could dump its status to text file every n seconds. Again, "man openvpn" (look for "--status"). Contents of the file will be exactly same that management status command produces.
OpenVPN could execute arbitrary script when connection is established, closed, daemon started or before shutdown etc., in practice you can script almost any movement. Nothing forbids you from using, say, desktop notification from the hook script.
Search for "SCRIPTING" in "man openvpn".
Of course, each of these options can be added into openvpn config file, if you omit leading "--".
In general, I strongly advise you to read the man page completely, just to be aware of what it could do and what are consequences.
openvpn config:
/var/log/openvpn.status:
you can easily parse it
sudo /sbin/ifconfig
to make sure thattun/tap
interface up and running.route -n
to examize the routing table.Simply use the following command on terminal window.