Back

Setting up Ubuntu built-in VPN client

Installing required packages

1. Run the following commands to update software packages and install the L2TP plugin for NetworkManager:

sudo apt update
  sudo apt install -y network-manager-l2tp network-manager-l2tp-gnome

Setting up a new VPN connection

1. Click on the network connection icon in the top right corner of your desktop. Click the "Settings" button in the shortcuts menu:

Setting up Ubuntu built-in VPN client

2. In the settings, choose the "Network" tab on the left, and click "+" button opposite of the "VPN" label to add a new VPN connection:

Setting up Ubuntu built-in VPN client

3. Choose L2TP tunneling protocol:

Setting up Ubuntu built-in VPN client

4. Enter the IP address of your VPN gateway into the "Gateway" field, enter username and password. IP address, username and password for a user are parts of user credentials.

Setting up Ubuntu built-in VPN client

Click the "user" symbol in the password input box and select "Store the password only for this user".

5. Click on "IPsec Settings..." button to show IPsec settings.

Setting up Ubuntu built-in VPN client

Check the "Enable IPsec tunnel to L2TP host" box. Put the "Shared secret" you have got in the user credentials dialogue earlier to the "Pre-shared key" input box.

Click "Advanced".

Set "Phase1 Algorithms" to "ike=aes128-sha1-modp2048".

Set "Phase2 Algorithms" to "esp=aes128-sha1". Press OK.

6. Open the "IPv4" tab and scroll down to "Routes". Add a route as shown below:

Setting up Ubuntu built-in VPN client

Save settings by clicking "Add" button.

7. Make sure your newly created VPN connection is on:

Setting up Ubuntu built-in VPN client

Suggested Articles

  • VPN to GPN

    Setting up Windows built-in VPN client

  • VPN to GPN

    Setting up macOS built-in VPN client