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!

Glad you like it! :)

Can you change the interface so that if a supported VPN provider is in use, instead of showing "Exit: Undefined" that it shows something like "Name: ???" where ??? is the description in the VPN client defintiion? For example, I have "New York-JFK" as the name of my VPN client 1.
That's a great suggestion, @Kal1975! The API I'm using is doing a city lookup based on your exit IP, so it's actually pretty rare when it comes up with an "Undefined" message. Usually it spits out a city... and it doesn't matter which VPN provider you're using. But I will definitely consider changing this based on your suggestion!

Also, to clarify, the progress bar at the bottom shows when the next ping is going to happen?
Correct. This is the interval you set during the config which is how often it cycles through testing your connection.

Is there somewhere that explains the numbers on the VPN State line? beside one of them, the active one, I have a "2".
Not really... it's just more geeky info to pour over... 0=Disconnected, 1=Connecting, 2=Connected

How are the VPN Rx, Tx and Total Rx and Tx calculated? When I go to the VPN status page, the values there don't match the values shown by VPNMon.
It's based on the total number of bytes sent and received during the interval across the actual VPN tunnel. It's the same info you see when you're looking at the VPN Status page - TUN/TAP Read/Write Bytes. I know, take it with a grain of salt. Unfortunately that's as accurate as it gets. I don't find it completely accurate either, but whenever I run tests (like large uploads/downloads), it's definitely showing the right type of activity based on my actions, but I would consider it more of a gauge of sorts, just to show what's happening across the tunnel.

I had VPNMon running overnight once and it successfully switched from VPN Client slot 1 to slot 2. Great. The next night I didn't have it running and it didn't run. So it always has to be running and you can use "screen". Maybe VPNMon can be split into two pieces where one is run by CRON every minute to run the check and switch VPN clients, if/when needed while the second piece displays the results of the CRON job. The display can be a one time thing or it can loop until closed so that it would look like the current VPMon. Could this also lend itself to becoming a page in the GUI...I don't know?
Well, you have the option of using my other tool VPNON with cron... but that's just meant to reset your connection at a certain time. This was built into VPNMON-R2 to perform the reset. It doesn't check for your connection. But that's definitely a good suggestion. I will definitely look into whether something like this would be feasible to build into VPNON.

In any case, it's great. Just offering ideas/suggestions for you.

Thanks for this.
Absolutely! I really appreciate the feedback and suggestions! :)
 
Would it be possible to have VPNMON-R2 also update a YazFi Guest network(s) to use the active VPN connection?
 
Would it be possible to have VPNMON-R2 also update a YazFi Guest network(s) to use the active VPN connection?
I'm unfortunately not a YazFi user, but after taking a look at some screenshots to see what you might be referring to, I'm guessing it's this?

YazFi2.png


So when VPNMON-R2 randomly changes slots, you want YazFi to update this slot accordingly, right? I think a big issue that would need to be overcome is determining which of the (up to) possibly 6 guest networks would need to be updated... or would all guest networks use the same VPN connection? In the screenshot above, it seems to be using 2 distinctly different VPN connections. This might be stepping on people's configuration preferences?

I'll see if I can get this installed to play with it, and bounce it off @Jack Yaz to see if there's a way for me to call on YazFi to make sure it updates settings.
 
I'm unfortunately not a YazFi user, but after taking a look at some screenshots to see what you might be referring to, I'm guessing it's this?

View attachment 40988

So when VPNMON-R2 randomly changes slots, you want YazFi to update this slot accordingly, right? I think a big issue that would need to be overcome is determining which of the (up to) possibly 6 guest networks would need to be updated... or would all guest networks use the same VPN connection? In the screenshot above, it seems to be using 2 distinctly different VPN connections. This might be stepping on people's configuration preferences?

I'll see if I can get this installed to play with it, and bounce it off @Jack Yaz to see if there's a way for me to call on YazFi to make sure it updates settings.
Yes, that's the section I'm referring to.

In /jffs/addons/YazFi.d/config, I have wlX.0 and wlX.1 use the same VPN connection. I would imagine a scenario where the user can specify which guest networks to include in the change, and then it leaves the rest alone. So, for example, I would only want VPNMON to adjust VPNCLIENTNUMBER for wl0.1 and wl1.1, then it would apply the changes by running YazFi runnow.

INI:
####################################################################
######                     5 GHz Networks                     ######
####################################################################
######                 Guest Network 1 (wl1.1)                 #####
####################################################################
wl11_ENABLED=true
wl11_IPADDR=X.X.X.0
wl11_DHCPSTART=4
wl11_DHCPEND=254
wl11_DNS1=X.X.X.1
wl11_DNS2=X.X.X.1
wl11_FORCEDNS=true
wl11_ALLOWINTERNET=true
wl11_REDIRECTALLTOVPN=true
wl11_VPNCLIENTNUMBER=1
wl11_TWOWAYTOGUEST=false
wl11_ONEWAYTOGUEST=false
wl11_CLIENTISOLATION=true
 
Yes, that's the section I'm referring to.

In /jffs/addons/YazFi.d/config, I have wlX.0 and wlX.1 use the same VPN connection. I would imagine a scenario where the user can specify which guest networks to include in the change, and then it leaves the rest alone. So, for example, I would only want VPNMON to adjust VPNCLIENTNUMBER for wl0.1 and wl1.1, then it would apply the changes by running YazFi runnow.

INI:
####################################################################
######                     5 GHz Networks                     ######
####################################################################
######                 Guest Network 1 (wl1.1)                 #####
####################################################################
wl11_ENABLED=true
wl11_IPADDR=X.X.X.0
wl11_DHCPSTART=4
wl11_DHCPEND=254
wl11_DNS1=X.X.X.1
wl11_DNS2=X.X.X.1
wl11_FORCEDNS=true
wl11_ALLOWINTERNET=true
wl11_REDIRECTALLTOVPN=true
wl11_VPNCLIENTNUMBER=1
wl11_TWOWAYTOGUEST=false
wl11_ONEWAYTOGUEST=false
wl11_CLIENTISOLATION=true
keep in mind, you would still have to trigger a response from YazFi to update all the wireless guestnetwork interface with YazFi runnow. TBH this would be just as costly as switching over to the guest network gui and triggering it yourself because VPNMON would all of a sudden become responsible for noticing these changes as well. What I mean is, doesn't the device lose connection once guestnetwork is restarted? Would VPNMON be able to recover the page from this? What changes would need to be made?
 
Last edited:
keep in mind, you would still have to trigger a response from YazFi to update all the wireless guestnetwork interface with YazFi runnow. TBH this would be just as costly as switching over to the guest network gui and triggering it yourself because VPNMON would all of a sudden become responsible for noticing these changes as well. What I mean is, doesn't the device lose connection once guestnetwork is restarted? Would VPNMON be able to recover the page from this? What changes would need to be made?
I imagine a device on the guest network would lose the connection, but it should automatically reconnect pretty quickly.

My main reason for using it is that the guest users would lose all internet now if I used more than one VPN slot when the active one changes. This might cause a blip, but they would be back up instantly if it changes to a different slot. I use VPNMON now with only slot one configured because I like how it will find a new server if the load is above the threshold I set.
 
I imagine a device on the guest network would lose the connection, but it should automatically reconnect pretty quickly.

My main reason for using it is that the guest users would lose all internet now if I used more than one VPN slot when the active one changes. This might cause a blip, but they would be back up instantly if it changes to a different slot. I use VPNMON now with only slot one configured because I like how it will find a new server if the load is above the threshold I set.
I think the real challenge might present itself for VPNMON on recovery once the client quickly reconnects. Does this disassociation and re-association present an issue or is it something rather easy to implement. Maybe it doesn't even matter at all as far as the concern goes. It really will take some exploring by the devs.
 
Last edited:
What challenges do you think you might have implementing the vpn-guest network switch feature? I am excited to try it out once it is available (when it is available that is).
Probably the biggest challenge is coming up with code that can find and update that VPNslot entry within the YazFi config file... and making sure it does it right so it doesn't pooch YazFi... because the last thing I want is dealing with the wrath of @Jack Yaz! Lol I haven't found a really great method doing that yet... ie. stepping through a config line by line to find the entry in question, and then saving it so that everything stays intact. Probably just want to think through how I want to incorporate this into the setup of vpnmon. There's the other request I'm also giving some thought to as well from the other thread, which is allowing vpnmon to use multiple countries for multiple (specified) vpn slots. Lots of requests as of late... is it Christmas?? :p
 
Probably the biggest challenge is coming up with code that can find and update that VPNslot entry within the YazFi config file... and making sure it does it right so it doesn't pooch YazFi... because the last thing I want is dealing with the wrath of @Jack Yaz! Lol I haven't found a really great method doing that yet... ie. stepping through a config line by line to find the entry in question, and then saving it so that everything stays intact. Probably just want to think through how I want to incorporate this into the setup of vpnmon. There's the other request I'm also giving some thought to as well from the other thread, which is allowing vpnmon to use multiple countries for multiple (specified) vpn slots. Lots of requests as of late... is it Christmas?? :p
Maybe you could simply source the file variables and make the update that way? (I feel you on that I would not be the expert on such either, I would be scrambling not to mess up @Jack Yaz methods as well). Maybe Jack will have a reasonable and elegant solution.
 
Maybe you could simply source the file variables and make the update that way? (I feel you on that I would not be the expert on such either, I would be scrambling not to mess up @Jack Yaz methods as well). Maybe Jack will have a reasonable and elegant solution.
I *think* I just figured it out! I've got some PoC code that seemed to find and edit a single line in a config file... just needs some serious testing now. Guess I'll install YazFi and eat my own dogfood first. ;)
 
Well... I have a working version of VPNMON-R2 that's currently updating YazFi! Check it out... @SomeWhereOverTheRainBow and @iTyPsIDg

I'm testing using Guest Networks 1 and 2 for both 2.4ghz and 5ghz... This was the before state - VPN Clients No's are set to 1

yazfi_before.jpg


Simulated a reset on VPNMON-R2... and as you can see, it calls "YazFi runnow" after updating its config with the currently assigned VPN slot:

yazfi_reset.jpg


And after-the fact, looking at the current YazFi configuration, showing it changed the VPN slots to the current VPN connection (don't mind the screenshots... it's a combination of different tests, so they're showing different VPN slots. :) )

yazfi_after.jpg


The setup in VPNMON-R2 is pretty straightforward, and asks which YazFi slots you want to have synced. Do you think this takes care of the requirements?

yazfi_config.jpg


Lookin' good! :) I put a beta out there if you wanted to download it to give it a try:

 
Last edited:
Well... I have a working version of VPNMON-R2 that's currently updating YazFi! Check it out... @SomeWhereOverTheRainBow and @iTyPsIDg

I'm testing using Guest Networks 1 and 2 for both 2.4ghz and 5ghz... This was the before state - VPN Clients No's are set to 1

View attachment 40996

Simulated a reset on VPNMON-R2... and as you can see, it calls "YazFi runnow" after updating its config with the currently assigned VPN slot:

View attachment 41000

And after-the fact, looking at the current YazFi configuration, showing it changed the VPN slots to the current VPN connection (don't mind the screenshots... it's a combination of different tests, so they're showing different VPN slots. :) )

View attachment 40998

The setup in VPNMON-R2 is pretty straightforward, and asks which YazFi slots you want to have synced. Do you think this takes care of the requirements?

View attachment 40999

Lookin' good! :) I put a beta out there if you wanted to download it to give it a try:

I'll give it a try as soon as everyone is off conference calls in the house. But from your description, it looks to meet my requirements perfectly. This is going to let me make more use of VPNMON. Thank you!
 
I'll give it a try as soon as everyone is off conference calls in the house. But from your description, it looks to meet my requirements perfectly. This is going to let me make more use of VPNMON. Thank you!
After downloading it, don't forget to run the script with the "-config" flag to set the new options. Let me know how it goes, and I'll schedule it for a release in a few days. ;)
 
After downloading it, don't forget to run the script with the "-config" flag to set the new options. Let me know how it goes, and I'll schedule it for a release in a few days. ;)
After about 11 hours of running it, things seem pretty good.

Issues along the way:
VPN Director configuration. This thread already addressed it, so that was an easy fix.
Some VPN Client configuration settings weren't correct for my VPN to work correctly. I had to update all clients to the following settings:
1651208842065.png

Once I made those changes, it was pretty much smooth sailing.

Thanks for getting this out so quickly!
 
Well... I have a working version of VPNMON-R2 that's currently updating YazFi! Check it out... @SomeWhereOverTheRainBow and @iTyPsIDg

I'm testing using Guest Networks 1 and 2 for both 2.4ghz and 5ghz... This was the before state - VPN Clients No's are set to 1

View attachment 40996

Simulated a reset on VPNMON-R2... and as you can see, it calls "YazFi runnow" after updating its config with the currently assigned VPN slot:

View attachment 41000

And after-the fact, looking at the current YazFi configuration, showing it changed the VPN slots to the current VPN connection (don't mind the screenshots... it's a combination of different tests, so they're showing different VPN slots. :) )

View attachment 40998

The setup in VPNMON-R2 is pretty straightforward, and asks which YazFi slots you want to have synced. Do you think this takes care of the requirements?

View attachment 40999

Lookin' good! :) I put a beta out there if you wanted to download it to give it a try:

This is awesome! And running as described!.

After downloading it, don't forget to run the script with the "-config" flag to set the new options. Let me know how it goes, and I'll schedule it for a release in a few days. ;)
Definitely don't skip this step!

@Viktor Jaep awesome work!
 
After about 11 hours of running it, things seem pretty good.

Issues along the way:
VPN Director configuration. This thread already addressed it, so that was an easy fix.
Some VPN Client configuration settings weren't correct for my VPN to work correctly. I had to update all clients to the following settings:

Once I made those changes, it was pretty much smooth sailing.

Thanks for getting this out so quickly!

Glad it's working out good for you! Let me know how things look after a few resets, and make sure everything works as advertised for your YazFi clients! I'll check in with you over the weekend. ;)
 

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!
Top