What's new

VPNMON VPNMON-R2 v2.65 -Jan 27, 2024- DISCONTINUED - Upgrade to VPNMON-R3 Available! (#3)

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

What do you mean with "got stacked"? There is a possibility that it couldn't reconnect because of the Killswitch. How do you have vpnmon configured?
Thanks for coming back.

by got stacked I mean the script was stacked somewhere in routine i.e. it stopped trying to connect for some reason, last try was on 04:16:09 (VPN reset) and no logs after this time until I kill it and re-run the script manually. Shame i did not take the picture from SSH :(
Code:
Fri Jul 21 04:16:09 CEST 2023 - VPNMON-R2 - Executing VPN Reset
Fri Jul 21 19:29:53 CEST 2023 - VPNMON-R2 - API call made to update WAN0 city to Brno

Here are more detail logs from the router itselfs
Code:
<15>1    2023-07-21T04:15:02+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 3
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient4)
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 841:notify_rc stop_vpnclient5
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient4" via  ...
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 4
<15>1    2023-07-21T04:15:04+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient5)
<15>1    2023-07-21T04:15:04+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 5
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1312:notify_rc stop_vpnclient1
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient1)
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1316:notify_rc stop_vpnclient2
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient1" via  ...
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 1
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient2)
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1354:notify_rc stop_vpnclient3
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient2" via  ...
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 2
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient3)
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1394:notify_rc stop_vpnclient4
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient3" via  ...
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 3
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient4)
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1462:notify_rc stop_vpnclient5
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient4" via  ...
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 4
Manual kill and restart time           
<15>1    2023-07-21T19:29:57+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14093:notify_rc stop_vpnclient1
<15>1    2023-07-21T19:29:57+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient1)
<15>1    2023-07-21T19:29:58+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14096:notify_rc stop_vpnclient2
<15>1    2023-07-21T19:29:58+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient1" via  ...
<15>1    2023-07-21T19:29:58+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 1
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient2)
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14136:notify_rc stop_vpnclient3
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient2" via  ...
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 2
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient3)
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14173:notify_rc stop_vpnclient4
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient3" via  ...
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 3
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient4)
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14214:notify_rc stop_vpnclient5
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient4" via  ...
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 4
<15>1    2023-07-21T19:30:02+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient5)
<15>1    2023-07-21T19:30:02+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 5

99% time, the script is running just fine. This was the first time my internet (WAN connection) was offline for 20h and when WAN connection gets back the script was not trying to reconnect.

Attaching config.

Screenshot 2023-07-22 140955.jpg


Screenshot 2023-07-22 141017.jpg
 
Thanks for coming back.

by got stacked I mean the script was stacked somewhere in routine i.e. it stopped trying to connect for some reason, last try was on 04:16:09 (VPN reset) and no logs after this time until I kill it and re-run the script manually. Shame i did not take the picture from SSH :(
Code:
Fri Jul 21 04:16:09 CEST 2023 - VPNMON-R2 - Executing VPN Reset
Fri Jul 21 19:29:53 CEST 2023 - VPNMON-R2 - API call made to update WAN0 city to Brno

Here are more detail logs from the router itselfs
Code:
<15>1    2023-07-21T04:15:02+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 3
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient4)
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 841:notify_rc stop_vpnclient5
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient4" via  ...
<15>1    2023-07-21T04:15:03+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 4
<15>1    2023-07-21T04:15:04+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient5)
<15>1    2023-07-21T04:15:04+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 5
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1312:notify_rc stop_vpnclient1
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient1)
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1316:notify_rc stop_vpnclient2
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient1" via  ...
<15>1    2023-07-21T04:16:09+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 1
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient2)
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1354:notify_rc stop_vpnclient3
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient2" via  ...
<15>1    2023-07-21T04:16:10+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 2
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient3)
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1394:notify_rc stop_vpnclient4
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient3" via  ...
<15>1    2023-07-21T04:16:11+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 3
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient4)
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 1462:notify_rc stop_vpnclient5
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient4" via  ...
<15>1    2023-07-21T04:16:12+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 4
Manual kill and restart time          
<15>1    2023-07-21T19:29:57+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14093:notify_rc stop_vpnclient1
<15>1    2023-07-21T19:29:57+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient1)
<15>1    2023-07-21T19:29:58+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14096:notify_rc stop_vpnclient2
<15>1    2023-07-21T19:29:58+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient1" via  ...
<15>1    2023-07-21T19:29:58+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 1
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient2)
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14136:notify_rc stop_vpnclient3
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient2" via  ...
<15>1    2023-07-21T19:29:59+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 2
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient3)
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14173:notify_rc stop_vpnclient4
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient3" via  ...
<15>1    2023-07-21T19:30:00+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 3
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient4)
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: service 14214:notify_rc stop_vpnclient5
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    rc_service - - - rc_service: waitting "stop_vpnclient4" via  ...
<15>1    2023-07-21T19:30:01+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 4
<15>1    2023-07-21T19:30:02+02:00    RT-AX86U-3E18-AB67A2D-C    custom_script - - - custom_script: Running /jffs/scripts/service-event (args: stop vpnclient5)
<15>1    2023-07-21T19:30:02+02:00    RT-AX86U-3E18-AB67A2D-C    openvpn-routing - - - openvpn-routing: Clearing routing table for VPN client 5

99% time, the script is running just fine. This was the first time my internet (WAN connection) was offline for 20h and when WAN connection gets back the script was not trying to reconnect.

Attaching config.

View attachment 51874

View attachment 51876
Thanks for sharing that additional info, @salvo! It seems to me like something just got hung on your router, and prevented further execution of the script... thereby hanging vpnmon. Hard to tell, but it seems like after it killed the VPN #4 slot, it got stuck... could have just been something fatal on the router OS side, especially if it may already have been struggling with the WAN being down? I used to have a horrible time with the AC86U locking up with any kind of scripting running like every few days, and that's because there's an actual software bug on that model that causes that, but seeing you're on the AX86U, you shouldn't experience any of those issue... I'm going to say it was a random fluke! :) Thank you for reporting this!
 
I also assume kind of very rare case, however after VPN #4 got stuck there is no fatal or even any error in router debug log, router seems to be working fine (except WAN connection) .

As there is no more data to troubleshoot, nothing more to do !
 
I noticed that the ping response times of the disconnected VPN slots does not match with my ping tests.
In line #2516 the script pings the VPN servers through the WAN interface one time (-c 1) and I guess that this is not accurate. Because the first ping response is always higher than the subsequent ping responses. That is at least the case at my end.
 
I noticed that the ping response times of the disconnected VPN slots does not match with my ping tests.
In line #2516 the script pings the VPN servers through the WAN interface one time (-c 1) and I guess that this is not accurate. Because the first ping response is always higher than the subsequent ping responses. That is at least the case at my end.
There are a bunch of variables here. Ping is run directly from the router using a script. The router is not a high performance machine, like a dedicated PC. As with speed tests, you will typically have much better results running these from a wired PC than from the router itself. Please know, many of these stats are as-is... the way stats are collected and displayed are quite crude based on what you have to work with. While I could take the approach to let ping run a little longer to get a more accurate number, the object here is to try to draw the screen as fast as practical. I appreciate your feedback!
 
Thanks for your reply.
I've updated the script and took only the second ping response.

Before:
- VPN1 Disconnected | || 24.119 ms || |
- VPN2 Disconnected | || 23.810 ms || |
==VPN3 Tunnel Active | || 21.723 ms || | Exit: XXXXXX
- VPN4 Disconnected | || 26.588 ms || |
- VPN5 Disconnected | || 23.552 ms || |

After:
- VPN1 Disconnected | || 20.634 ms || |
- VPN2 Disconnected | || 20.520 ms || |
==VPN3 Tunnel Active | || 21.647 ms || | Exit: XXXXXX
- VPN4 Disconnected | || 18.946 ms || |
- VPN5 Disconnected | || 19.415 ms || |
 
Any plans to make this app work with Wireguard?
I have been hoping to dive into Wireguard and see how it compares with OVPN, but haven't had much of a chance to do so yet. Depending on how similar it works, or if there are a lot of loopholes or other weird showstoppers, I hope to tackle a review in the near future to determine the viability of incorporating it into vpnmon. Wouldn't hold your breath tho... ;)
 
Last edited:
I am in a loop of "error: wan down" and when I tried to check if I 8.8.8.8:443 is reachable, here is what I get:

Code:
admin@RT-AX88U-D108:/tmp/home/root# nc -w3 8.8.8.8 443 && echo | openssl s_clien
t -connect 8.8.8.8:443 | awk 'handshake && $1 == "Verification" { if ($2=="OK")
exit; exit 1 } $1 $2 == "SSLhandshake" { handshake = 1 }'

Can't use SSL_get_servername
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1
depth=0 CN = dns.google
verify return:1
DONE

What does this tell you?
 
I am in a loop of "error: wan down" and when I tried to check if I 8.8.8.8:443 is reachable, here is what I get:

Code:
admin@RT-AX88U-D108:/tmp/home/root# nc -w3 8.8.8.8 443 && echo | openssl s_clien
t -connect 8.8.8.8:443 | awk 'handshake && $1 == "Verification" { if ($2=="OK")
exit; exit 1 } $1 $2 == "SSLhandshake" { handshake = 1 }'

Can't use SSL_get_servername
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1
depth=0 CN = dns.google
verify return:1
DONE

What does this tell you?

I get the same results, which means things are working there... what does your setup look like? Are you running dual WAN? Has it ever worked, or right from the go, drops into WAN down mode?

Can you post a snippet of the vpnmon-r2 log?

What are the results of these commands?

Code:
nvram get wan0_state_t

nvram get wan1_state_t
 
Last edited:
Funny I slept over it last night and now it looks like everything is working!
Code:
  _    ______  _   ____  _______  _   __      ____ ___
  | |  / / __ \/ | / /  |/  / __ \/ | / /     / __ \__ \  v2.59
  | | / / /_/ /  |/ / /|_/ / / / /  |/ /_____/ /_/ /_/ / (S)etup
  | |/ / ____/ /|  / /  / / /_/ / /|  /_____/ _, _/ __/  (R)eset
  |___/_/   /_/ |_/_/  /_/\____/_/ |_/     /_/ |_/____/  (E)xit
 ____________
/General Info\_____________________________________________________

  Sun Aug 13 11:28:54 EDT 2023 ------- Last Reset: 0d 09h:43m:09s
  VPN State 1:0 2:2 3:0 4:0 5:0 --- Public VPN IP: 155.94.216.251
  WAN State 0:2 1:2 ----------------- Sched Reset: 01:00 / 60 Sec
  Auto Start After Reboot Protection ----- Status: On / post-mount
 __________
/Interfaces\_______________________________________________________

 ==WAN0 eth0 Active | || 28.969 ms || | Exit: Atlanta
 ==WAN1 eth1 Active | || 57.712 ms || | Exit: Wilmington
 ------------------------------------------------------------------
 - VPN1 Disconnected  | || 39.483 ms || |
 ==VPN2 Tunnel Active | || 53.391 ms || | Exit: Atlanta
 - VPN3 Disconnected  | || 32.046 ms || |
 - VPN4 Disconnected  | || 61.698 ms || |
 - VPN5 Disconnected  | || 66.220 ms || |

Yes I am on dual wan and how do I post the logs? I have no idea how to use Nano -- can I export the logs into a txt file?
 
Funny I slept over it last night and now it looks like everything is working!
Code:
  _    ______  _   ____  _______  _   __      ____ ___
  | |  / / __ \/ | / /  |/  / __ \/ | / /     / __ \__ \  v2.59
  | | / / /_/ /  |/ / /|_/ / / / /  |/ /_____/ /_/ /_/ / (S)etup
  | |/ / ____/ /|  / /  / / /_/ / /|  /_____/ _, _/ __/  (R)eset
  |___/_/   /_/ |_/_/  /_/\____/_/ |_/     /_/ |_/____/  (E)xit
 ____________
/General Info\_____________________________________________________

  Sun Aug 13 11:28:54 EDT 2023 ------- Last Reset: 0d 09h:43m:09s
  VPN State 1:0 2:2 3:0 4:0 5:0 --- Public VPN IP: 155.94.216.251
  WAN State 0:2 1:2 ----------------- Sched Reset: 01:00 / 60 Sec
  Auto Start After Reboot Protection ----- Status: On / post-mount
 __________
/Interfaces\_______________________________________________________

 ==WAN0 eth0 Active | || 28.969 ms || | Exit: Atlanta
 ==WAN1 eth1 Active | || 57.712 ms || | Exit: Wilmington
 ------------------------------------------------------------------
 - VPN1 Disconnected  | || 39.483 ms || |
 ==VPN2 Tunnel Active | || 53.391 ms || | Exit: Atlanta
 - VPN3 Disconnected  | || 32.046 ms || |
 - VPN4 Disconnected  | || 61.698 ms || |
 - VPN5 Disconnected  | || 66.220 ms || |

Yes I am on dual wan and how do I post the logs? I have no idea how to use Nano -- can I export the logs into a txt file?

Glad to hear... perhaps just a fluke with Dual WAN... just letting you know, it isn't exactly easy to deal with on these routers, and definitely recommend you run the Dual WAN Failover script, as that does bring a lot more stability to this function...

From the VPNMON setup screen, you can hit "vl" which will let you see the logs (or from a command prompt, type "vpnmon-r2 -log"... from there hit CTRL-V to page down, and CTRL-Y to page up within NANO... ;) If you're using a tool like PuTTY, you can capture all screen output to a text file.
 
No need for logs for a working system. 🙂
 
I took some segment of the log because it is very long. Basically for a few hours the same text repeated itself over and over again in the log. Hope this can help you with the development of the script!

BTW I have been using the Daul wan failover script as well.

Code:
Sat Aug 12 23:46:52 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:47:08 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:47:20 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sat Aug 12 23:47:24 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:47:27 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sat Aug 12 23:48:27 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:48:33 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:49:37 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:49:46 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:49:59 EDT 2023 - VPNMON-R2 - Randomly selected VPN2 Client ON
Sat Aug 12 23:50:03 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:51:11 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:51:19 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:52:23 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:52:32 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:52:44 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sat Aug 12 23:52:48 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:53:05 EDT 2023 - VPNMON-R2 - API call made to update WAN0 city to Atlanta
Sat Aug 12 23:53:05 EDT 2023 - VPNMON-R2 - API call made to update WAN city to Wilmington
Sat Aug 12 23:53:08 EDT 2023 - VPNMON-R2 ----------> ERROR: VPN0 Connection failed - Executing VPN Reset
Sat Aug 12 23:53:08 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:53:20 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:53:32 EDT 2023 - VPNMON-R2 - Randomly selected VPN5 Client ON
Sat Aug 12 23:53:36 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:53:39 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sat Aug 12 23:54:39 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:54:43 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:55:48 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:55:57 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:56:09 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sat Aug 12 23:56:13 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:57:22 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:57:28 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:58:32 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:58:42 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:58:54 EDT 2023 - VPNMON-R2 - Randomly selected VPN2 Client ON
Sat Aug 12 23:58:58 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:00:03 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sun Aug 13 00:00:10 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sun Aug 13 00:01:14 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:01:24 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:01:36 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sun Aug 13 00:01:40 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:01:57 EDT 2023 - VPNMON-R2 - API call made to update WAN0 city to Atlanta
Sun Aug 13 00:01:57 EDT 2023 - VPNMON-R2 - API call made to update WAN city to Wilmington
Sun Aug 13 00:02:00 EDT 2023 - VPNMON-R2 ----------> ERROR: VPN0 Connection failed - Executing VPN Reset
Sun Aug 13 00:02:00 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:02:12 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:02:24 EDT 2023 - VPNMON-R2 - Randomly selected VPN4 Client ON
Sun Aug 13 00:02:28 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:02:30 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sun Aug 13 00:02:42 EDT 2023 - VPNMON-R2 - API call made to update WAN0 city to Atlanta
Sun Aug 13 00:02:43 EDT 2023 - VPNMON-R2 - API call made to update WAN city to Wilmington
Sun Aug 13 00:02:46 EDT 2023 - VPNMON-R2 ----------> ERROR: VPN4 Connection failed - Executing VPN Reset
Sun Aug 13 00:02:46 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:03:01 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:03:13 EDT 2023 - VPNMON-R2 - Randomly selected VPN4 Client ON
Sun Aug 13 00:03:18 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:03:24 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sun Aug 13 00:04:24 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sun Aug 13 00:04:32 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sun Aug 13 00:05:37 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:05:46 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:05:58 EDT 2023 - VPNMON-R2 - Randomly selected VPN5 Client ON
Sun Aug 13 00:06:02 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:07:11 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sun Aug 13 00:07:15 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sun Aug 13 00:08:20 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:08:29 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:08:41 EDT 2023 - VPNMON-R2 - Randomly selected VPN3 Client ON
Sun Aug 13 00:08:45 EDT 2023 - VPNMON-R2 - VPN Reset Finished
 
I took some segment of the log because it is very long. Basically for a few hours the same text repeated itself over and over again in the log. Hope this can help you with the development of the script!

BTW I have been using the Daul wan failover script as well.

Code:
Sat Aug 12 23:46:52 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:47:08 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:47:20 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sat Aug 12 23:47:24 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:47:27 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sat Aug 12 23:48:27 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:48:33 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:49:37 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:49:46 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:49:59 EDT 2023 - VPNMON-R2 - Randomly selected VPN2 Client ON
Sat Aug 12 23:50:03 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:51:11 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:51:19 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:52:23 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:52:32 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:52:44 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sat Aug 12 23:52:48 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:53:05 EDT 2023 - VPNMON-R2 - API call made to update WAN0 city to Atlanta
Sat Aug 12 23:53:05 EDT 2023 - VPNMON-R2 - API call made to update WAN city to Wilmington
Sat Aug 12 23:53:08 EDT 2023 - VPNMON-R2 ----------> ERROR: VPN0 Connection failed - Executing VPN Reset
Sat Aug 12 23:53:08 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:53:20 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:53:32 EDT 2023 - VPNMON-R2 - Randomly selected VPN5 Client ON
Sat Aug 12 23:53:36 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:53:39 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sat Aug 12 23:54:39 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:54:43 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:55:48 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:55:57 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:56:09 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sat Aug 12 23:56:13 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sat Aug 12 23:57:22 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sat Aug 12 23:57:28 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sat Aug 12 23:58:32 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sat Aug 12 23:58:42 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sat Aug 12 23:58:54 EDT 2023 - VPNMON-R2 - Randomly selected VPN2 Client ON
Sat Aug 12 23:58:58 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:00:03 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sun Aug 13 00:00:10 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sun Aug 13 00:01:14 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:01:24 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:01:36 EDT 2023 - VPNMON-R2 - Randomly selected VPN1 Client ON
Sun Aug 13 00:01:40 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:01:57 EDT 2023 - VPNMON-R2 - API call made to update WAN0 city to Atlanta
Sun Aug 13 00:01:57 EDT 2023 - VPNMON-R2 - API call made to update WAN city to Wilmington
Sun Aug 13 00:02:00 EDT 2023 - VPNMON-R2 ----------> ERROR: VPN0 Connection failed - Executing VPN Reset
Sun Aug 13 00:02:00 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:02:12 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:02:24 EDT 2023 - VPNMON-R2 - Randomly selected VPN4 Client ON
Sun Aug 13 00:02:28 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:02:30 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sun Aug 13 00:02:42 EDT 2023 - VPNMON-R2 - API call made to update WAN0 city to Atlanta
Sun Aug 13 00:02:43 EDT 2023 - VPNMON-R2 - API call made to update WAN city to Wilmington
Sun Aug 13 00:02:46 EDT 2023 - VPNMON-R2 ----------> ERROR: VPN4 Connection failed - Executing VPN Reset
Sun Aug 13 00:02:46 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:03:01 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:03:13 EDT 2023 - VPNMON-R2 - Randomly selected VPN4 Client ON
Sun Aug 13 00:03:18 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:03:24 EDT 2023 - VPNMON-R2 - Resuming normal operations
Sun Aug 13 00:04:24 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sun Aug 13 00:04:32 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sun Aug 13 00:05:37 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:05:46 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:05:58 EDT 2023 - VPNMON-R2 - Randomly selected VPN5 Client ON
Sun Aug 13 00:06:02 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Sun Aug 13 00:07:11 EDT 2023 - VPNMON-R2 ----------> ERROR: WAN CONNECTIVITY ISSUE DETECTED
Sun Aug 13 00:07:15 EDT 2023 - VPNMON-R2 - WAN Link Detected -- Trying to reconnect/Reset VPN
Sun Aug 13 00:08:20 EDT 2023 - VPNMON-R2 - Executing VPN Reset
Sun Aug 13 00:08:29 EDT 2023 - VPNMON-R2 - Killed all VPN Client Connections
Sun Aug 13 00:08:41 EDT 2023 - VPNMON-R2 - Randomly selected VPN3 Client ON
Sun Aug 13 00:08:45 EDT 2023 - VPNMON-R2 - VPN Reset Finished
Thank you... I truly believe this has something to do with your dual WAN setup... it would probably be helpful to determine what your WAN0 and WAN1 states were while it was looping like this - it could be that one or both were bouncing, and neither knew who the primary/secondary connections were any longer. If you can find a repeatable process that causes these kinds of failures, followed by stability, that would definitely be something to report on. Unfortunately I don't have a dual WAN setup, and graciously worked closely with @Stephen Harrington and through his amazing efforts were able to bring this functionality into vpnmon. You may want to compare notes with him, as he's been able to implement a fantastically stable dual WAN environment! :)
 
This script has worked flawlessly for the last two days for me! Just coming back to say how much I appreciate your excellent work.

Hope you can incorporate wireguard support in the future, as I have been capped at 80M by OPVPN.
 
This script has worked flawlessly for the last two days for me! Just coming back to say how much I appreciate your excellent work.

Hope you can incorporate wireguard support in the future, as I have been capped at 80M by OPVPN.
You're very welcome, @cohomology! Glad you're enjoying it. It runs nonstop on my end, and has for well over a year now, so it's pretty solid. ;) It certainly helps keep the family happy, connected and safe.

I've been able to get over 200Mbps using NordVPN, but keeping an open mind towards wireguard. Can't promise anything, but I will definitely take a look.
 
@Viktor Jaep is there a way to setup current script just to monitor (pings) all the current VPN slots and only initiates a VPN slot change when Active VPN slot gets disconnected (no considering any metrics / performance) ? It would be a sort of "monitoring disconnect", waiting only for when the active VPN disconnects and then change to lowest ping slots.
 
@Viktor Jaep is there a way to setup current script just to monitor (pings) all the current VPN slots and only initiates a VPN slot change when Active VPN slot gets disconnected (no considering any metrics / performance) ? It would be a sort of "monitoring disconnect", waiting only for when the active VPN disconnects and then change to lowest ping slots.
One of the reasons I use the ping method is to test if the connection is still up is because in certain instances your VPN connection will remain connected, but is completely non-functional, and not sending/receiving network traffic. So in your case, you're asking it to ping, but even if that fails, keep that connection going until something forcefully disconnects it, right?

I had to deal with this issue quite frequently before I wrote vpnmon-r2, and it drove me nuts... which is probably why I wrote vpnmon-r2. ;)

In other words, I built these tests in to determine the viability of your current VPN connection at least every 60 seconds, and if anything fails the smell-test, then kill and reset the connection to something that works. My goal is to provide continuous uptime, and minimize downtime.

EDIT: but I suppose you could try setting the # of pings to 9999 or something like that, and after 9999 ping failure attempts, it would reset your connection... might take a good 12hrs to work through that, hoping that your vpn connection will forcefully drop. But while it's doing this, vpnmon-r2 will appear like it's hung at the vpn slot having issues pinging.
 
Last edited:
One of the reasons I use the ping method is to test if the connection is still up is because in certain instances your VPN connection will remain connected, but is completely non-functional, and not sending/receiving network traffic. So in your case, you're asking it to ping, but even if that fails, keep that connection going until something forcefully disconnects it, right?
No, maybe I didn't make myself clear, I'll try to rephrase...

If the ping to the active VPN slot fails, connect to one of the available working slots (could be based on the ping performance). But never change the active slot under any other circumstances (even if the others work better, they have lower ping ms).
 

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