Did you ever wonder how you set static IP addresses for OpenVPN clients when using Synology as an OpenVPN server?
Hey, my name is "Tux" and this tutorial will show you how you can configure static OpenVPN client IPv4 addresses on OpenVPN server side.
Note
SSH into the Synology NAS which has the OpenVPN server installed.
Now navigate to:
$ cd /usr/syno/etc/packages/VPNCenter/
Create the following directory:
$ mkdir ./ccd
Change permissions:
$ chmod 0755 ./ccd
Create a file which its name holds the according OpenVPN client username:
$ vi ./ccd/<myOpenVPNClientUsername>
Add the following content:
ifconfig-push <myStaticIPAddress> <myVPNGatewayIPAddress>
Save the file, quit the editor and change permissions:
$ chmod 0644 ./ccd/<myOpenVPNClientUsername>
Edit the following file…
$ vi /usr/syno/etc/packages/VPNCenter/openvpn/openvpn.conf
…and add the following content:
client-config-dir /usr/syno/etc/packages/VPNCenter/ccd/
Save the file and quit the editor.
Edit the following file…
$ vi /volume1/@appstore/VPNCenter/etc/openvpn/radiusplugin.cnf
…look out for the following line…
overwriteccfiles=true
…and chage it to:
overwriteccfiles=false
Save the file and quit the editor.
Now restart the OpenVPN server serivce.
Note: After every OpenVPN server update you have to check if these customized settings are still set. If not, repeat the according steps above!
Important!
0
to xxx.xxx.xxx.xxx3
Those two IPv4 addresses are the middle part of the /30 subnet per definition.
Example of a config file with the following content:
ifconfig-push 10.0.0.6 10.0.0.5
On this example the following IPv4 addresses are being reserved by the OpenVPN for the according OpenVPN /30 client subnet:
10.0.0.7
→ Broadcast
10.0.0.6
→ Client-Gateway
10.0.0.5
→ Client
10.0.0.4
→ Net-ID
Broadcast and Net-ID are being configured automatically per OpenVPN client by the OpenVPN server.
When configuring static IPv4 addresses please note that it is very important to always double check there is no overlapping between OpenVPN client subnets!
Appreciate my work?
Buy me a coffee or PayPal
Source(s):
Synology Forum: OpenVPN to VPN server static private IP
OpenVPN Support Forum: Static ip for openvpn clients