Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have setup OpenVPN server on my Citrix XenServer with the following NIC:

  • NIC#1: Setup to connect to the Internet with a static IP.
  • NIC#2: Setup to interface with other machines connected to this network.

I can access the OpenVPN server through SSH and a web admin interface.

However I am not sure how to setup DHCP server for NIC#2 so the machines on this network would have a local IP.

Do I need to setup a separate DHCP server for this network, or OpenVPN is sufficient?

share|improve this question
add comment

1 Answer

The following is true about OpenVPN, if you are using it in the normal "routing" mode, which you likely are:

  • OpenVPN gives clients an additional IP address "on-top-of" the IP they already have. So they will have the IP address given to them by whatever DHCP server is on the network, AND an IP address given to them by OpenVPN. Routing metrics decide what traffic goes where.
  • OpenVPN normally takes responsibility for assigning IPs to clients unless you're using it in bridge mode. It more or less usually has its own "built-in" DHCP server for the virtual network you're telling it to make.
  • You can actually configure OpenVPN to give a fixed virtual network IP per client if you are using certificates.

Really all you have to do is make sure your OpenVPN daemon is listening on 0.0.0.0 and it should accept incoming VPN setup requests from any interface, no matter what NIC it's from. Make sure the port it is listening on is accessible from the internet and your LAN.

If you already have a DHCP server pointed towards NIC#2's subnet, you don't have to change anything UNLESS the IP ranges of the subnet conflict between OpenVPN and your DHCP scopes.

share|improve this answer
add comment

Your Answer

 
discard

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.