Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to give a specific user his own private IP to use. How do I assign this in OpenVPN? I have googled on the specific terms, but I couldn't find anything useful.

Anyone here with more experience than I have could help me out? Thanks.

share|improve this question
up vote 4 down vote accepted

You would do this by adding files in the /etc/openvpn/ccd directory. The file should be named after the Common Name of the client certificate. You can then use per-client configurations.

For example:

# ls /etc/openvpn/ccd

# cat /etc/openvpn/ccd/WorkLaptop
push "route"
push "dhcp-option WINS"

So, in the above example, a client connecting to the server with a certificate "WorkLaptop" will receive the IP, as well as the routing and the information about the WINS server. The directives in the CCD file are applied after the main server.conf directives are applied, so the connecting client can be assigned a different route, etc., as these CCD directives will supersede what you already had in server.conf.

The section of the man page you need to look for is the client-config-dir option. I don't know why it's so hard to find it on the OpenVPN website. I recall it being relatively easy to find the documentation, but that was a few years ago. You can look at and search down the page for "client-config" and there seems to be some info.

Note that changes to files in the CCD directory will take effect immediately; you don't need to restart the openvpn server.

share|improve this answer
Thank you for your wonderful explanation. But I ment in my first post the IP as external IP, will I just push that IP aswell? Using ifconfig-push EXTERNAL IP ? Sorry for my bad explanation. – Devator Sep 13 '11 at 16:26
What's your setup? You're actually going to rewrite the (existing) IP address of the client? The ifconfig-push used by openvpn should only be applied to the tun0 interface of the client, not the other interfaces. – cjc Sep 13 '11 at 17:06
Well, its for when a client connects to the VPN server, they will browse with the IP of the server. I want a specific client to get his own (external) IP. – Devator Sep 13 '11 at 17:30
I think that actually becomes a routing question, rather than an openvpn one. You basically will be routing the openvpn addresses through the server, without modification. You will need to be more specific on what you're doing in that case (i.e., post sample IPs, a quick summary of your network, etc.) You might want to open a new question for this. – cjc Sep 13 '11 at 17:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.