# VPN Instability getting old

**URL:** <https://forum.gl-inet.com/t/vpn-instability-getting-old/4104>\
**Category:** Router\
**Created:** [July 26, 2018, 3:49pm UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104 "2018-07-26T15:49:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimballslice1890](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@kimballslice1890](https://forum.gl-inet.com/u/kimballslice1890)\
**Post date:** [July 26, 2018, 3:49pm UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/1 "2018-07-26T15:49:47Z")

</div>

VPN stability issues is getting very annoying. I am a subscriber to Private Internet Access. I own a MT300A-EXT, MT300Nv2 and AR300 Lite. All of them I have been running on version 2.26 in order to receive the best stability for OpenVPN which is the main reason I bought the routers, to connect my devices to a VPN connected device. I recently updated my MT300Nv2 to 2.271 the latest version. I did this after seeing the Slate anouncement thinking the software update was going to be what was described. (its not, no big deal). But my issue is my VPN wont stay connected. I always get errors which is why I always end up reverting to 2.26 (because it is the most stable with OpenVPN).

Here is the most recent error:  
ERROR: Linux route delete command failed: external program exited with error status: 2 ERROR: Linux route delete command failed: external program exited with error status: 2 ERROR: Linux route delete command failed: external program exited with error status: 2 /sbin/ip addr del dev tun0 local 10.50.10.6 peer 10.50.10.5 SIGTERM[soft,auth-failure] received, process exiting

Can someone explain what is going on? will these issues ever be fixed or is it something I have to live with resetting my VPN switch periodically…

Any version past 2.26 my VPN will error out within an hour usually closer to a few minutes.

2.26 I’ve had it running for 24 hours without issue before getting an error.

---

<div class="post-metadata">

**Author:** ![Johnex](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/johnex/32/300_2.png) [@Johnex](https://forum.gl-inet.com/u/Johnex)\
**Post date:** [July 26, 2018, 5:53pm UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/2 "2018-07-26T17:53:51Z")

</div>

The 2.271 firmware has been the most unstable for almost everyone not only you. The new slate will come with v3 of the firmware which is not out yet, but that one will be much more stable and faster than the v2’s.

v3 will start rolling out in the next few weeks so hold on for that and use the 2.26 until then.

---

<div class="post-metadata">

**Author:** ![glitch](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/0ea827/32.png) [@glitch](https://forum.gl-inet.com/u/glitch)\
**Post date:** [July 27, 2018, 6:35am UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/3 "2018-07-27T06:35:13Z")

</div>

Many, if not most of these disconnect problems are PIA related- switch to a another provider (like I did) and you will be much happier!

---

<div class="post-metadata">

**Author:** ![nopro404](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/nopro404/32/513_2.png) [@nopro404](https://forum.gl-inet.com/u/nopro404)\
**Post date:** [July 28, 2018, 2:48pm UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/4 "2018-07-28T14:48:38Z")

</div>

For me on 2.27 with the `Switch Button Configuration` set to `OpenVpn Toggle` my router will start two processes of openvpn which conflict with each other. If the router tries to restart openvpn I will get this `ERROR: Linux route delete command failed` because of the conflict.

To see if this is your issue, you can ssh into the router and see if two openvpn’s are running. Execute:  
`ps | grep openvpn`

If you have two,you are having the same problem as I did.

Disable the `Switch Button Configuration` and reboot - then just use the toggle `Enable` OpenVPN button on the VPN page.

The `startvpn` init script doesn’t do sanity checks before starting the daemon and there is a race condition with `startvpn` being called twice on bootup in the `initswitch` and `startvpn` scripts.

---

<div class="post-metadata">

**Author:** ![nopro404](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/nopro404/32/513_2.png) [@nopro404](https://forum.gl-inet.com/u/nopro404)\
**Post date:** [July 30, 2018, 11:58pm UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/5 "2018-07-30T23:58:27Z")

</div>

In 2.27 `/etc/init.d/startvpn`

This line was changed:

> stop(){  
> kill -9 $(cat /var/run/ovpn\_client.pid) \>/dev/null 2\>&1

The problem is startvpn is being called twice so there are two processes. This kill command doesn’t kill the conflicting one - only the one that wrote its pid file.

The old script prior to 2.27 ran

> stop(){  
> killall openvpn

Which would clean up the conflicting openvpn process on vpn restart (and not fully exposing the race condition that was still present then). Dirty - but it sort of worked.

@alzhao Ideally it would be best to add some logic at the top of the `startvpn` start function like

> start(){  
> if [“$(pgrep /usr/sbin/openvpn)”]; then  
> echo OpenVPN already started… Exiting.  
> exit 1  
> fi

This fixes it so I can use the switch to toggle VPN and if startvpn is called twice, the second time it will exit properly.

---

<div class="post-metadata">

**Author:** ![Exile1975](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/e/6de8d8/32.png) [@Exile1975](https://forum.gl-inet.com/u/Exile1975)\
**Post date:** [July 31, 2018, 1:03am UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/6 "2018-07-31T01:03:39Z")

</div>

I posted a modified file here that should fix what you’re discussing.

> [@Initswitch causing problems or](https://forum.gl-inet.com/t/initswitch-causing-problems-or/3615/4):
>
> Turns out I was a little early saying all was fixed. What i did also caused the switch to NOT turn the vpn back on if you turned it off and on without a reboot. I’m uploading a zip with my new fix. Tested for a few days and now the switch turns off and on, and doesn’t start the vpn twice. @Johnex[initswitch-test.zip](https://forum-static.gl-inet.com/original/1X/25cab641d1f4722c2c027cbec6dc6bb496dbb078.zip) (741 Bytes)

---

<div class="post-metadata">

**Author:** ![nopro404](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/nopro404/32/513_2.png) [@nopro404](https://forum.gl-inet.com/u/nopro404)\
**Post date:** [July 31, 2018, 1:45am UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/7 "2018-07-31T01:45:28Z")

</div>

That’s cool you found the problem as well. Your modification will actually just exit the script once it gets to the exit 0 you added on line 63 - not starting openvpn from the script. The same effect would be just deleting the openvpn start command in the original script. The reason why it works for you is its being started by startvpn later in the boot process.

It’s best to fix it at the source of the problem. If `startvpn` start or restart is called multiple times, it should refuse to spawn more processes, exit with an error message and error code.

---

<div class="post-metadata">

**Author:** ![bruce](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bruce/32/35649_2.png) [@bruce](https://forum.gl-inet.com/u/bruce)\
**Post date:** [October 29, 2025, 2:56am UTC](https://forum.gl-inet.com/t/vpn-instability-getting-old/4104/8 "2025-10-29T02:56:35Z")

</div>


