I have this directive in the server.cfg which assigns a range of ips for connecting users:
server 10.8.0.0 255.255.255.0
Each time I connect a client it always (if he's the first in line) gets 10.8.0.4 or .5 (since the server reserves 10.8.0.1 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?
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.