Fixed IP with OpenVPN

    

Now that I have an OpenVPN server running , I’d like to get a fixed IP from it so that I can put ACL in my LAN access.

OpenVPN can link a user’s certificate DN with an IP address. This way, a user connecting with his personnal certificate with always get the same IP address.

Edit the etc/server.conf file and uncomment (or add) the “client-config-dir ccd” line.
Create the ccd directory in the same directory where server.conf lies.
Create a file named from the certificate’s DN value and add the IP allocation command:

# vi ccd/jdoe  
ifconfig-push 192.168.12.402 255.255.255.0 

Restart your OpenVPN service.

That’s all folks!

Source: Openvpn with fixed ips