OpenVPN clients static ip

i need to use specific forwardings for some users on vpn.
But each day clients have another ip than previous day.
Would someone be so kind and helped me with settings of static release ip for VPN clients ?
I suppose that it must be made based on their certificates. But i don´t know how.

1 Like

You need to use the ifconfig-pool-persist option, and point it to a file (which will be created) to store these information. For example /etc/config/openvpn/ipp.txt (example only - either way, put it in something that won’t be wiped on a reboot).


# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.

Example (from an openvpn config file, not the one used normally by TurrisOS):

ifconfig-pool-persist ipp.txt

Hi again,
From begining it look´s great and easy, but there is little problem. It does not work as it should work.

For example, i created manualy in ‘/etc/openvpn/ipp.txt’ 3 profiles according to my profiles created in foris.


But when i restart service it replace my address to another addresses alone.

But when i connect to VPN with mobile assigned completely different addresses

That address is same as in routing table in log ‘/tmp/openvpn-status.log’

Openvpn config file generated automaticaly by foris script + my small addition of DNS.

config openvpn 'server_turris’
option enabled '1’
option port '1194’
option proto 'udp’
option dev 'tun_turris’
option ca '/etc/ssl/ca/openvpn/ca.crt’
option crl_verify '/etc/ssl/ca/openvpn/ca.crl’
option cert '/etc/ssl/ca/openvpn/01.crt’
option key '/etc/ssl/ca/openvpn/01.key’
option dh '/etc/dhparam/dh-default.pem’
option server '’
option ifconfig_pool_persist '/etc/openvpn/ipp.txt’
option duplicate_cn '0’
option keepalive '10 120’
option comp_lzo 'yes’
option persist_key '1’
option persist_tun '1’
option status '/tmp/openvpn-status.log’
option verb '3’
option mute '20’
list push 'route’
list push ‘dhcp-option DNS’

Can anyone explain me why this is happening ?

1 Like

I’am using CCD in OpenVPN and works great for me:

See topic Configuring client-specific rules and access policies on

1 Like