Basic Openvpn Client-Server Configuration
Basic Openvpn Client-Server Configuration
Introduction
In addition to site-to-site configuration, OpenVPN also supports a client-server model for
VPNs. This mode is more popular than using it in site-to-site mode, and allows for multiple
remote client connections to a single centralized server.
In this mode, you might have multiple configured sites connecting to a single centralized
router. For instance, you may have several branch offices, as well as a central headquarter
office with your central router. The central router can serve as the OpenVPN server, with the
branch office routers acting as OpenVPN clients.
The use of server-client VPNs in OpenVPN requires X.509 certificates to be setup. If you do
not have an existing PKI (Public Key Infrastructure), you may set up a simple one using this
guide.
Configuration Example
Network Specifications
In our example configuration, we will be using the following layout and goals for our
network:
Routers:
Three VyOS routers; one OpenVPN server, and two OpenVPN clients.
Server router: central-rtr, located at the central office.
First client router: branch1-rtr, located at the first branch.
Second client router: branch2-rtr, located at the second branch.
All above certs are signed against our root cert. The file locations for the relevant files will
be in each of the routers at the path /config/auth/ovpn/
We also need to install a push-route to push the route of the server's LAN of
192.168.0.0/24 to the clients:
Now we need to set each of the client's configuration options. Client names are identified by
the CN field in their certs:
We also need to set up a static route to our 10.23.0.0/16 subnet on each router, as
OpenVPN does not install this route automatically: