1

I have installed OpenVPN Access Server on Ubuntu 20.04 LTS server. On the client side I use Network Manager.

The VPN server is part of a private 10.42.24.0/24 network.

In the Admin GUI for the server I changed the default Dynamic Ip Address Network from 172.27.224.0/20 to 10.42.25.0/24 and then created a user.

I configured a new vpn client in Network Manager with the ovpn file. It works.

I am now wondering how to configure the routing on the client to only use the connection for the private network, not anything else. I know I need to tick "Use this connection only for resources on its network" and fill in Address, Netmask and Gateway in IPv4->Routes ... But I have no idea what values to add to include everything in the 10.42.24.0/24 network?

Also I would like to know if there is any other config values on the server that I should be aware of.

[EDIT]

Output from client while connected to VPN:

ip -4 route
default via 10.42.25.161 dev tun0 proto static metric 50 
default via 192.168.1.1 dev eno1 proto dhcp metric 100 
default via 192.168.1.1 dev wlp3s0b1 proto dhcp metric 600 
10.42.25.160/28 dev tun0 proto kernel scope link src 10.42.25.162 metric 50 
123.456.789.128 via 192.168.1.1 dev eno1 proto static metric 100 
192.168.1.0/24 dev eno1 proto kernel scope link src 192.168.1.100 metric 100 
192.168.1.0/24 dev wlp3s0b1 proto kernel scope link src 192.168.1.11 metric 600 
192.168.1.1 dev eno1 proto static scope link metric 100 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 
2
  • Give me a bit to answer, I'm in the middle of work stuff too so don't have a ton of instant available time :) – Thomas Ward Oct 1 '20 at 15:12
  • Just grateful to get some guidance.... take your time. – Jette Oct 1 '20 at 15:13
1

Open Access Server - Web GUI

I discovered that what I want is called "split tunneling". For this to work it is especially important to have the correct value in #4 (that is the one I missed).

  1. Configuration -> VPN Settings -> Dynamic IP Address Network

    • Value: 10.42.25.0/24
    • Comment: The local network accessed through this VPN is 10.42.24.0/24. I reserved another local network for the VPN called 10.42.25.0/24.
  2. Configuration -> VPN Settings -> Should client Internet traffic be routed through the VPN?

    • Value: No
    • Comment: The purpose of this VPN is solely to gain access to the local network.
  3. Configuration -> VPN Settings -> Group Default IP Address Network (Optional)

    • Value: [blank]
  4. Configuration -> VPN Settings -> Specify the private subnets to which all clients should be given access

    • Value: 10.42.24.0/24

    • Comment: This field is important. The GUI will fill it automatically, and you should check that it contains the right value.

  5. User Management -> User Permissions

    • Comment: Add a user, and press "More settings" to set the password
  6. Configuration -> Network Settings -> Admin Web Server.

    • (Local ip): Yes
    • Listen on all interfaces: No
    • Comment: Because I don't want the admin GUI publicly available.

Everything else I left untouched at default values.

Network Manager

In network manager, create a new VPN based on the opvn file, and then go to the ipv4 tab.

Below the Routes headline, Tick the "Use this connection only for resources on its network" option and fill in

Address: 10.42.24.0,

Netmask: 255.255.255.0

Gateway: 0.0.0.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.