How to Set a Static IP in OpenVPN

By Chris Daniels

Don't let anyone snoop on your business data -- use a VPN for employees on the move.
i Thinkstock/Comstock/Getty Images

OpenVPN is an open source virtual private network that can allow your employees to securely connect to your business servers. For your small business, this means that your employees are conducting company business securely -- rather than over the open Internet -- even when they aren't in the office. When configuring your company's OpenVPN server, you can assign users a static IP address that will always be the same, a convenient way to manage a small user base.

Log in to your company's OpenVPN server using an account that has administrative privileges.

Navigate to the directory "/etc/openvpn."

Create a client configuration directory to store configuration information, including static IP addresses, for each OpenVPN user.

mkdir /etc/openvpn/clients

Edit the file "server.conf" in the directory "/etc/openvpn" using an editor such as EMACS or NANO. Add the following line to the file, replacing "clients" with whatever you chose to name the directory in the previous step.

client-config-dir clients

Save the file.

Navigate to the client config directory that you just created.

Create files for each user exactly matching each username, using the touch command.

touch exact_user_name

Add the following line to the newly created file, replacing the IP addresses with the static IP addresses that you wish assigned to this user.


Save the file.

Restart OpenVPN to activate your new settings using the following command:

service openvpn restart

Items you will need

  • Server with OpenVPN installed

  • Admin access