Assign specific IP addresses to specific clients in OpenVPN

We will use the same network configuration and values that we used in the “Install and Configure OpenVPN using a TUN interface” tutorial.

1 – Edit the server configuration file

Edit your server.conf file and add the following lines:

2 – Create the clients configuration directory

If it does not exist:

3 – Create the client specific configuration

The file name needs to be the Common Name used when the certificate was created.You can use the following command to get the Common Name out of a certificate (replace client1.crt with the name of your certificate):

Assuming that the Common Name is, we create the configuration file:

and write the configuration settings:

And that should be all. Save the file and reload your OpenVPN configuration.



Leave a Reply