What's new

RT-AC66U - 3G/4G backup mode issue

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

xander73

Occasional Visitor
Hi,

Just got a new RT-AC66U...

I'm having issues with the 3G/4G backup mode... The RT-AC66U is running as a wireless router with a PPPoE WAN connection.
Whilst testing the 3G/4G backup mode - the internet connection successfully fails over to using the USB modem (IW-021, set as auto USB adapter) when the WAN cable is disconnected. However upon the reconnecting the WAN cable - the router does not return to using the WAN link and remains using the 3G USB modem, until either the USB modem is unplugged or the router is rebooted...

I have tried the following firmware versions - but all show the same issue above...
FW_RT_AC66U_3004270 (Asus)
FW_RT_AC66U_3004354 beta (Asus) - 3G/4G backup mode doesn't work anyway
RT-AC66U_3.0.0.4_270.24 (Merlin)
RT-AC66U_3.0.0.4_270.26b (Merlin)

Any ideas on how to get the router to fail back to using the WAN connection when connectivity is restored, rather than staying on the 3G/4G connection?
 
Last edited:
Hi,

Just got a new RT-AC66U...

I'm having issues with the 3G/4G backup mode... The RT-AC66U is running as a wireless router with a PPPoE WAN connection.
Whilst testing the 3G/4G backup mode - the internet connection successfully fails over to using the USB modem (IW-021, set as auto USB adapter) when the WAN cable is disconnected. However upon the reconnecting the WAN cable - the router does not return to using the WAN link and remains using the 3G USB modem, until either the USB modem is unplugged or the router is rebooted...

I have tried the following firmware versions - but all show the same issue above...
FW_RT_AC66U_3004270 (Asus)
FW_RT_AC66U_3004354 beta (Asus) - 3G/4G backup mode doesn't work anyway
RT-AC66U_3.0.0.4_270.24 (Merlin)
RT-AC66U_3.0.0.4_270.26b (Merlin)

Any ideas on how to get the router to fail back to using the WAN connection when connectivity is restored, rather than staying on the 3G/4G connection?

Recovery is a long-standing bug with both 3G fallback or the experimental DualWAN feature. I'm not sure if Asus are aware of this issue or not, I would recommend contacting them to ensure they do (either through their support Email, or through CL-Jeremy here on the forums - he's an Asus employee).
 
Wow - that was a quick reply... Thanks Merlin...

Shame there's a glitch with the 3G failover recovery... Hopefully Asus are working on it, will email later...
 
Just tested the latest Asus firmware (FW_RT_RT-AC66U_3004372.trx)...

The Change Log includes...
Fixed.
6. Fixed 3G dongle related issue.

Alas - 3G failover recovery still doesn't work - i.e. Once DSL connectivity is restored, the USB 3G doesn't revert back to DSL... :(
 
Just tested the latest Asus firmware (FW_RT_RT-AC66U_3004372.trx)...

The Change Log includes...
Fixed.
6. Fixed 3G dongle related issue.

Alas - 3G failover recovery still doesn't work - i.e. Once DSL connectivity is restored, the USB 3G doesn't revert back to DSL... :(

Using Merlin's firmware, I use the wan-start event to send an email when either the 3G modem becomes the Primary WAN and also when the DSL connection (eventually) becomes available and ready for service. If the wan-start event indicates that the DSL should now return to being the Primary WAN, I simply schedule a one-off router reboot for 03:00.

Not ideal (and certainly isn't fool-proof) but it works for me until Asus fix this frustrating 3G Dual WAN failover issue.
 
Using Merlin's firmware, I use the wan-start event to send an email when either the 3G modem becomes the Primary WAN and also when the DSL connection (eventually) becomes available and ready for service. If the wan-start event indicates that the DSL should now return to being the Primary WAN, I simply schedule a one-off router reboot for 03:00.

Not ideal (and certainly isn't fool-proof) but it works for me until Asus fix this frustrating 3G Dual WAN failover issue.

Hi, Could you please guide on how you set this up, i very much need to do the same to save on costly 3G data charges
 
Hi, Could you please guide on how you set this up, i very much need to do the same to save on costly 3G data charges

The wan-start script I have is pretty crude but for my purposes it seems to work.

Clearly the wan-script is called twice at router boot time hence the attempt to ensure only one instance of the script is running.

Here is how I test:

1. Check current WAN I/P with say http://www.whatismyip.com/
2. Remove LAN cable from router to Modem
3. Asus code should perform the 3G failover - takes about 90secs
4. Check current WAN I/P with say http://www.whatismyip.com/ etc.
5. Reattach LAN cable from router to modem

The wan-script should then switch the DSL as primary WAN - takes 2 mins.

I have left the scheduled reboot in the code simply as a safeguard, but currently no reboot appears to be necessary to effect the 'immediate' return to DSL as the Primary WAN.


I'm sure my code could be neater and perhaps I should also check if NVRAM variable wan1_primary=1 just be be sure that the 3G modem is indeed the Primary WAN before attempting to switch back to DSL as the Primary WAN?

Anyway your mileage may vary but hopefully Asus can fix this internally but without RMerlin's exposure of the wan-start script none of this would be possible.

Code:
#!/bin/sh

logger -t "($(basename $0))" $$ Martineau customisation starting.... " $0${*:+ $*}."

# With DUAL-WAN, this event gets triggered for both DSL and 3G

# If Semaphore Lock file exists then exit
if [ -e /tmp/mnt/RT-N66U/wan-start-locked ]; then
   logger -t "($(basename $0))" $$ wan-start already LOCKED since `cat /tmp/mnt/RT-N66U/wan-start-locked` .....EXIT
   exit
fi

# Create the locking semaphore file
echo `date` > /tmp/mnt/RT-N66U/wan-start-locked
logger -t "($(basename $0))" $$ wan-start LOCKED `cat /tmp/mnt/RT-N66U/wan-start-locked`

# Assume that at Router reboot, the Primary WAN will be the DSL modem
#        however, we need to switch back to the DSL WAN if we are currently on 3G 

# This should indicate if ADSL or 3G MODEM is ACTIVE
ADSL_ACTIVE=$(nvram get wan0_primary)
FAILOVERIP=$(nvram get wan1_ipaddr)

# Until RMerlin adds the WAN interface that triggered this WAN-START we'll have to guess stuff....
# If we don't have a DSL connection and we have a valid 3G modem IP address then fallback to DSL connection..
if [ "$ADSL_ACTIVE" = "0" ] && [ ! "$FAILOVERIP" = "" ]; then
   logger -t "($(basename $0))" $$ Checking if this is the 3G Failover starting event.......


  # Doesn't matter how long we wait (as hopefully 3G modem is currently the Primary WAN)
  #         but need to be positive to see if PPP0 reappears

   sleep 120 


   # DSL modem PPP0 disappears for 3G failover but if it is still here then use it!
   if [ ! "`ifconfig | grep ppp0`" = "" ]; then

      logger -t "($(basename $0))" $$ 3G Modem connection ifconfig ppp1 DOWN requested......
      echo "Requesting ppp1 DOWN" >> /tmp/mnt/RT-N66U/ifconfig.log
      `ifconfig ppp1 down >> /tmp/mnt/RT-N66U/ifconfig.log` 
 
      # ..just in case the DSL WAN doesn't actually connect? i.e. we have shot our ACTIVE 3G connection in the foot?

      sleep 60

      logger -t "($(basename $0))" $$ 3G Modem connection ifconfig ppp1 UP requested...... 
      echo "Requesting ppp1 UP" >> /tmp/mnt/RT-N66U/ifconfig.log
      `ifconfig ppp1 up >> /tmp/mnt/RT-N66U/ifconfig.log` 

   else

      logger -t "($(basename $0))" $$ This is the 3G Failover starting event.......EXIT

      logger -t "($(basename $0))" $$ Scheduled 06:00 Reboot to restore ADSL connection.....
      /usr/sbin/cru a Reboot_0600 "0 6 * * * reboot"

   fi


   # Delete the locking semaphore file
   logger -t "($(basename $0))" $$ wan-start UNLOCKED  `cat /tmp/mnt/RT-N66U/wan-start-locked` 

   rm /tmp/mnt/RT-N66U/wan-start-locked

   exit

fi

logger -t "($(basename $0))" $$ NTP client setting time UK.POOL.NTP.ORG 

ntpclient -h uk.pool.ntp.org

wait

sleep 30

# Access to the TP-LINK TD-8816 ADSL modem (whilst in bridge mode)can be extremely useful to check statistics/line noise/errors etc.
# NOTE: nat-start script is also required!!!

# TP-LINK TD-8816 default I/P address is 192.168.1.1 so we need to define 192.168.1.2


logger -t "($(basename $0))" $$ Adding ifconfig for Martineau TP-LINK TD-8816 ADSL modem : 192.168.1.1
ifconfig `nvram get wan0_ifname`:0 192.168.1.2 netmask 255.255.255.0

wait

# Delete the locking semaphore file
logger -t "($(basename $0))" $$ wan-start UNLOCKED  `cat /tmp/mnt/RT-N66U/wan-start-locked` 

rm /tmp/mnt/RT-N66U/wan-start-locked

logger -t "($(basename $0))" $$ Martineau customisation complete....

#sleep 30

/jffs/scripts/Unblock-US.sh

wait

/jffs/scripts/Notify_WAN_IP.sh
 
Sorry to bump but yeah my 3g does not go back to wan on n66u 3.0.0.4.270.26

Not upgrading until I get Merlin on my ac68u sitting idle hopefully it works then. No rush tho. Wan is pretty stable lately.
 
you need to enable jffs partition reboot
then create the script
more info here
https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

Had that enabled already, I created the wan-start script but it is no switching back:

Oct 23 23:46:10 (wan-start): 602 3G Modem connection ifconfig ppp1 DOWN requested......
Oct 23 23:46:12 (wan-start): 706 3G Modem connection ifconfig ppp1 DOWN requested......
Oct 23 23:46:21 (wan-start): 809 Martineau customisation starting.... /jffs/scripts/wan-start 0.
Oct 23 23:46:21 dhcp client: bound 109.255.211.126 via 109.255.210.1 during 157491 seconds.
Oct 23 23:46:21 dnsmasq[718]: read /etc/hosts - 5 addresses
Oct 23 23:46:21 dnsmasq[718]: using nameserver 10.1.13.66#53
Oct 23 23:46:21 dnsmasq[718]: using nameserver 10.1.13.65#53
Oct 23 23:46:21 dnsmasq[718]: using nameserver 89.101.160.5#53
Oct 23 23:46:21 dnsmasq[718]: using nameserver 89.101.160.4#53
Oct 23 23:46:21 (wan-start): 809 wan-start LOCKED
Oct 23 23:46:21 (wan-start): 809 Checking if this is the 3G Failover starting event.......
Oct 23 23:47:10 (wan-start): 602 3G Modem connection ifconfig ppp1 UP requested......
Oct 23 23:47:10 (wan-start): 602 wan-start UNLOCKED
Oct 23 23:47:12 (wan-start): 706 3G Modem connection ifconfig ppp1 UP requested......
Oct 23 23:47:12 (wan-start): 706 wan-start UNLOCKED
Oct 23 23:48:21 (wan-start): 809 3G Modem connection ifconfig ppp1 DOWN requested......
Oct 23 23:49:21 (wan-start): 809 3G Modem connection ifconfig ppp1 UP requested......
Oct 23 23:49:21 (wan-start): 809 wan-start UNLOCKED
Oct 23 23:52:10 dnsmasq-dhcp[718]: DHCPREQUEST(br0) 192.168.1.29 98:fe:94:34:da:30

I waited almost 7 minutes 3G IP still shows up and network map still shows 3G as primary


109.255.211.126 is the Cable broadband address but whatsmyp still shows the 3G as mentioned......and that is correct beacause the speed test is 3MB but it should be 50

my Router is the RTN66U is that a problem?
 
Last edited:
Had that enabled already, I created the wan-start script but it is no switching back:

Oct 23 23:46:10 (wan-start): 602 3G Modem connection ifconfig ppp1 DOWN requested......
Oct 23 23:46:12 (wan-start): 706 3G Modem connection ifconfig ppp1 DOWN requested......
Oct 23 23:46:21 (wan-start): 809 Martineau customisation starting.... /jffs/scripts/wan-start 0.
Oct 23 23:46:21 dhcp client: bound 109.255.211.126 via 109.255.210.1 during 157491 seconds.
Oct 23 23:46:21 dnsmasq[718]: read /etc/hosts - 5 addresses
Oct 23 23:46:21 dnsmasq[718]: using nameserver 10.1.13.66#53
Oct 23 23:46:21 dnsmasq[718]: using nameserver 10.1.13.65#53
Oct 23 23:46:21 dnsmasq[718]: using nameserver 89.101.160.5#53
Oct 23 23:46:21 dnsmasq[718]: using nameserver 89.101.160.4#53
Oct 23 23:46:21 (wan-start): 809 wan-start LOCKED
Oct 23 23:46:21 (wan-start): 809 Checking if this is the 3G Failover starting event.......
Oct 23 23:47:10 (wan-start): 602 3G Modem connection ifconfig ppp1 UP requested......
Oct 23 23:47:10 (wan-start): 602 wan-start UNLOCKED
Oct 23 23:47:12 (wan-start): 706 3G Modem connection ifconfig ppp1 UP requested......
Oct 23 23:47:12 (wan-start): 706 wan-start UNLOCKED
Oct 23 23:48:21 (wan-start): 809 3G Modem connection ifconfig ppp1 DOWN requested......
Oct 23 23:49:21 (wan-start): 809 3G Modem connection ifconfig ppp1 UP requested......
Oct 23 23:49:21 (wan-start): 809 wan-start UNLOCKED
Oct 23 23:52:10 dnsmasq-dhcp[718]: DHCPREQUEST(br0) 192.168.1.29 98:fe:94:34:da:30

I waited almost 7 minutes 3G IP still shows up and network map still shows 3G as primary


109.255.211.126 is the Cable broadband address but whatsmyp still shows the 3G as mentioned......and that is correct beacause the speed test is 3MB but it should be 50

my Router is the RTN66U is that a problem?


Apologies, my original script assumes that there is a USB flash drive mounted on

Code:
/tmp/mnt/RT-N66U/

which is where it creates the locking semaphore file etc.

You will need to replace this with

Code:
/tmp/

If the change is successful, each of the UNLOCK statements in the log should show a valid timestamp.

NOTE: This was developed under 270.26b and ASUS may have changed the timing under 374.33

Post the log once you have amended the script.

Regards,
 
hi still not joy

Code:
Oct 24 20:41:45 WAN Connection: Ethernet link down.
Oct 24 20:41:45 stop_nat_rules: apply the redirect_rules!
Oct 24 20:41:45 dnsmasq[428]: exiting on receipt of SIGTERM
Oct 24 20:41:46 dnsmasq[569]: started, version 2.65 cachesize 1500
Oct 24 20:41:46 dnsmasq[569]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 24 20:41:46 dnsmasq[569]: asynchronous logging enabled, queue limit is 5 messages
Oct 24 20:41:46 dnsmasq-dhcp[569]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 24 20:41:46 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:41:46 dnsmasq[569]: using nameserver 89.101.160.5#53
Oct 24 20:41:46 dnsmasq[569]: using nameserver 89.101.160.4#53
Oct 24 20:41:46 rc_service: wanduck 295:notify_rc restart_wan_if 1
Oct 24 20:41:46 stop_wan(): perform DHCP release
Oct 24 20:41:48 pppd[571]: pppd 2.4.5 started by admin, uid 0
Oct 24 20:41:52 pppd[571]: Serial connection established.
Oct 24 20:41:52 pppd[571]: Using interface ppp0
Oct 24 20:41:52 pppd[571]: Connect: ppp0 <--> /dev/ttyUSB0
Oct 24 20:41:54 pppd[571]: Could not determine remote IP address: defaulting to 10.64.64.64
Oct 24 20:41:54 pppd[571]: not replacing existing default route via 109.255.210.1
Oct 24 20:41:54 pppd[571]: local  IP address 10.4.82.162
Oct 24 20:41:54 pppd[571]: remote IP address 10.64.64.64
Oct 24 20:41:54 pppd[571]: primary   DNS address 10.1.13.65
Oct 24 20:41:54 pppd[571]: secondary DNS address 10.1.13.66
Oct 24 20:41:54 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:41:54 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:41:54 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:41:54 dnsmasq[569]: using nameserver 89.101.160.5#53
Oct 24 20:41:54 dnsmasq[569]: using nameserver 89.101.160.4#53
Oct 24 20:41:54 (wan-start): 619 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 24 20:41:54 (wan-start): 619 wan-start LOCKED Thu Oct 24 20:41:54 DST 2013
Oct 24 20:41:54 (wan-start): 619 NTP client setting time UK.POOL.NTP.ORG
Oct 24 20:42:02 rc_service: wanduck 295:notify_rc restart_wan_if 0
Oct 24 20:42:02 stop_wan(): perform DHCP release
Oct 24 20:42:02 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 89.101.160.5#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 89.101.160.4#53
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering disabled state
Oct 24 20:42:02 kernel: vlan1: dev_set_promiscuity(master, 1)
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering listening state
Oct 24 20:42:02 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering learning state
Oct 24 20:42:02 kernel: br0: topology change detected, propagating
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering forwarding state
Oct 24 20:42:04 rc_service: wanduck 295:notify_rc restart_wan_line 1
Oct 24 20:42:04 start_nat_rules: apply the nat_rules(/tmp/nat_rules_ppp0__dev_ttyUSB0)!
Oct 24 20:42:04 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:42:04 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:42:04 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:42:04 (wan-start): 651 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 24 20:42:04 (wan-start): 651 wan-start already LOCKED since Thu Oct 24 20:41:54 DST 2013 .....EXIT
Oct 24 20:42:04 dnsmasq[569]: exiting on receipt of SIGTERM
Oct 24 20:42:04 dnsmasq[661]: started, version 2.65 cachesize 1500
Oct 24 20:42:04 dnsmasq[661]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 24 20:42:04 dnsmasq[661]: asynchronous logging enabled, queue limit is 5 messages
Oct 24 20:42:04 dnsmasq-dhcp[661]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 24 20:42:04 dnsmasq[661]: read /etc/hosts - 5 addresses
Oct 24 20:42:04 dnsmasq[661]: using nameserver 10.1.13.66#53
Oct 24 20:42:04 dnsmasq[661]: using nameserver 10.1.13.65#53
Oct 24 20:42:04 pptpd[662]: MGR: Config file not found!
Oct 24 20:42:04 pptpd[662]: MGR: Maximum of 100 connections reduced to 10, not enough IP addresses given
Oct 24 20:42:04 pptpd[662]: accel-pptpd-0.8.5 compiled for pppd-2.4.5, linux-2.6.22.19
Oct 24 20:42:04 pptpd[664]: MGR: Manager process started
Oct 24 20:42:04 pptpd[664]: MGR: Maximum of 10 connections available
Oct 24 20:42:04 ddns: clear ddns cache file for server/hostname change
Oct 24 20:42:04 ddns update: ez-ipupdate: starting...
Oct 24 20:42:04 miniupnpd[683]: HTTP listening on port 35050
Oct 24 20:42:04 miniupnpd[683]: Listening for NAT-PMP traffic on port 5351
Oct 24 20:42:06 ddns update: connected to ns1.asuscomm.com (103.10.4.108) on port 80.
Oct 24 20:42:09 ddns update: Asus update entry:: return: HTTP/1.1 299 |Invalid IP format| 10.4.82.162^M Date: Thu, 24 Oct 2013 19:38:39 GMT^M Server: Apache/2.4.3 (Unix) PHP/5.4.14^M X-Powered-By: PHP/5.4.14^M Content-Length: 0^M Content-Type: text/html^M ^M
Oct 24 20:42:09 ddns update: retval= 1, ddns_return_code (,299)
Oct 24 20:42:09 ddns update: asusddns_update: 1
Oct 24 20:42:10 WAN Connection: WAN was restored.
Oct 24 20:42:39 (wan-start): 619 Adding ifconfig for Martineau TP-LINK TD-8816 ADSL modem : 192.168.1.1
Oct 24 20:42:39 (wan-start): 619 wan-start UNLOCKED Thu Oct 24 20:41:54 DST 2013
Oct 24 20:42:39 (wan-start): 619 Martineau customisation complete...
Oct 24 20:46:23 dnsmasq[661]: read /etc/hosts - 5 addresses
Oct 24 20:46:23 dnsmasq[661]: using nameserver 10.1.13.66#53
Oct 24 20:46:23 dnsmasq[661]: using nameserver 10.1.13.65#53
Oct 24 20:46:23 dnsmasq[661]: using nameserver 89.101.160.5#53
Oct 24 20:46:23 dnsmasq[661]: using nameserver 89.101.160.4#53
Oct 24 20:46:23 (wan-start): 740 Martineau customisation starting....  /jffs/scripts/wan-start 0.
Oct 24 20:46:23 dhcp client: bound 109.255.211.126 via 109.255.210.1 during 251494 seconds.
Oct 24 20:46:23 (wan-start): 740 wan-start LOCKED Thu Oct 24 20:46:23 DST 2013
Oct 24 20:46:23 (wan-start): 740 Checking if this is the 3G Failover starting event.......
Oct 24 20:48:23 (wan-start): 740 3G Modem connection ifconfig ppp1 DOWN requested..
Oct 24 20:49:23 (wan-start): 740 3G Modem connection ifconfig ppp1 UP requested..
Oct 24 20:49:23 (wan-start): 740 wan-start UNLOCKED Thu Oct 24 20:46:23 DST 2013
 
hi still not joy

Code:
Oct 24 20:41:45 WAN Connection: Ethernet link down.
Oct 24 20:41:45 stop_nat_rules: apply the redirect_rules!
Oct 24 20:41:45 dnsmasq[428]: exiting on receipt of SIGTERM
Oct 24 20:41:46 dnsmasq[569]: started, version 2.65 cachesize 1500
Oct 24 20:41:46 dnsmasq[569]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 24 20:41:46 dnsmasq[569]: asynchronous logging enabled, queue limit is 5 messages
Oct 24 20:41:46 dnsmasq-dhcp[569]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 24 20:41:46 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:41:46 dnsmasq[569]: using nameserver 89.101.160.5#53
Oct 24 20:41:46 dnsmasq[569]: using nameserver 89.101.160.4#53
Oct 24 20:41:46 rc_service: wanduck 295:notify_rc restart_wan_if 1
Oct 24 20:41:46 stop_wan(): perform DHCP release
Oct 24 20:41:48 pppd[571]: pppd 2.4.5 started by admin, uid 0
Oct 24 20:41:52 pppd[571]: Serial connection established.
Oct 24 20:41:52 pppd[571]: Using interface ppp0
Oct 24 20:41:52 pppd[571]: Connect: ppp0 <--> /dev/ttyUSB0
Oct 24 20:41:54 pppd[571]: Could not determine remote IP address: defaulting to 10.64.64.64
Oct 24 20:41:54 pppd[571]: not replacing existing default route via 109.255.210.1
Oct 24 20:41:54 pppd[571]: local  IP address 10.4.82.162
Oct 24 20:41:54 pppd[571]: remote IP address 10.64.64.64
Oct 24 20:41:54 pppd[571]: primary   DNS address 10.1.13.65
Oct 24 20:41:54 pppd[571]: secondary DNS address 10.1.13.66
Oct 24 20:41:54 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:41:54 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:41:54 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:41:54 dnsmasq[569]: using nameserver 89.101.160.5#53
Oct 24 20:41:54 dnsmasq[569]: using nameserver 89.101.160.4#53
Oct 24 20:41:54 (wan-start): 619 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 24 20:41:54 (wan-start): 619 wan-start LOCKED Thu Oct 24 20:41:54 DST 2013
Oct 24 20:41:54 (wan-start): 619 NTP client setting time UK.POOL.NTP.ORG
Oct 24 20:42:02 rc_service: wanduck 295:notify_rc restart_wan_if 0
Oct 24 20:42:02 stop_wan(): perform DHCP release
Oct 24 20:42:02 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 89.101.160.5#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 89.101.160.4#53
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering disabled state
Oct 24 20:42:02 kernel: vlan1: dev_set_promiscuity(master, 1)
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering listening state
Oct 24 20:42:02 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:42:02 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering learning state
Oct 24 20:42:02 kernel: br0: topology change detected, propagating
Oct 24 20:42:02 kernel: br0: port 1(vlan1) entering forwarding state
Oct 24 20:42:04 rc_service: wanduck 295:notify_rc restart_wan_line 1
Oct 24 20:42:04 start_nat_rules: apply the nat_rules(/tmp/nat_rules_ppp0__dev_ttyUSB0)!
Oct 24 20:42:04 dnsmasq[569]: read /etc/hosts - 5 addresses
Oct 24 20:42:04 dnsmasq[569]: using nameserver 10.1.13.66#53
Oct 24 20:42:04 dnsmasq[569]: using nameserver 10.1.13.65#53
Oct 24 20:42:04 (wan-start): 651 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 24 20:42:04 (wan-start): 651 wan-start already LOCKED since Thu Oct 24 20:41:54 DST 2013 .....EXIT
Oct 24 20:42:04 dnsmasq[569]: exiting on receipt of SIGTERM
Oct 24 20:42:04 dnsmasq[661]: started, version 2.65 cachesize 1500
Oct 24 20:42:04 dnsmasq[661]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 24 20:42:04 dnsmasq[661]: asynchronous logging enabled, queue limit is 5 messages
Oct 24 20:42:04 dnsmasq-dhcp[661]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 24 20:42:04 dnsmasq[661]: read /etc/hosts - 5 addresses
Oct 24 20:42:04 dnsmasq[661]: using nameserver 10.1.13.66#53
Oct 24 20:42:04 dnsmasq[661]: using nameserver 10.1.13.65#53
Oct 24 20:42:04 pptpd[662]: MGR: Config file not found!
Oct 24 20:42:04 pptpd[662]: MGR: Maximum of 100 connections reduced to 10, not enough IP addresses given
Oct 24 20:42:04 pptpd[662]: accel-pptpd-0.8.5 compiled for pppd-2.4.5, linux-2.6.22.19
Oct 24 20:42:04 pptpd[664]: MGR: Manager process started
Oct 24 20:42:04 pptpd[664]: MGR: Maximum of 10 connections available
Oct 24 20:42:04 ddns: clear ddns cache file for server/hostname change
Oct 24 20:42:04 ddns update: ez-ipupdate: starting...
Oct 24 20:42:04 miniupnpd[683]: HTTP listening on port 35050
Oct 24 20:42:04 miniupnpd[683]: Listening for NAT-PMP traffic on port 5351
Oct 24 20:42:06 ddns update: connected to ns1.asuscomm.com (103.10.4.108) on port 80.
Oct 24 20:42:09 ddns update: Asus update entry:: return: HTTP/1.1 299 |Invalid IP format| 10.4.82.162^M Date: Thu, 24 Oct 2013 19:38:39 GMT^M Server: Apache/2.4.3 (Unix) PHP/5.4.14^M X-Powered-By: PHP/5.4.14^M Content-Length: 0^M Content-Type: text/html^M ^M
Oct 24 20:42:09 ddns update: retval= 1, ddns_return_code (,299)
Oct 24 20:42:09 ddns update: asusddns_update: 1
Oct 24 20:42:10 WAN Connection: WAN was restored.
Oct 24 20:42:39 (wan-start): 619 Adding ifconfig for Martineau TP-LINK TD-8816 ADSL modem : 192.168.1.1
Oct 24 20:42:39 (wan-start): 619 wan-start UNLOCKED Thu Oct 24 20:41:54 DST 2013
Oct 24 20:42:39 (wan-start): 619 Martineau customisation complete...
Oct 24 20:46:23 dnsmasq[661]: read /etc/hosts - 5 addresses
Oct 24 20:46:23 dnsmasq[661]: using nameserver 10.1.13.66#53
Oct 24 20:46:23 dnsmasq[661]: using nameserver 10.1.13.65#53
Oct 24 20:46:23 dnsmasq[661]: using nameserver 89.101.160.5#53
Oct 24 20:46:23 dnsmasq[661]: using nameserver 89.101.160.4#53
Oct 24 20:46:23 (wan-start): 740 Martineau customisation starting....  /jffs/scripts/wan-start 0.
Oct 24 20:46:23 dhcp client: bound 109.255.211.126 via 109.255.210.1 during 251494 seconds.
Oct 24 20:46:23 (wan-start): 740 wan-start LOCKED Thu Oct 24 20:46:23 DST 2013
Oct 24 20:46:23 (wan-start): 740 Checking if this is the 3G Failover starting event.......
Oct 24 20:48:23 (wan-start): 740 3G Modem connection ifconfig ppp1 DOWN requested..
Oct 24 20:49:23 (wan-start): 740 3G Modem connection ifconfig ppp1 UP requested..
Oct 24 20:49:23 (wan-start): 740 wan-start UNLOCKED Thu Oct 24 20:46:23 DST 2013

My script assumes that

ppp0 is the ADSL PPoE interface
ppp1 is the 3G Modem interface

Your log shows

Code:
Oct 24 20:41:52 pppd[571]: Using interface ppp0
Oct 24 20:41:52 pppd[571]: Connect: ppp0 <--> /dev/ttyUSB0

so I assume this is your 3G modem connection interface?

If the 3G Modem is the ACTIVE connection, then if you SSH/TELNET into the router and issue:

Code:
ifconfig ppp0 down

the 3G Modem should disconnect and the primary WAN interface should become ACTIVE in which case you will need to change the commands in the script to bounce interface ppp0 rather than ppp1

Code:
ifconfig ppp0 down
ifconfig ppp0 up

However you will probably also need to modify the script to change the logic to identify what the true name of your primary WAN interface is in order to check that it is indeed UP and available before dropping the ppp0 3G modem connection.

Regards,
 
That's worked, primary wan switched back. great

in order to modify the script, any suggestions?

Oct 24 23:03:09 dnsmasq[1471]: using nameserver 10.1.13.66#53
Oct 24 23:03:09 dnsmasq[1471]: using nameserver 10.1.13.65#53
Oct 24 23:03:09 dnsmasq[1471]: using nameserver 89.101.160.5#53
Oct 24 23:03:09 dnsmasq[1471]: using nameserver 89.101.160.4#53
Oct 24 23:03:09 (wan-start): 1516 wan-start already LOCKED since Thu Oct 24 23:00:52 DST 2013 .....EXIT
Oct 24 23:03:52 (wan-start): 1261 3G Modem connection ifconfig ppp0 UP requested..
Oct 24 23:03:53 (wan-start): 1261 wan-start UNLOCKED Thu Oct 24 23:00:52 DST 2013

so it seems that it only does the up and not the down. I checked and I do not seem to have ppp1 when both 3g and cable are connected

also the network map shows the 3g connection as standby after the failing back, should it show as disconnected?
 
Last edited:
That's worked, primary wan switched back. great

in order to modify the script, any suggestions?

Oct 24 23:03:09 dnsmasq[1471]: using nameserver 10.1.13.66#53
Oct 24 23:03:09 dnsmasq[1471]: using nameserver 10.1.13.65#53
Oct 24 23:03:09 dnsmasq[1471]: using nameserver 89.101.160.5#53
Oct 24 23:03:09 dnsmasq[1471]: using nameserver 89.101.160.4#53
Oct 24 23:03:09 (wan-start): 1516 wan-start already LOCKED since Thu Oct 24 23:00:52 DST 2013 .....EXIT
Oct 24 23:03:52 (wan-start): 1261 3G Modem connection ifconfig ppp0 UP requested..
Oct 24 23:03:53 (wan-start): 1261 wan-start UNLOCKED Thu Oct 24 23:00:52 DST 2013

so it seems that it only does the up and not the down. I checked and I do not seem to have ppp1 when both 3g and cable are connected

also the network map shows the 3g connection as standby after the failing back, should it show as disconnected?


For a DUAL WAN failover scenario, then the SECONDARY connection should ALWAYS show as Standby, similarly, prior to the 3G switch back the PRIMARY WAN should show as Standby.

As for the code change then clearly the statements..

Code:
   # DSL modem PPP0 disappears for 3G failover but if it is still here then use it!
   if [ ! "`ifconfig | grep ppp0`" = "" ]; then

are invalid so maybe you could replace ppp0 with eth0 but not 100% sure.

Alternatively you could simply rely on the RMerlin parameter supplied to wan-start to decide if you need to bounce the Secondary ppp0 3G interface, so replace the code above with

e.g.

Code:
# The PRIMARY WAN is now available
if [ $1 = 0 ];then
logger -t "($(basename $0))" $$ This is the DSL recovery starting event.......


P.S. No idea why a ppp0 UP action is performed without a corresponding ppp0 DOWN action, although lack of the message in the log would imply that the

Code:
logger -t "($(basename $0))" xxxxxxxxxxxxxxxx

wasn't executed?

Regards,
 
Hi

Code:
logger -t "($(basename $0))" xxxxxxxxxxxxxxxxwasn't executed?


not sure It was in the wan start............

modified the script replacing ppp1 with ppp0 and merlin code

Code:
#!/bin/sh
logger -t "($(basename $0))" $$ Martineau customisation starting.... " $0${*:+ $*}."
# With DUAL-WAN, this event gets triggered for both DSL and 3G
# If Semaphore Lock file exists then exit
if [ -e /tmp/wan-start-locked ]; then
   logger -t "($(basename $0))" $$ wan-start already LOCKED since `cat /tmp/wan-start-locked` .....EXIT
   exit
fi
# Create the locking semaphore file
echo `date` > /tmp/wan-start-locked
logger -t "($(basename $0))" $$ wan-start LOCKED `cat /tmp/wan-start-locked`
# Assume that at Router reboot, the Primary WAN will be the DSL modem
#        however, we need to switch back to the DSL WAN if we are currently on 3G 
# This should indicate if ADSL or 3G MODEM is ACTIVE
ADSL_ACTIVE=$(nvram get wan0_primary)
FAILOVERIP=$(nvram get wan1_ipaddr)
# Until RMerlin adds the WAN interface that triggered this WAN-START we'll have to guess stuff....
# If we don't have a DSL connection and we have a valid 3G modem IP address then fallback to DSL connection..
if [ "$ADSL_ACTIVE" = "0" ] && [ ! "$FAILOVERIP" = "" ]; then
   logger -t "($(basename $0))" $$ Checking if this is the 3G Failover starting event.......
  # Doesn't matter how long we wait (as hopefully 3G modem is currently the Primary WAN)
  #         but need to be positive to see if PPP0 reappears
   sleep 120 

   # The PRIMARY WAN is now available
   if [ $1 = 0 ];then
    logger -t "($(basename $0))" $$ This is the DSL recovery starting event.......

      logger -t "($(basename $0))" $$ 3G Modem connection ifconfig ppp0 DOWN requested......
      echo "Requesting ppp0 DOWN" >> /tmp/ifconfig.log
      `ifconfig ppp0 down >> /tmp/ifconfig.log` 
       # ..just in case the DSL WAN doesn't actually connect? i.e. we have shot our ACTIVE 3G connection in the foot?
     sleep 60
      logger -t "($(basename $0))" $$ 3G Modem connection ifconfig ppp0 UP requested...... 
      echo "Requesting ppp0 UP" >> /tmp/ifconfig.log
      `ifconfig ppp0 up >> /tmp/ifconfig.log` 
   else
      logger -t "($(basename $0))" $$ This is the 3G Failover starting event.......EXIT
      logger -t "($(basename $0))" $$ Scheduled 06:00 Reboot to restore ADSL connection.....
      /usr/sbin/cru a Reboot_0600 "0 6 * * * reboot"
   fi
   # Delete the locking semaphore file
   logger -t "($(basename $0))" $$ wan-start UNLOCKED  `cat /tmp/wan-start-locked` 
   rm /tmp/wan-start-locked
   exit
fi
logger -t "($(basename $0))" $$ NTP client setting time UK.POOL.NTP.ORG 
ntpclient -h uk.pool.ntp.org
wait
sleep 30
# Access to the TP-LINK TD-8816 ADSL modem (whilst in bridge mode)can be extremely useful to check statistics/line noise/errors etc.
# NOTE: nat-start script is also required!!!
# TP-LINK TD-8816 default I/P address is 192.168.1.1 so we need to define 192.168.1.2
logger -t "($(basename $0))" $$ Adding ifconfig for Martineau TP-LINK TD-8816 ADSL modem : 192.168.1.1
ifconfig `nvram get wan0_ifname`:0 192.168.1.2 netmask 255.255.255.0
wait
# Delete the locking semaphore file
logger -t "($(basename $0))" $$ wan-start UNLOCKED  `cat /tmp/wan-start-locked` 
rm /tmp/wan-start-locked
logger -t "($(basename $0))" $$ Martineau customisation complete....
#sleep 30
/jffs/scripts/Unblock-US.sh
wait
 
It seems better now see log for failover / failback

Code:
Oct 25 19:57:23 WAN Connection: Ethernet link down.
Oct 25 19:57:23 stop_nat_rules: apply the redirect_rules!
Oct 25 19:57:23 dnsmasq[557]: exiting on receipt of SIGTERM
Oct 25 19:57:23 dnsmasq[637]: started, version 2.65 cachesize 1500
Oct 25 19:57:23 dnsmasq[637]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 25 19:57:23 dnsmasq[637]: asynchronous logging enabled, queue limit is 5 messages
Oct 25 19:57:23 dnsmasq-dhcp[637]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 25 19:57:23 dnsmasq[637]: read /etc/hosts - 5 addresses
Oct 25 19:57:23 dnsmasq[637]: using nameserver 89.101.160.4#53
Oct 25 19:57:34 rc_service: wanduck 304:notify_rc restart_wan_if 0
Oct 25 19:57:34 stop_wan(): perform DHCP release
Oct 25 19:57:34 dnsmasq[637]: read /etc/hosts - 5 addresses
Oct 25 19:57:34 kernel: br0: port 1(vlan1) entering disabled state
Oct 25 19:57:34 kernel: vlan1: dev_set_promiscuity(master, 1)
Oct 25 19:57:34 kernel: br0: port 1(vlan1) entering listening state
Oct 25 19:57:34 dnsmasq[637]: read /etc/hosts - 5 addresses
Oct 25 19:57:34 kernel: br0: port 1(vlan1) entering learning state
Oct 25 19:57:34 kernel: br0: topology change detected, propagating
Oct 25 19:57:34 kernel: br0: port 1(vlan1) entering forwarding state
Oct 25 19:57:36 rc_service: wanduck 304:notify_rc restart_wan_line 1
Oct 25 19:57:36 dnsmasq[637]: read /etc/hosts - 5 addresses
Oct 25 19:57:36 dnsmasq[637]: using nameserver 10.1.13.66#53
Oct 25 19:57:36 dnsmasq[637]: using nameserver 10.1.13.65#53
Oct 25 19:57:36 start_nat_rules: apply the nat_rules(/tmp/nat_rules_ppp0__dev_ttyUSB0)!
Oct 25 19:57:36 dnsmasq[637]: exiting on receipt of SIGTERM
Oct 25 19:57:36 dnsmasq[660]: started, version 2.65 cachesize 1500
Oct 25 19:57:36 dnsmasq[660]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 25 19:57:36 dnsmasq[660]: asynchronous logging enabled, queue limit is 5 messages
Oct 25 19:57:36 dnsmasq-dhcp[660]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 25 19:57:36 dnsmasq[660]: read /etc/hosts - 5 addresses
Oct 25 19:57:36 dnsmasq[660]: using nameserver 10.1.13.66#53
Oct 25 19:57:36 dnsmasq[660]: using nameserver 10.1.13.65#53
Oct 25 19:57:36 pptpd[661]: MGR: Config file not found!
Oct 25 19:57:36 pptpd[661]: MGR: Maximum of 100 connections reduced to 10, not enough IP addresses given
Oct 25 19:57:36 pptpd[661]: accel-pptpd-0.8.5 compiled for pppd-2.4.5, linux-2.6.22.19
Oct 25 19:57:36 (wan-start): 655 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 25 19:57:36 (wan-start): 655 wan-start LOCKED Fri Oct 25 19:57:36 DST 2013
Oct 25 19:57:36 (wan-start): 655 Checking if this is the 3G Failover starting event.......
Oct 25 19:57:36 pptpd[677]: MGR: Manager process started
Oct 25 19:57:36 pptpd[677]: MGR: Maximum of 10 connections available
Oct 25 19:57:36 ddns: clear ddns cache file for server/hostname change
Oct 25 19:57:37 ddns update: ez-ipupdate: starting...
Oct 25 19:57:37 miniupnpd[696]: HTTP listening on port 34879
Oct 25 19:57:37 miniupnpd[696]: Listening for NAT-PMP traffic on port 5351
Oct 25 19:57:46 WAN Connection: WAN was restored.
Oct 25 19:57:49 ddns update: connected to ns1.asuscomm.com (103.10.4.108) on port 80.
Oct 25 19:57:53 ddns update: Asus update entry:: return: HTTP/1.1 299 |Invalid IP format| 10.4.41.120^M Date: Fri, 25 Oct 2013 18:45:18 GMT^M Server: Apache/2.4.3 (Unix) PHP/5.4.14^M X-Powered-By: PHP/5.4.14^M Content-Length: 0^M Content-Type: text/html^M ^M
Oct 25 19:57:53 ddns update: retval= 1, ddns_return_code (,299)
Oct 25 19:57:53 ddns update: asusddns_update: 1
Oct 25 19:59:36 (wan-start): 655 This is the 3G Failover starting event.......EXIT
Oct 25 19:59:36 (wan-start): 655 Scheduled 06:00 Reboot to restore ADSL connection.....
Oct 25 19:59:36 (wan-start): 655 wan-start UNLOCKED Fri Oct 25 19:57:36 DST 2013
Oct 25 20:01:55 dnsmasq[660]: read /etc/hosts - 5 addresses

Oct 25 20:01:55 (wan-start): 740 Martineau customisation starting....  /jffs/scripts/wan-start 0.
Oct 25 20:01:55 dhcp client: bound 109.255.211.126 via 109.255.210.1 during 167762 seconds.
Oct 25 20:01:55 (wan-start): 740 wan-start LOCKED Fri Oct 25 20:01:55 DST 2013
Oct 25 20:01:55 (wan-start): 740 Checking if this is the 3G Failover starting event.......
Oct 25 20:02:50 dnsmasq-dhcp[660]: DHCPREQUEST(br0) 192.168.1.29 98:fe:94:34:da:30 
Oct 25 20:02:50 dnsmasq-dhcp[660]: DHCPACK(br0) 192.168.1.29 98:fe:94:34:da:30 claudios-iPhone
Oct 25 20:03:55 (wan-start): 740 This is the DSL recovery starting event.......
Oct 25 20:03:55 (wan-start): 740 3G Modem connection ifconfig ppp0 DOWN requested......
Oct 25 20:03:56 WAN Connection: Ethernet link down.
Oct 25 20:03:56 stop_nat_rules: apply the redirect_rules!
Oct 25 20:03:56 dnsmasq[660]: exiting on receipt of SIGTERM
Oct 25 20:03:56 dnsmasq[774]: started, version 2.65 cachesize 1500
Oct 25 20:03:56 dnsmasq[774]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 25 20:03:56 dnsmasq[774]: asynchronous logging enabled, queue limit is 5 messages
Oct 25 20:03:56 dnsmasq-dhcp[774]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 25 20:03:56 dnsmasq[774]: read /etc/hosts - 5 addresses
Oct 25 20:04:04 rc_service: wanduck 304:notify_rc restart_wan_if 1
Oct 25 20:04:04 pppd[434]: Hangup (SIGHUP)
Oct 25 20:04:04 pppd[434]: Connect time 1481463.7 minutes.
Oct 25 20:04:04 pppd[434]: Sent 506508 bytes, received 656126 bytes.
Oct 25 20:04:04 dnsmasq[774]: read /etc/hosts - 5 addresses
Oct 25 20:04:04 pppd[434]: Connection terminated.
Oct 25 20:04:05 pppd[434]: Child process /bin/comgt -d /dev/ttyUSB0 -s /etc/ppp/3g/Generic_disconn.scr (pid 784) terminated with signal 15
Oct 25 20:04:05 pppd[434]: disconnect script failed
Oct 25 20:04:06 pppd[434]: Terminating on signal 15
Oct 25 20:04:06 pppd[434]: Exit.
Oct 25 20:04:06 stop_wan(): perform DHCP release
Oct 25 20:04:08 pppd[787]: pppd 2.4.5 started by admin, uid 0
Oct 25 20:04:10 rc_service: wanduck 304:notify_rc restart_wan_line 0
Oct 25 20:04:11 (wan-start): 824 Martineau customisation starting....  /jffs/scripts/wan-start 0.
Oct 25 20:04:11 start_nat_rules: apply the nat_rules(/tmp/nat_rules_eth0_eth0)!
Oct 25 20:04:11 dnsmasq[774]: read /etc/hosts - 5 addresses
Oct 25 20:04:11 dnsmasq[774]: using nameserver 89.101.160.5#53
Oct 25 20:04:11 dnsmasq[774]: using nameserver 89.101.160.4#53
Oct 25 20:04:11 dnsmasq[774]: exiting on receipt of SIGTERM
Oct 25 20:04:11 dnsmasq[832]: started, version 2.65 cachesize 1500
Oct 25 20:04:11 dnsmasq[832]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 25 20:04:11 dnsmasq[832]: asynchronous logging enabled, queue limit is 5 messages
Oct 25 20:04:11 dnsmasq-dhcp[832]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 25 20:04:11 dnsmasq[832]: read /etc/hosts - 5 addresses
Oct 25 20:04:11 pptpd[833]: MGR: Config file not found!
Oct 25 20:04:11 pptpd[833]: MGR: Maximum of 100 connections reduced to 10, not enough IP addresses given
Oct 25 20:04:11 pptpd[833]: accel-pptpd-0.8.5 compiled for pppd-2.4.5, linux-2.6.22.19
Oct 25 20:04:11 (wan-start): 824 wan-start already LOCKED since Fri Oct 25 20:01:55 DST 2013 .....EXIT
Oct 25 20:04:11 dnsmasq[832]: using nameserver 89.101.160.5#53
Oct 25 20:04:11 dnsmasq[832]: using nameserver 89.101.160.4#53
Oct 25 20:04:11 pptpd[835]: MGR: Manager process started
Oct 25 20:04:11 pptpd[835]: MGR: Maximum of 10 connections available
Oct 25 20:04:11 ddns: clear ddns cache file for server/hostname change
Oct 25 20:04:11 ddns update: ez-ipupdate: starting...
Oct 25 20:04:11 ddns update: connected to ns1.asuscomm.com (103.10.4.108) on port 80.
Oct 25 20:04:12 ddns update: Asus update entry:: return: HTTP/1.1 200 OK^M Date: Fri, 25 Oct 2013 19:00:44 GMT^M Server: Apache/2.4.3 (Unix) PHP/5.4.14^M X-Powered-By: PHP/5.4.14^M Content-Length: 0^M Connection: close^M Content-Type: text/html^M ^M
Oct 25 20:04:12 ddns update: retval= 0, ddns_return_code (,200)
Oct 25 20:04:12 ddns update: asusddns_update: 0
Oct 25 20:04:12 ddns: ddns update ok
Oct 25 20:04:12 WAN Connection: WAN was restored.
Oct 25 20:04:13 pppd[787]: Serial connection established.
Oct 25 20:04:13 pppd[787]: Using interface ppp0
Oct 25 20:04:13 pppd[787]: Connect: ppp0 <--> /dev/ttyUSB0
Oct 25 20:04:15 pppd[787]: Could not determine remote IP address: defaulting to 10.64.64.64
Oct 25 20:04:15 pppd[787]: not replacing existing default route via 109.255.210.1
Oct 25 20:04:15 pppd[787]: local  IP address 10.4.14.191
Oct 25 20:04:15 pppd[787]: remote IP address 10.64.64.64
Oct 25 20:04:15 pppd[787]: primary   DNS address 10.1.13.65
Oct 25 20:04:15 pppd[787]: secondary DNS address 10.1.13.66
Oct 25 20:04:15 dnsmasq[832]: read /etc/hosts - 5 addresses
Oct 25 20:04:15 dnsmasq[832]: using nameserver 10.1.13.66#53
Oct 25 20:04:15 (wan-start): 881 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 25 20:04:15 (wan-start): 881 wan-start already LOCKED since Fri Oct 25 20:01:55 DST 2013 .....EXIT
Oct 25 20:04:55 (wan-start): 740 3G Modem connection ifconfig ppp0 UP requested......
Oct 25 20:04:55 (wan-start): 740 wan-start UNLOCKED Fri Oct 25 20:01:55 DST 2013

IS that ok that the 3G Is brought up after the WAN is restored?
 
It seems better now see log for failover / failback

Code:
<snip>
Oct 25 19:57:36 (wan-start): 655 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 25 19:57:36 (wan-start): 655 wan-start LOCKED Fri Oct 25 19:57:36 DST 2013
Oct 25 19:57:36 (wan-start): 655 Checking if this is the 3G Failover starting event.......
Oct 25 19:57:36 pptpd[677]: MGR: Manager process started
Oct 25 19:57:36 pptpd[677]: MGR: Maximum of 10 connections available
Oct 25 19:57:36 ddns: clear ddns cache file for server/hostname change
Oct 25 19:57:37 ddns update: ez-ipupdate: starting...
Oct 25 19:57:37 miniupnpd[696]: HTTP listening on port 34879
Oct 25 19:57:37 miniupnpd[696]: Listening for NAT-PMP traffic on port 5351
Oct 25 19:57:46 WAN Connection: WAN was restored.
Oct 25 19:57:49 ddns update: connected to ns1.asuscomm.com (103.10.4.108) on port 80.
Oct 25 19:57:53 ddns update: Asus update entry:: return: HTTP/1.1 299 |Invalid IP format| 10.4.41.120^M Date: Fri, 25 Oct 2013 18:45:18 GMT^M Server: Apache/2.4.3 (Unix) PHP/5.4.14^M X-Powered-By: PHP/5.4.14^M Content-Length: 0^M Content-Type: text/html^M ^M
Oct 25 19:57:53 ddns update: retval= 1, ddns_return_code (,299)
Oct 25 19:57:53 ddns update: asusddns_update: 1
Oct 25 19:59:36 (wan-start): 655 This is the 3G Failover starting event.......EXIT
Oct 25 19:59:36 (wan-start): 655 Scheduled 06:00 Reboot to restore ADSL connection.....
Oct 25 19:59:36 (wan-start): 655 wan-start UNLOCKED Fri Oct 25 19:57:36 DST 2013
Oct 25 20:01:55 dnsmasq[660]: read /etc/hosts - 5 addresses

Oct 25 20:01:55 (wan-start): 740 Martineau customisation starting....  /jffs/scripts/wan-start 0.
Oct 25 20:01:55 dhcp client: bound 109.255.211.126 via 109.255.210.1 during 167762 seconds.
Oct 25 20:01:55 (wan-start): 740 wan-start LOCKED Fri Oct 25 20:01:55 DST 2013
Oct 25 20:01:55 (wan-start): 740 Checking if this is the 3G Failover starting event.......
Oct 25 20:02:50 dnsmasq-dhcp[660]: DHCPREQUEST(br0) 192.168.1.29 98:fe:94:34:da:30 
Oct 25 20:02:50 dnsmasq-dhcp[660]: DHCPACK(br0) 192.168.1.29 98:fe:94:34:da:30 claudios-iPhone
Oct 25 20:03:55 (wan-start): 740 This is the DSL recovery starting event.......
Oct 25 20:03:55 (wan-start): 740 3G Modem connection ifconfig ppp0 DOWN requested......
Oct 25 20:03:56 WAN Connection: Ethernet link down.
Oct 25 20:03:56 stop_nat_rules: apply the redirect_rules!
Oct 25 20:03:56 dnsmasq[660]: exiting on receipt of SIGTERM
Oct 25 20:03:56 dnsmasq[774]: started, version 2.65 cachesize 1500
Oct 25 20:03:56 dnsmasq[774]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 25 20:03:56 dnsmasq[774]: asynchronous logging enabled, queue limit is 5 messages
Oct 25 20:03:56 dnsmasq-dhcp[774]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 25 20:03:56 dnsmasq[774]: read /etc/hosts - 5 addresses
Oct 25 20:04:04 rc_service: wanduck 304:notify_rc restart_wan_if 1
Oct 25 20:04:04 pppd[434]: Hangup (SIGHUP)
Oct 25 20:04:04 pppd[434]: Connect time 1481463.7 minutes.
Oct 25 20:04:04 pppd[434]: Sent 506508 bytes, received 656126 bytes.
Oct 25 20:04:04 dnsmasq[774]: read /etc/hosts - 5 addresses
Oct 25 20:04:04 pppd[434]: Connection terminated.
Oct 25 20:04:05 pppd[434]: Child process /bin/comgt -d /dev/ttyUSB0 -s /etc/ppp/3g/Generic_disconn.scr (pid 784) terminated with signal 15
Oct 25 20:04:05 pppd[434]: disconnect script failed
Oct 25 20:04:06 pppd[434]: Terminating on signal 15
Oct 25 20:04:06 pppd[434]: Exit.
Oct 25 20:04:06 stop_wan(): perform DHCP release
Oct 25 20:04:08 pppd[787]: pppd 2.4.5 started by admin, uid 0
Oct 25 20:04:10 rc_service: wanduck 304:notify_rc restart_wan_line 0
Oct 25 20:04:11 (wan-start): 824 Martineau customisation starting....  /jffs/scripts/wan-start 0.
Oct 25 20:04:11 start_nat_rules: apply the nat_rules(/tmp/nat_rules_eth0_eth0)!
Oct 25 20:04:11 dnsmasq[774]: read /etc/hosts - 5 addresses
Oct 25 20:04:11 dnsmasq[774]: using nameserver 89.101.160.5#53
Oct 25 20:04:11 dnsmasq[774]: using nameserver 89.101.160.4#53
Oct 25 20:04:11 dnsmasq[774]: exiting on receipt of SIGTERM
Oct 25 20:04:11 dnsmasq[832]: started, version 2.65 cachesize 1500
Oct 25 20:04:11 dnsmasq[832]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Oct 25 20:04:11 dnsmasq[832]: asynchronous logging enabled, queue limit is 5 messages
Oct 25 20:04:11 dnsmasq-dhcp[832]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Oct 25 20:04:11 dnsmasq[832]: read /etc/hosts - 5 addresses
Oct 25 20:04:11 pptpd[833]: MGR: Config file not found!
Oct 25 20:04:11 pptpd[833]: MGR: Maximum of 100 connections reduced to 10, not enough IP addresses given
Oct 25 20:04:11 pptpd[833]: accel-pptpd-0.8.5 compiled for pppd-2.4.5, linux-2.6.22.19
Oct 25 20:04:11 (wan-start): 824 wan-start already LOCKED since Fri Oct 25 20:01:55 DST 2013 .....EXIT
Oct 25 20:04:11 dnsmasq[832]: using nameserver 89.101.160.5#53
Oct 25 20:04:11 dnsmasq[832]: using nameserver 89.101.160.4#53
Oct 25 20:04:11 pptpd[835]: MGR: Manager process started
Oct 25 20:04:11 pptpd[835]: MGR: Maximum of 10 connections available
Oct 25 20:04:11 ddns: clear ddns cache file for server/hostname change
Oct 25 20:04:11 ddns update: ez-ipupdate: starting...
Oct 25 20:04:11 ddns update: connected to ns1.asuscomm.com (103.10.4.108) on port 80.
Oct 25 20:04:12 ddns update: Asus update entry:: return: HTTP/1.1 200 OK^M Date: Fri, 25 Oct 2013 19:00:44 GMT^M Server: Apache/2.4.3 (Unix) PHP/5.4.14^M X-Powered-By: PHP/5.4.14^M Content-Length: 0^M Connection: close^M Content-Type: text/html^M ^M
Oct 25 20:04:12 ddns update: retval= 0, ddns_return_code (,200)
Oct 25 20:04:12 ddns update: asusddns_update: 0
Oct 25 20:04:12 ddns: ddns update ok
Oct 25 20:04:12 WAN Connection: WAN was restored.
Oct 25 20:04:13 pppd[787]: Serial connection established.
Oct 25 20:04:13 pppd[787]: Using interface ppp0
Oct 25 20:04:13 pppd[787]: Connect: ppp0 <--> /dev/ttyUSB0
Oct 25 20:04:15 pppd[787]: Could not determine remote IP address: defaulting to 10.64.64.64
Oct 25 20:04:15 pppd[787]: not replacing existing default route via 109.255.210.1
Oct 25 20:04:15 pppd[787]: local  IP address 10.4.14.191
Oct 25 20:04:15 pppd[787]: remote IP address 10.64.64.64
Oct 25 20:04:15 pppd[787]: primary   DNS address 10.1.13.65
Oct 25 20:04:15 pppd[787]: secondary DNS address 10.1.13.66
Oct 25 20:04:15 dnsmasq[832]: read /etc/hosts - 5 addresses
Oct 25 20:04:15 dnsmasq[832]: using nameserver 10.1.13.66#53
Oct 25 20:04:15 (wan-start): 881 Martineau customisation starting....  /jffs/scripts/wan-start 1.
Oct 25 20:04:15 (wan-start): 881 wan-start already LOCKED since Fri Oct 25 20:01:55 DST 2013 .....EXIT
Oct 25 20:04:55 (wan-start): 740 3G Modem connection ifconfig ppp0 UP requested......
Oct 25 20:04:55 (wan-start): 740 wan-start UNLOCKED Fri Oct 25 20:01:55 DST 2013

IS that ok that the 3G Is brought up after the WAN is restored?

Both the PRIMARY and the SECONDARY WAN interfaces may be in one of three states namely:

Connected
Disconnected
Standby


If no WAN interface is in Standby then the DUAL WAN failover cannot occur.

So yes it is mandatory that we bring UP the 3G after the WAN is restored.

NOTE: You appear to have left some of my 'Martineau-specific' code in the wan-start script although it shouldn't cause any harm. However you may wish to cancel the scheduled REBOOT if the WAN is restored otherwise if you have not moved Syslog to a USB drive, then loss of the Syslog may be an inconvenience.

Furthermore, I also now use the following clause in wan-start

Code:
# True REBOOT in progress? see init-start
if [ -e /tmp/BOOTINPROGRESS  ]; then

   BOOTINPROGRESS="YES"

to allow me to skip any inappropriate wan-start actions during a true reboot and let the ASUS code determine which should be the ACIVE WAN interface!


Regards,
 

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