If you need to test the connectivity of your openvpn server from a client’s perspective, you can use this command:
echo -e “\x38\x01\x00\x00\x00\x00\x00\x00\x00” | timeout 10 nc -u your.openvpnserver.ip port | cat -v
This sends TLS negotiation header to the server and expects a reply in 10 seconds. If you get an empty line, things timed out. If you get a reply like the line below, you have connectivity.
@M-QM-^MTM-aM-^U^VM-Q^C^@^@^@^@^@@M-QM-^MTM-aM-^U^VM-Q^C^@^@^@^@^@