Hi Martineau, thank you for your reply. Scribe is next thing on my list. I'm taking baby steps since I'm (or I was) complete noob on scripts, CLI, and Linux commands in general. It took me few days to set all this up.
I have no intention to hyjack this thread so I hope OP won't mind sharing my experience with this issue.
I have mentioned two situations where my router's WAN cannot refresh WAN IP, and rare instances where WAN interface obviously "restart" itself and manages to refresh WAN IP.
Here are two recent examples:
AC86U - failed to request new WAN IP - if there was no ChkWAN script, internet would be down until I manually kill that WAN switch in Asus GUI:
Code:
May 7 01:43:02 (ChkWAN.sh): 11863 v1.17 Monitoring WAN connection using 2 target PING hosts (1.1.1.1 8.8.8.8) (Tries=2)
May 7 01:43:02 (ChkWAN.sh): 11863 cURL 500Byte transfer took: 00:00.22 secs @ 2262 B/sec
May 7 01:44:02 (ChkWAN.sh): 12150 v1.17 Monitoring WAN connection using 2 target PING hosts (1.1.1.1 8.8.8.8) (Tries=2)
May 7 01:44:02 (ChkWAN.sh): 12150 cURL 500Byte transfer took: 00:00.26 secs @ 1908 B/sec
May 7 01:44:12 kernel: eth0 (Int switch port: 3) (Logical Port: 3) Link DOWN.
May 7 01:44:15 kernel: eth0 (Int switch port: 3) (Logical Port: 3) Link UP 1000 mbps full duplex
May 7 01:45:02 (ChkWAN.sh): 12438 v1.17 Monitoring WAN connection using 2 target PING hosts (1.1.1.1 8.8.8.8) (Tries=2)
May 7 01:45:48 (ChkWAN.sh): 12438 ***ERROR cURL 'https://raw.githubusercontent.com/MartineauUK/Chk-WAN/master/Test500B.txt' transfer FAILED RC=6
May 7 01:45:48 (ChkWAN.sh): 12438 v1.17 Monitoring WAN connection cURL data retrieval check FAILED
May 7 01:46:34 (ChkWAN.sh): 12438 ***ERROR cURL 'https://raw.githubusercontent.com/MartineauUK/Chk-WAN/master/Test500B.txt' transfer FAILED RC=6
May 7 01:46:34 (ChkWAN.sh): 12438 v1.17 Monitoring WAN connection cURL data retrieval check FAILED
May 7 01:47:31 (ChkWAN.sh): 12438 ***ERROR cURL 'https://raw.githubusercontent.com/MartineauUK/Chk-WAN/master/Test500B.txt' transfer FAILED RC=6
May 7 01:47:31 (ChkWAN.sh): 12438 v1.17 Monitoring WAN connection cURL data retrieval check FAILED
May 7 01:48:17 (ChkWAN.sh): 12438 ***ERROR cURL 'https://raw.githubusercontent.com/MartineauUK/Chk-WAN/master/Test500B.txt' transfer FAILED RC=6
May 7 01:48:17 (ChkWAN.sh): 12438 v1.17 Monitoring WAN connection cURL data retrieval check FAILED
May 7 01:48:17 (ChkWAN.sh): 12438 Renewing DHCP and restarting WAN (Action=WANONLY)
May 7 01:48:27 rc_service: service 13128:notify_rc restart_wan
May 7 01:48:27 custom_script: Running /jffs/scripts/service-event (args: restart wan)
May 7 01:48:27 miniupnpd[9798]: shutting down MiniUPnPd
May 7 01:48:31 miniupnpd[13244]: HTTP listening on port 45974
May 7 01:48:31 miniupnpd[13244]: Listening for NAT-PMP/PCP traffic on port 5351
May 7 01:48:32 WAN_Connection: ISP's DHCP did not function properly.
May 7 01:48:32 DualWAN: skip single wan wan_led_control - WANRED off
May 7 01:48:32 custom_script: Running /jffs/scripts/firewall-start (args: eth0)
May 7 01:48:32 wan: finish adding multi routes
May 7 01:48:32 YazFi: Firewall restarted - sleeping 30s before running YazFi
May 7 01:48:34 miniupnpd[13244]: shutting down MiniUPnPd
May 7 01:48:34 miniupnpd[13368]: HTTP listening on port 51369
May 7 01:48:34 miniupnpd[13368]: Listening for NAT-PMP/PCP traffic on port 5351
May 7 01:48:37 WAN_Connection: WAN was restored.
AC86U - successfully requested WAN IP (you can ignore ChkWAN script, this is the case where script is not needed)
Code:
May 7 06:15:02 (ChkWAN.sh): 27609 v1.17 Monitoring WAN connection using 2 target PING hosts (1.1.1.1 8.8.8.8) (Tries=2)
May 7 06:15:02 (ChkWAN.sh): 27609 cURL 500Byte transfer took: 00:00.20 secs @ 2538 B/sec
May 7 06:15:06 kernel: eth0 (Int switch port: 3) (Logical Port: 3) Link DOWN.
May 7 06:15:07 WAN_Connection: ISP's DHCP did not function properly.
May 7 06:15:07 DualWAN: skip single wan wan_led_control - WANRED off
May 7 06:15:09 kernel: eth0 (Int switch port: 3) (Logical Port: 3) Link UP 1000 mbps full duplex
May 7 06:15:11 WAN_Connection: WAN(0) link up.
May 7 06:15:11 rc_service: wanduck 1028:notify_rc restart_wan_if 0
May 7 06:15:11 custom_script: Running /jffs/scripts/service-event (args: restart wan_if)
May 7 06:15:15 custom_script: Running /jffs/scripts/firewall-start (args: eth0)
May 7 06:15:15 YazFi: Firewall restarted - sleeping 30s before running YazFi
May 7 06:15:15 wan: finish adding multi routes
May 7 06:15:15 miniupnpd[13368]: shutting down MiniUPnPd
May 7 06:15:15 miniupnpd[28003]: HTTP listening on port 40707
May 7 06:15:15 miniupnpd[28003]: Listening for NAT-PMP/PCP traffic on port 5351
May 7 06:15:17 WAN_Connection: WAN was restored.
Meanwhile, modem's log:
Code:
2021-05-07 06:15:09 WAN connection INTERNET_VOICE_TR069_R_UMTS1:IPv4 connected
2021-05-07 06:15:05 WAN connection INTERNET_VOICE_TR069_R_UMTS1:IPv4 disconnected
2021-05-07 01:44:15 WAN connection INTERNET_VOICE_TR069_R_UMTS1:IPv4 connected
2021-05-07 01:44:11 WAN connection INTERNET_VOICE_TR069_R_UMTS1:IPv4 disconnected
My next goal is to try and optimize ChkWAN to react faster (setting it to tries=1 maybe) and to get downtime to 2-3 min max.
Fortunatelly, these several days I had zero false positive pings so I'm also considering using ping method only, one try, then restart WAN.