JohnSmith
Senior Member
Testing V1.5.5-Beta11 Dual WAN Script in a Dual WAN Failover mode:
1. I have smart electric plugs and other IOT devices connected to Guest Network 2 that I have my ISP #01 plugged into one of them
2. On my app on my IPhone, I shutoff the smart plug to simulate ISP #01 going down
3. When the failover happens, ISP #02 kicks in pretty quickly, and YazFi & OpenVPN Server have Cron Jobs running as well.
4. The problem is still on the Failover I don't have access to my IOT devices in a small timeframe (like on the Failback), as it appears YazFi and FlexQOS kick off much earlier than your script anticipates on the Failover to ISP#02, and never invoked again until their Cron Jobs kick in again.
5. Also your script in Failover mode will now fill the System General Log File with wan0 information only, never showing you that it flipped to wan1 and its info (and this is on Default Message Log Level of "notice" and Log only messages more urgent than "notice".
6. After waiting the 5 minutes for FlexQOS to initiate its check, and after 10 minutes for YazFi to initiate its check, to where IOT devices are accessible again, I use my app on my IPhone to talk to the smart plug and IOT devices, I turn the smart plug back on to simulate ISP #01 coming back up. This time the IOT devices reconnected right away with the logs showing the "WAN Switch" & "Service Restart" in logs below.
1. I have smart electric plugs and other IOT devices connected to Guest Network 2 that I have my ISP #01 plugged into one of them
2. On my app on my IPhone, I shutoff the smart plug to simulate ISP #01 going down
3. When the failover happens, ISP #02 kicks in pretty quickly, and YazFi & OpenVPN Server have Cron Jobs running as well.
Code:
ASUSWRT-Merlin RT-AX88U 386.7_0 Wed Jun 22 18:49:23 UTC 2022
admin@XXAX88U:/tmp/home/root# crontab -l
*/10 * * * * /jffs/scripts/YazFi check #YazFi#
*/1 * * * * /jffs/scripts/wan-failover.sh run #setup_wan_failover_run#
*/2 * * * * /etc/openvpn/server1/vpn-watchdog1.sh #CheckVPNServer1#
4. The problem is still on the Failover I don't have access to my IOT devices in a small timeframe (like on the Failback), as it appears YazFi and FlexQOS kick off much earlier than your script anticipates on the Failover to ISP#02, and never invoked again until their Cron Jobs kick in again.
Code:
Jul 12 02:22:00 kernel: eth0 (Int switch port: 3) (Logical Port: 3) (phyId: c) Link DOWN.
Jul 12 02:22:05 ovpn-server1[5683]: event_wait : Interrupted system call (code=4)
Jul 12 02:22:05 ovpn-server1[5683]: PLUGIN AUTH-PAM: Error signaling background process to exit: Connection refused (errno=111)
Jul 12 02:22:07 YazFi: Firewall restarted - sleeping 10s before running YazFi
Jul 12 02:22:07 FlexQoS: /jffs/addons/flexqos/flexqos.sh (pid=27305) called in unattended mode with 1 args: -start
Jul 12 02:22:07 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:07 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:22:07 FlexQoS: Applying iptables static rules
Jul 12 02:22:07 FlexQoS: Applying iptables custom rules
Jul 12 02:22:07 FlexQoS: Flushing conntrack table
Jul 12 02:22:08 FlexQoS: No TC modifications necessary
Jul 12 02:22:08 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:08 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:09 ovpn-server1[28734]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Jul 12 02:22:13 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:13 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:13 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:22:13 kernel: SHN Release Version: 2.0.2 36f59aa
Jul 12 02:22:13 kernel: UDB Core Version: 0.2.20
Jul 12 02:22:13 kernel: sizeof forward pkt param = 280
Jul 12 02:22:14 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:14 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:17 YazFi: YazFi v4.4.2 starting up
Jul 12 02:22:18 YazFi: wl0.1 (SSID: XXXXXXX) - sending all interface internet traffic over WAN interface
Jul 12 02:22:18 YazFi: Lock file found (age: 11 seconds) - stopping to prevent duplicate runs
Jul 12 02:22:18 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:18 FlexQoS: /jffs/addons/flexqos/flexqos.sh (pid=30535) called in unattended mode with 1 args: -start
Jul 12 02:22:18 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:22:18 ovpn-server1[28734]: event_wait : Interrupted system call (code=4)
Jul 12 02:22:18 ovpn-server1[28734]: PLUGIN AUTH-PAM: Error signaling background process to exit: Connection refused (errno=111)
Jul 12 02:22:19 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:20 FlexQoS: Applying iptables static rules
Jul 12 02:22:20 FlexQoS: Applying iptables custom rules
Jul 12 02:22:20 FlexQoS: Flushing conntrack table
Jul 12 02:22:20 FlexQoS: TC Modification Delayed Start
Jul 12 02:22:21 YazFi: wl0.2 (SSID: XXXXX) - sending all interface internet traffic over WAN interface
Jul 12 02:22:24 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:24 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:24 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:22:25 YazFi: Forcing YazFi Guest WiFi clients to reauthenticate
Jul 12 02:22:25 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:25 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:29 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:29 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:29 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:22:30 FlexQoS: TC Modification delayed for 10 seconds
Jul 12 02:22:30 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:30 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:31 FlexQoS: Applying AppDB rules and TC rates
Jul 12 02:22:35 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:35 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:35 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:22:36 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:36 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:40 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:40 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:40 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:22:40 YazFi: YazFi v4.4.2 completed successfully
Jul 12 02:22:41 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:22:41 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:22:46 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
5. Also your script in Failover mode will now fill the System General Log File with wan0 information only, never showing you that it flipped to wan1 and its info (and this is on Default Message Log Level of "notice" and Log only messages more urgent than "notice".
6. After waiting the 5 minutes for FlexQOS to initiate its check, and after 10 minutes for YazFi to initiate its check, to where IOT devices are accessible again, I use my app on my IPhone to talk to the smart plug and IOT devices, I turn the smart plug back on to simulate ISP #01 coming back up. This time the IOT devices reconnected right away with the logs showing the "WAN Switch" & "Service Restart" in logs below.
Code:
Jul 12 02:31:31 kernel: eth0 (Int switch port: 3) (Logical Port: 3) (phyId: c) Link UP at 1000 mbps full duplex
Jul 12 02:31:34
Jul 12 02:31:34 wan-failover.sh: WAN Status - Restarting wan0
Jul 12 02:31:35 wan-failover.sh: WAN Status - wan0: Disconnected
Jul 12 02:31:35 wan-failover.sh: WAN Status - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:31:40 wan-failover.sh: WAN Switch - wan0 is disconnected. IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jul 12 02:31:40 <REPEATS>
Jul 12 02:32:18 YazFi: Firewall restarted - sleeping 10s before running YazFi
Jul 12 02:32:18 FlexQoS: /jffs/addons/flexqos/flexqos.sh (pid=11117) called in unattended mode with 1 args: -start
Jul 12 02:32:18 ovpn-server1[11291]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Jul 12 02:32:18 FlexQoS: iptables rules already present
Jul 12 02:32:19 wan-failover.sh: WAN Status - Restarted wan0
Jul 12 02:32:19 FlexQoS: No TC modifications necessary
Jul 12 02:32:19 wan-failover.sh: WAN Switch - Switching wan0 to Primary WAN
Jul 12 02:32:19 wan-failover.sh: WAN Switch - DNS1 Server: X.X.X.X
Jul 12 02:32:19 wan-failover.sh: WAN Switch - DNS2 Server: X.X.X.X
Jul 12 02:32:19 wan-failover.sh: WAN Switch - Deleting default route via X.X.X.X dev eth4
Jul 12 02:32:19 wan-failover.sh: WAN Switch - Adding default route via X.X.X.X dev eth0
Jul 12 02:32:19 wan-failover.sh: WAN Switch - Applying Manual QoS Bandwidth Settings
Jul 12 02:32:20 wan-failover.sh: WAN Switch - Switched wan0 to Primary WAN
Jul 12 02:32:20 wan-failover.sh: Service Restart - Restarting dnsmasq service
Jul 12 02:32:20 wan-failover.sh: Service Restart - Restarted dnsmasq service
Jul 12 02:32:20 wan-failover.sh: Service Restart - Restarting firewall service
Jul 12 02:32:21 wan-failover.sh: Service Restart - Restarted firewall service
Jul 12 02:32:21 wan-failover.sh: Service Restart - Restarting leds service
Jul 12 02:32:22 YazFi: Lock file found (age: 4 seconds) - stopping to prevent duplicate runs
Jul 12 02:32:22 FlexQoS: /jffs/addons/flexqos/flexqos.sh (pid=12335) called in unattended mode with 1 args: -start
Jul 12 02:32:22 FlexQoS: Applying iptables static rules
Jul 12 02:32:22 FlexQoS: Applying iptables custom rules
Jul 12 02:32:22 wan-failover.sh: Service Restart - Restarted leds service
Jul 12 02:32:22 wan-failover.sh: Service Restart - Restarting qos service
Jul 12 02:32:22 FlexQoS: Flushing conntrack table
Jul 12 02:32:23 FlexQoS: No TC modifications necessary
Jul 12 02:32:23 wan-failover.sh: Service Restart - Restarted qos service
Jul 12 02:32:23 wan-failover.sh: Service Restart - Triggering YazFi to update
Jul 12 02:32:23 YazFi: Lock file found (age: 5 seconds) - stopping to prevent duplicate runs
Jul 12 02:32:24 wan-failover.sh: Email Notification - Email Notification Failed
Jul 12 02:32:24 kernel: Cpuidle Host Clock divider is enabled
Jul 12 02:32:28 YazFi: YazFi v4.4.2 starting up
Jul 12 02:32:30 YazFi: wl0.1 (SSID: XXXXXXX) - sending all interface internet traffic over WAN interface
Jul 12 02:32:31 YazFi: wl0.2 (SSID: XXXXX) - sending all interface internet traffic over WAN interface
Jul 12 02:32:33 wan-failover.sh: WAN0 Failover Monitor - Monitoring wan0 via 1.1.1.1 for Failure
Jul 12 02:32:35 YazFi: Forcing YazFi Guest WiFi clients to reauthenticate
Jul 12 02:32:51 YazFi: YazFi v4.4.2 completed successfully