I have this directive in the server.cfg which assigns a range of ips for connecting users:


Each time I connect a client it always (if he's the first in line) gets or .5 (since the server reserves for itself).

What I want to do is to assign a random ip to my clients from the range I have created via the server config not just next ip for next client the way openvpn does it right now. Is there something I can do to achieve this?

  • Just out of curiosity: Why would you want that? Aug 4 '13 at 21:56

You can use client configuration files in the /etc/openvpn/ccd sub-directory. After the client authenticates, openvpn will open a configuration file which matches the uses common name if it exists. Add the configuration to push the fixed IP address in this file. Enure the user OpenVPN runs as after dropping privileges can read the directory and file.

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.