Openvpn - edit configuration file

Hello,

I would like use openvpn and have clients with static IP address.
It works well when I add line to config file
client config-dir ‘/etc/openvpn/ccd’
after changing config file /etc/config/openvpn
it is not possible create and download client configuration file from reForis anymore (Došlo k chybě při získávání dat.)
I am able do it again when I return /etc/config/openvpn file from backup
solution can be create and download all clients, it is working fine
when I would like add new opevpn client, I can replace config file /etc/config/openvpn from backup, create new client and edit config file again
is there any better solution?

Please paste here the contents of /etc/config/openvpn with the changes you have made.

for example this:
without 0 at the end it is ok, with 0 it is wrong
option ifconfig_pool_persist ‘/etc/openvpn/ipp.txt’ 0

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/ssl/ca/openvpn/dhparam.pem’
option server ‘10.8.0.0 255.255.255.0’
option ifconfig_pool_persist ‘/etc/openvpn/ipp.txt’ 0
option duplicate_cn ‘0’
option keepalive ‘10 120’
option persist_key ‘1’
option persist_tun ‘1’
option status ‘/tmp/openvpn-status.log’
option verb ‘3’
option mute ‘20’
option topology ‘subnet’
list push ‘route 192.168.1.0 255.255.255.0’

tried also add
ifconfig-pool-persist-expire 0
or

client-config-dir ‘/etc/openvpn/ccd’

Why do you add the 0 at the end?

To force manual IP assignment

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/ssl/ca/openvpn/dhparam.pem’
option server ‘10.8.0.0 255.255.255.0’
option ifconfig_pool_persist ‘/etc/openvpn/ipp.txt’
option client-config-dir ‘/etc/openvpn/ccd’
option duplicate_cn ‘0’
option keepalive ‘10 120’
option persist_key ‘1’
option persist_tun ‘1’
option status ‘/tmp/openvpn-status.log’
option verb ‘3’
option mute ‘20’
option topology ‘subnet’
list push ‘route 192.168.1.0 255.255.255.0’

Please specify the version of Turris OS you use.

|Device|Turris Omnia|
|reForis version|1.4.1|
|Turris OS version|6.3.1|
|Turris OS branch|HBS|
|Kernel version|5.15.96|

I see the syntax error of that line. Change it to
option client_config_dir ‘/etc/openvpn/ccd’

solved, this works
option client_config_dir ‘/etc/openvpn/ccd’
thank you :+1:

1 Like

@jantrasak mark the topic as solved