Configuring OpenConnect VPN Network Manager in Linux with Split-Tunnel Subnet Restriction
OpenConnect is an open-source VPN client that can be used with the Network Manager in Linux distributions like Kubuntu. This article will guide you through the process of configuring OpenConnect with Network Manager to restrict VPN usage to a particular subnet using the GUI and specifying IPv4 route.
Prerequisites
Before we begin, make sure you have the following:
- A Linux distribution with Network Manager installed (e.g., Kubuntu)
- The OpenConnect plugin for Network Manager installed
- VPN server credentials
Installing OpenConnect Plugin for Network Manager
To install the OpenConnect plugin for Network Manager, open a terminal and run the following commands:
sudo apt-get update
sudo apt-get install network-manager-openconnect-gnome
Configuring VPN Connection
After installing the OpenConnect plugin, follow these steps to configure the VPN connection:
- Click on the Network Manager icon in the system tray.
- Select "VPN Connections" and then "Configure VPN...".
- Click the "+" button to add a new VPN connection.
- Select "OpenConnect" as the VPN type and click "Create...".
- Enter the VPN server's address and your credentials.
Configuring Split-Tunnel Subnet Restriction
To restrict VPN usage to a particular subnet, follow these steps:
- Click the "IPv4 Settings" tab.
- Select "Routes" in the "Method" dropdown menu.
- Click "Add" to add a new route.
- Enter the subnet you want to restrict VPN usage to in the "Destination" field (e.g., x.y.z.w/24).
- Select "Use this connection only for resources on its network" in the "Gateway" dropdown menu.
Testing the Configuration
To test the configuration, connect to the VPN and try accessing resources in the restricted subnet. If everything is set up correctly, you should be able to access the resources without issues.
In this article, we have covered the following key concepts:
- Installing the OpenConnect plugin for Network Manager in Linux
- Configuring a VPN connection using the Network Manager GUI
- Restricting VPN usage to a particular subnet using the GUI and specifying IPv4 route
- Testing the configuration