Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

I am using centos on both ends. Very new to this! Thanks

share|improve this question
  1. Check the logs file on the both side.
  2. sudo /sbin/ifconfig to make sure that tun/tap interface up and running.
  3. route -n to examize the routing table.
share|improve this answer
    
So does that mean both client and server should have the tun interface when running ifconfig? Im attempting my first setup and having issues- and the client doesn't have a tun interface.. This is obviously not normal. – Lock Aug 10 '12 at 8:28
    
Yes. Show us the output when running openvpn from the command line. Increase the verbose level (verb option) if needed. – quanta Aug 10 '12 at 8:32

In addition to what @quanta suggested:

  1. Use OpenVPN management interface and its "status" command.

"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.

  1. 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.

  2. 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.