OPNsense Forum

English Forums => Virtual private networks => Topic started by: Yourry on January 15, 2023, 11:52:35 AM

Title: Restart OpenVPN client service configuration automatically
Post by: Yourry on January 15, 2023, 11:52:35 AM
Hi,
I have two OpenVPN clients on my OpenSense machine whose server config I don't manage.
Unfortunately from time to time, the two clients can be in the same IP range and this gives me problems for the routing, here is an illustration of the problem:
(https://www.roj.fr/wp-content/uploads/2023/01/bug_ip_openvpn-1.png)

In this case, in the "VPN: OpenVPN: Connection Status" menu, I restart the service until the vpn server gives me another ip address:

(https://www.roj.fr/wp-content/uploads/2023/01/bug_ip_openvpn_2-e1673779644336.png)

Once done, everything works and no more problems:
(https://www.roj.fr/wp-content/uploads/2023/01/bug_ip_openvpn_3.png)

But how do you do this automatically? On the OpenVPN client side, there is a command/option that can ban an IP?
Thanks for your help