What's new

VPNMON VPNMON-R2 v2.0 -Jul 10, 2022- Monitor your VPN connection's Health (Thread locked/closed)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Do you have Git installed? With Atom, Visual Studio, and many other editors, you can integrate Git commands to push your changes.
I actually don't... was using Atom simply as a visually pleasing editor. But now I'm finding out it can do a lot more. I'll be toying around with this for sure. :)
 
silly question, how to uninstall /stop it from running?
First off... why would *anyone* want to uninstall VPNMON-R2! :p Haha... just kidding!

As long as you're not executing it using an sh command (or with the screen utility), then it's not running, and just sitting dormant in the background. You'll know when it's running, because the UI will stay up on your screen, and refresh itself every 60 seconds (by default).

If you want to completely uninstall it... (and thank you for the suggestion - I'll be adding this as a commandline parameter on my next release), you will need to execute these commands from a prompt:

Code:
rm -r /jffs/addons/vpnmon-r2.d
rm /jffs/scripts/vpnmon-r2.sh

Sorry to see you go, @andywee!
 
First off... why would *anyone* want to uninstall VPNMON-R2! :p Haha... just kidding!

As long as you're not executing it using an sh command (or with the screen utility), then it's not running, and just sitting dormant in the background. You'll know when it's running, because the UI will stay up on your screen, and refresh itself every 60 seconds (by default).

If you want to completely uninstall it... (and thank you for the suggestion - I'll be adding this as a commandline parameter on my next release), you will need to execute these commands from a prompt:

Code:
rm -r /jffs/addons/vpnmon-r2.d
rm /jffs/scripts/vpnmon-r2.sh

Sorry to see you go, @andywee!
:oops: I am perfectly content leaving mine running. Such a nifty tool.
 
:oops: I am perfectly content leaving mine running. Such a nifty tool.
Lol. I can understand that people have a specific "mission" when it comes to how they want their router to handle their VPN connectivity. Some people may not want to randomize their VPN slots on a daily basis, and be content with 1 slot connecting to the same server day after day. I won't stand in the way... I'm just here to help expand that horizon if they ever want to take the leap. ;)

PS. the uninstall option has been added to my internal alpha. I've also run it through ShellCheck's paces, and just weary to see if anything gets borked after making all these formatting changes. So I'll be keeping a close eye on things for a while. Thanks again for the suggestion!
 
Lol. I can understand that people have a specific "mission" when it comes to how they want their router to handle their VPN connectivity. Some people may not want to randomize their VPN slots on a daily basis, and be content with 1 slot connecting to the same server day after day. I won't stand in the way... I'm just here to help expand that horizon if they ever want to take the leap. ;)

PS. the uninstall option has been added to my internal alpha. I've also run it through ShellCheck's paces, and just weary to see if anything gets borked after making all these formatting changes. So I'll be keeping a close eye on things for a while. Thanks again for the suggestion!
Randomized is the only way to travel....! :cool:
 
:oops: I am perfectly content leaving mine running. Such a nifty tool.
thanks. the reason why I find it doesnt work suits me is because I'm hailing from china/shanghai.
let me explain. the choices of VPN servers are very limited. taiwan / japan / US. i'm on VPN.ac
I tried increasing to 600s for inbetweens. and increased the ping to 10. but it seems it would always disconnecting the internet or at least it would get very intermittent on me..

not sure if it's because of the current situation in shanghai or other factors. but yeah, my VPN needs are rather unique. taiwan for my echo dots( low latency but also low bandwidth) and japan for my partner's mobile devices and US for my other devices.

so i ironically need all 3 vpn paths based on their assigned DHCP addresses. but was trying to find a way to maybe create a fail safe route where if 1 VPN route was pinging higher than normal or no longer responding due to CCP interfering with the internet, I could get it to reinitiate the connection.

but yeah. there ya go.

awesome coding btw, the ascii does bring back some memories
 
thanks. the reason why I find it doesnt work suits me is because I'm hailing from china/shanghai.
let me explain. the choices of VPN servers are very limited. taiwan / japan / US. i'm on VPN.ac
I tried increasing to 600s for inbetweens. and increased the ping to 10. but it seems it would always disconnecting the internet or at least it would get very intermittent on me..

not sure if it's because of the current situation in shanghai or other factors. but yeah, my VPN needs are rather unique. taiwan for my echo dots( low latency but also low bandwidth) and japan for my partner's mobile devices and US for my other devices.

so i ironically need all 3 vpn paths based on their assigned DHCP addresses. but was trying to find a way to maybe create a fail safe route where if 1 VPN route was pinging higher than normal or no longer responding due to CCP interfering with the internet, I could get it to reinitiate the connection.

but yeah. there ya go.

That is definitely a very unique situation, @andywee! You may want to check out the VPN Failover tool that was written by @Martineau? That might provide you with what you need? Best of luck with your VPN situation! That does not sound fun when other factors are interfering with your connection. :(

awesome coding btw, the ascii does bring back some memories

Thanks for that! I'm a huge ASCII buff... used to run an old BBS (bulletin board system) back in the day off a couple of 28.8k modems. Definitely brought back some memories... :p
 
I've noticed that sometimes I get into a loop with vpnmon because the VPN fails to connect. I think the VPN is failing because it tries to connect to four of the servers (I use slots 1-4 and I reserve 5 for a different country connection), then it disconnects after randomly selecting one.

I would suggest flipping the order. Randomly select the slot, then only activate that VPN connection. That should stop errors from multiple UDP connections at the exact same time.
 
Also, should it do anything with client 5 if I don't have the tool configured to use it?

1651706746218.png


Is that part of vpnmgr? If so, that would make sense why it does anything with client 5.
 
I've noticed that sometimes I get into a loop with vpnmon because the VPN fails to connect. I think the VPN is failing because it tries to connect to four of the servers (I use slots 1-4 and I reserve 5 for a different country connection), then it disconnects after randomly selecting one.

I would suggest flipping the order. Randomly select the slot, then only activate that VPN connection. That should stop errors from multiple UDP connections at the exact same time.
That's actually exactly what it does. it's randomly selects the slot, then only activates that vpn connection. Could you provide some more info as to why it fails to connect? Do you have logs that show some reasoning behind why?

Once connected, it will loop through again and test whether or not something is pinging. Have you tried using a different server to ping to, or are you using something like 8.8.8.8? If it can't ping the specified server, it will assume its down, and go through the process again of killing the connections and trying to re-establish a connection.

I will try to duplicate your setup... using slots 1-4 for vpnmon-r2, and specifying slot 5 for a different country with vpnmgr... and using vpnmgr to manage the slot destinations. I'll let you know if I run into similar issues!
 
Last edited:
Also, should it do anything with client 5 if I don't have the tool configured to use it?

View attachment 41104

Is that part of vpnmgr? If so, that would make sense why it does anything with client 5.

Yep, it looks like you have that enabled through vpnmgr... ;) But it shouldn't be interfering with vpnmon activating clients 1-4.
 
Last edited:
So @iTyPsIDg... I have not been able to make it fail yet. Slots 1-4 are monitored by vpnmgr-r2... slots 1-5 are managed by vpnmgr, with 1-4 located in the US, slot 5 is in Canada. I've reset it a couple of times to see if I could duplicate this loop you experienced, but no joy. I even had 2 VPN connections running at once... VPN 2 was selected by vpnmgr-r2, and manually started VPN slot 5 as you can see below... but everything continued to work just fine. I'll let it run a few days and see if I see anything strange.

Screenshot 2022-05-04 19.58.40.png
 
So @iTyPsIDg... I have not been able to make it fail yet. Slots 1-4 are monitored by vpnmgr-r2... slots 1-5 are managed by vpnmgr, with 1-4 located in the US, slot 5 is in Canada. I've reset it a couple of times to see if I could duplicate this loop you experienced, but no joy. I even had 2 VPN connections running at once... VPN 2 was selected by vpnmgr-r2, and manually started VPN slot 5 as you can see below... but everything continued to work just fine. I'll let it run a few days and see if I see anything strange.

View attachment 41105
It does specifically happen during reboots. I have vpnmon-r2 set to automatically start at a reboot and that's when it occurs. It isn't consistent either, I'm wondering if it's when my partner isn't home so we are hitting the max five VPN connections. I get authentication errors. If I stop vpnmon-r2, then manually start a client, then start vpnmon-r2, it works fine.

I'll see if anything would still be in the logs.
 
It does specifically happen during reboots. I have vpnmon-r2 set to automatically start at a reboot and that's when it occurs. It isn't consistent either, I'm wondering if it's when my partner isn't home so we are hitting the max five VPN connections. I get authentication errors. If I stop vpnmon-r2, then manually start a client, then start vpnmon-r2, it works fine.

I'll see if anything would still be in the logs.
Hmm... yeah, I never reboot my router, and I don't have it set to start automatically. Do you have any of your vpn client slots set to start automatically ie. "Automatic start at boot time"? VPNMON-R2 doesn't really have anything to do with authentication... it just tells the router to connect using which vpn slot. Wondering if there's a timing issue... like your router hasn't gotten the right date/time yet before trying to connect to your vpn, so it errors out then. I was just reading about a similar issue that might be worth following, or diving into deeper here: https://www.snbforums.com/threads/n...atically-after-reboot-on-asus-rt-ac68u.78777/
 
Hmm... yeah, I never reboot my router, and I don't have it set to start automatically. Do you have any of your vpn client slots set to start automatically ie. "Automatic start at boot time"? VPNMON-R2 doesn't really have anything to do with authentication... it just tells the router to connect using which vpn slot. Wondering if there's a timing issue... like your router hasn't gotten the right date/time yet before trying to connect to your vpn, so it errors out then. I was just reading about a similar issue that might be worth following, or diving into deeper here: https://www.snbforums.com/threads/n...atically-after-reboot-on-asus-rt-ac68u.78777/
I bet that's it. I have them all set that way. But I suppose I shouldn't set them that way with your tool, right?

I just looked at the logs, here's a snippet. It looks like it happens during the VPN reset at night for about two hours.

Less:
ay  4 01:02:11 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2
May  4 01:02:13 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 01:02:17 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2
May  4 01:02:20 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 01:05:24 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2
May  4 01:05:26 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 01:05:30 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2
May  4 01:05:32 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
...


May  4 02:41:49 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:43:03 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 1
May  4 02:43:05 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:43:10 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 1
May  4 02:43:12 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:45:29 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 02:45:32 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:45:36 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 02:45:38 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:49:15 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 1
May  4 02:49:17 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:49:21 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 1
May  4 02:49:24 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:50:53 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 02:50:56 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:51:00 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 02:51:02 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:53:20 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 1
May  4 02:53:23 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:53:27 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 1
May  4 02:53:29 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:56:27 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 02:56:29 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:56:34 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 02:56:36 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:59:20 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 3
May  4 02:59:22 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 02:59:26 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 3
May  4 02:59:29 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 03:01:46 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 3
May  4 03:01:48 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 03:01:52 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 3
May  4 03:01:54 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 03:04:50 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 03:04:52 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 03:04:56 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 4
May  4 03:04:58 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 03:07:33 RT-AX86U-ADA0 YazFi: wl0.1 (SSID: Guest1-US-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2
May  4 03:07:35 RT-AX86U-ADA0 YazFi: wl0.2 (SSID: Guest1-Other-2G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
May  4 03:07:39 RT-AX86U-ADA0 YazFi: wl1.1 (SSID: Guest1-US-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2
May  4 03:07:42 RT-AX86U-ADA0 YazFi: wl1.2 (SSID: Guest1-Other-5G) - VPN redirection enabled, sending all interface internet traffic over VPN Client 5
 
That's actually exactly what it does. it's randomly selects the slot, then only activates that vpn connection. Could you provide some more info as to why it fails to connect? Do you have logs that show some reasoning behind why?

Once connected, it will loop through again and test whether or not something is pinging. Have you tried using a different server to ping to, or are you using something like 8.8.8.8? If it can't ping the specified server, it will assume its down, and go through the process again of killing the connections and trying to re-establish a connection.

I will try to duplicate your setup... using slots 1-4 for vpnmon-r2, and specifying slot 5 for a different country with vpnmgr... and using vpnmgr to manage the slot destinations. I'll let you know if I run into similar issues!
I have been doing that connect to specific host and keep it as it is. I like the IP address, silly reason I know. I have not spend enough time to read through and get a better picture of your script. Earlier I have the impression it only works for a single VPN connection. What if I have three VPN connection, using ovpnc1, ovpnc3 and ovpnc5. Each connect to different country. Will it randomize accordingly and have the option to keep the city/country? Obviously I did not RTFM. I will probably spend some time over the weekend and apply it. Thanks for your sharing.
 
That is definitely a very unique situation, @andywee! You may want to check out the VPN Failover tool that was written by @Martineau? That might provide you with what you need? Best of luck with your VPN situation! That does not sound fun when other factors are interfering with your connection. :(



Thanks for that! I'm a huge ASCII buff... used to run an old BBS (bulletin board system) back in the day off a couple of 28.8k modems. Definitely brought back some memories... :p
We just revealed our age. 7.2k 14.4 28 56k then the almost never seen 128k just before ISDN. yeah. i used to do BBS too.
 
Similar threads
Thread starter Title Forum Replies Date
Ripshod (Not specifically) VPNMON-R3 1.11 failure domino effect Asuswrt-Merlin AddOns 20

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top