Community discussions

MikroTik App
 
zerog
just joined
Topic Author
Posts: 9
Joined: Fri Feb 18, 2022 4:48 pm

OpenVPN Point-to-Point not reconnecting

Thu Mar 24, 2022 12:18 pm

Hi everyone,
this is my first post, so please bear with me :)

The network:
network_total_sanitized.png
Both MikroTik devices are on RouterOS v7.1.5

The configuration:
  • Location A:
    /ppp profile
    add local-address=10.200.0.1 name=ovpn only-one=yes remote-address=10.200.0.2 use-encryption=yes
    
    /interface ovpn-server server
    set auth=sha1 certificate=openvpn_server cipher=aes256 default-profile=ovpn enabled=yes keepalive-timeout=disabled max-mtu=1300 port=1194 protocol=udp require-client-certificate=yes
    
    
    I manually added a server binding interface for client1.
  • Location B:
    /ppp profile
    add name=ovpn use-encryption=yes
    
    /interface ovpn-client
    add certificate=openvpn_client_1 cipher=aes256 connect-to=myserver.com mac-address=xx:xx:xx:xx:xx:xx max-mtu=1400 name=ovpn-client port=1194 profile=ovpn protocol=udp user=user1 verify-server-certificate=yes
    

The Problem:
When I initiate the connection everything is working flawlessly. The client is connecting and devices from within the local networks can reach each other. However, if for some reason the ISP router at location B disconnects from the internet (it does for instance reboot once a day or if I simple remove the ethernet cable) the VPN tunnel obviously gets interrupted. The "R" at the OpenVPN client vanishes. However, at location A, the server does not seem to recognize that the client has disconnected (the "R" for the server binding remains there). And once internet connectivity is reestablished the client does not connect (status "Link established). When I manually disable the server binding at location A for a few seconds and re-enable it again, everything is working again, so I assume this has to do with the server, not the client.

What I also tried is playing around with the Keepalive Timeout setting in OVPN-Server and with the Session Timeout setting in the profile section. Unfortunately without success.

Thanks for any advice on this in advance. Just tell me if you need some more information.

Chris
You do not have the required permissions to view the files attached to this post.
 
zerog
just joined
Topic Author
Posts: 9
Joined: Fri Feb 18, 2022 4:48 pm

Re: OpenVPN Point-to-Point not reconnecting

Thu Apr 07, 2022 10:21 pm

Quick heads up: I kind of resolved this by myself by setting the Idle Timeout in the profile section to 30 seconds for the router at location A (the OVPN server). I'm not sure if this is a good solution, but I had no problems since. Maybe someone can confirm this solution?

Thanks,
Chris