How do I assign specific IP address to my OpenVPN server?

For example if you wish that your server uses 10.8.0.254 IP instead 10.8.0.1 then you need to make few changes to your config file.

First change "proto tcp" or "proto udp" line into "proto tcp-server" or "proto udp-server"

Then comment out this line:

server 10.8.0.0 255.255.255.0

and add these lines instead:

mode server
tls-server
ifconfig 10.8.0.254 10.8.0.253
ifconfig-pool 10.8.0.1 10.8.0.252
route 10.8.0.0 255.255.255.0
push "route 10.8.0.254"

restart openvpn service and that is it.

Tags:

Openvpn