Skip to main content
Skip table of contents

How to Run the OpenVPN Client with a Preconfigured Configuration File

Solution Based on Experience from the Field

This article provides a solution that has not been approved by the IGEL Research and Development department. Therefore, official support cannot be provided by IGEL. Where applicable, test the solution before deploying it to a productive environment.

This article describes a basic solution for getting the built-in OpenVPN client running with a preconfigured configuration file. This is an alternative to using the Setup for configuration.

Environment

This article is valid for the following environment:

  • IGEL OS 10 or higher

  • OpenVPN server

Setting up an OpenVPN Connection with a Preconfigured Configuration File 

  1. In the UMS Console, open the context menu on Files and select New File.

  2. Select your .ovpn file in the file system.

  3. In the File target section, under Devices file location, enter "/wfs/".

  4. Click Ok.
    The file is uploaded to the UMS.

  5. Assign the file object to your device by clicking the "+" symbol in the Assigned objects area (upper right).

  6. Create a profile with a suitable name, e. g. "OpenVPN Connection".

  7. In the profile, go to System > Firmware Customization > Custom Commands > Network.

  8. In the Final network command field, enter the following code, replacing example.ovpn with the correct filename:

    CODE
    while :; do if [ -z $(pgrep openvpn) ]; then echo "openvpn is not running"; openvpn --config /wfs/example.ovpn --auth-user-pass <(echo -e $(zenity --forms --text="Enter your VPN credentials" --add-entry=Username --add-password=Password --title=OpenVPN) | sed 's/|/\n/'); else echo "openvpn is running"; fi; sleep 1; done &

  1. Click Save to save the profile.

  2. Assign the profile to your device by clicking the "+" symbol in the Assigned objects area.

  3. Reboot the device.
    After reboot, you should see a login window for OpenVPN.

  4. Enter your OpenVPN credentials.
    If the login was successful, a Network connecting popup appears briefly. No other indicator is shown. You can disconnect only by rebooting the device.
    If the login has failed, the login window reappears.

Removing the OpenVPN Connection

->To remove the OpenVPN connection from the settings, unassign the profile from the device and reboot it.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.