

I needed it to see when colleagues where using the VPN so that I could see if it was safe to reboot the server. System Preparation OpenVPN and RSA Installation OpenVPN Server Configuration Setup the Certificate.
#UBUNTU VPN CLIENT HOW TO#
There is no doubt room for improvements but im not a script genius. How to setup OpenVPN Server and Client on Ubuntu 14.04. Watch -n $2 "$SCRIPT_DIR""/ovpn-activity" #Look for Virtual IPs that are online and save them.Įcho "| "$(sudo grep '/.*Learn: '$ip /var/log/openvpn.log | head -1 | sed 's/\/.*$//') Make sure to change the VPN subnet to match yours. To keep monitoring with a 20 second intervall. Maybe there's a way to adjust the intervalls in some settings BUT, I only need to monitor the vpn connections sometimes. I hink this is better than monitoring the /etc/openvpn/openvpn-status.log since this is really slow to update. I made a litte script that can either do a one time check or be set to keep monitoring with specified intervalls. To see active connections, go to the public IP of your VPN server make sure to configure proper firewall for port 80, whitelist only trusted inbound IPs Ive just installed this and my Ubuntu 18 server was able to connect to the web based VPN. Start the web server that will show active connections, gunicorn openvpn-monitor -b 0.0.0.0:80 -name openvpn-monitor -daemon Quick update to say F5 released a new APM Client 2 days ago. Geoip_data=/var/lib/GeoIP/GeoLite2-City.mmdb Install required packages pip install openvpn-monitor gunicornĪdd a Monitor config file vi /opt/openvpn-monitor/nf Restart openvpn server systemctl restart an OpenVPN Monitor Python package - this will run via a Gunicorn web server and show active connections, mkdir /opt/openvpn-monitorĬreate a virtual env (not required but good practice with py packages) cd /opt/openvpn-monitor I manage our companys OpenVPN servers and the way I see active connections is like this,Īdd to /etc/openvpn/nf management 127.0.0.1 5555
