AR300M Mango VPN won't Reconnect when IP Changes


I have a big Problem with all of my AR300M (FW 3.215) Routers i use with OpenVPN over LTE and also at home via
Internet Provider Internet. Sometimes when i receive a new IPv4 Adress (when internet drops) the Openvpn stopps and i need to reconnect manually the VPN. Is there any way to add some script or setting so the VPN is reconnecting after a certain time ? I looked in Luci for some Plugin but coud not find anything. I am using AirVPN config files for Openvpn. I read somewhere that openvpn offers some command like --up-restart
So not sure if that woud work and if i can Edit that provided AirVPN config file with that --up-restart command.

Do you have keepalive settings in your OVPN config file? You may be able to adjust those to remedy slow/no reconnects in openvpn.

# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120


I just checked and opened the provided openvpn config from airvpn provider. In the Mango router there is no option to add some commands and there is no keepalive setting.

This is what was inside the openvpn config

OpenVPN Client Configuration



dev tun
resolv-retry infinite
verb 3
setenv UV_IPV6 yes
remote-cert-tls server
cipher AES-256-CBC
comp-lzo no
proto tcp
auth SHA512


In the Airvpn Config generator on there website there is the Option to add OpenVPN custom directives.

Not sure if I can add some commands there or just edit the provided config file.

If you cannot edit your existing VPN profile just edit a new copy, delete your old profile and upload your new one with keepalive 10 60 (for example) so that your connection will automatically reconnect after 60 seconds of losing connectivity.

Yes i have edited all the config files. Now i will see if its working next time connection drops. Thx for helping.

Unfortunaly the keepalive setting did not change anything. Today the Internet have dropped for a few seconds and i got a new ip. The VPN is disconnected and i have waited several Minutes without success. Only way is to tap Abort and click connect in openvpn Tab. There must be some solution so it auto reconnects ? I wonder why there is no Option in Glinet Router for this or any script ready to download in luci.

If you don’t get a satisfactory response in that other thread to if that auto-reconnect script is still valid, there are openwrt utilities like watchcat that can restart your tun0 interface, similar to the keepalive function.