• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

VPN: How to edit openvpn.conf on server?

Just_Matt

New Pleskian
Hi all,

as indicated in remarks of /usr/local/psa/var/modules/vpn/openvpn.conf :

#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

I need to add following line to this openvpn.conf :

push "redirect-gateway def1"

VPN-connection between Tunnelblick on running on my Mac and server running Plesk 11.0 works. Now I need to route all my requests on my Mac through this VPN-connection, which does not work yet. I have already added 'redirect-gateway def1' to my Tunnelblick conf, but this doesn't work. Now I found on the web, that I need to add above mentioned line on server-conf.

As it gets overwritten, after every restart of VPN-Server, I need to know, where I can add this line.

Thank you and best regards,

Matthias
 
Maybe you could suggest adding additional configuration directives via http://plesk.uservoice.com ?

In the meantime, you have multiple options. Here are some suggestions:

1) Don't use the Plesk VPN module. Remove it, then manually install and configure openvpn (maybe you could copy the config and key files from the plesk installation first to give you a starting point. Note that there are two main components. the config file, and the various parts of the keys. all are referenced in the config file so you should be able to find them quite easily)

2) Locate the openvpn startup script and modify it so that your line is added to the config before openvpn is started but after plesk has generated the config.
I do find it odd that the configuration is recreated every time the service is started, but there is probably a good reason!
 
I know this post is very old, but i am answering because i found kind of a workaround, while still having the same problem.

You can start the vpn -> then edit the config file -> and then enter the following command:

Code:
# /etc/init.d/psa-vpn reconfigure

This forces the VPN to reread the configuration file while NOT regenerating it.

Yes, this has to be done everytime the VPN Service is restarted, but at least it's a workaround!
 
Back
Top