What's new

Your ISP's DHCP does not function properly.

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

So in the spirit of Colin's and Johns helpful input, one could do this:

Create /jffs/scripts/wan_if_restart.sh and add this code to it:
Code:
#!/bin/sh

# restart primary WAN interface if not connected

check_wanup(){

ping -c 1 -W 1 www.google.com >/dev/null

if [ $? -eq 1 ];then
   logger "restarting WAN interface $(nvram get wan_primary) via $0"
   service "restart_wan_if $(nvram get wan_primary)" >/dev/null
fi

sleep 10

check_wanup

}

check_wanup
Then call it from /jffs/scripts/services-start:

Create or add to /jffs/scripts/services-start
Code:
#!/bin/sh

/jffs/scripts/wan_if_restart.sh # start the WAN checker
Make sure the files are working:
Code:
dos2unix /jffs/scripts/*
chmod a+rx /jffs/scripts/*
This runs continually in the background and checks every 10 seconds if the WAN interface is reported as up.
If not it restarts the interface.

Edit: Code uses ping to determine WAN up



Thanks for the script, I have been getting randomly the error "DHCP does not function properly"every few days lately. Not sure if it is my ISP to blame or new firmware revision issue but it has been driving me crazy as I have bunch of IoT devices and security cameras that all fail while I am at work and have to wait to go home and reboot router to have WAN reconnect. Hopefully this script will resolve requiring the reboot. It seems odd that WAN DHCP auto reconnect is not enabled in firmware by default.
 
It seems odd that WAN DHCP auto reconnect is not enabled in firmware by default.
Make sure you have Tools/Other Settings Wan: Use DNS probes to determine if WAN is up (default: Yes) set to Yes.
And I know, for some reason when it reaches that state the Asus code is at a loss what to do and stays so indefinitely unless you pull the WAN cable or restart it manually in the WebUI as I described in an earlier post.
 
I wouldn't want a script to restart the wan on first ping failure - my ISP at least seems to drop icmp ping messages as low priority (and now also due to the buggy Puma 6 chipset in the CM...). Restarting WAN unnecessarily tends to annoy users!
 
I wouldn't want a script to restart the wan on first ping failure - my ISP at least seems to drop icmp ping messages as low priority (and now also due to the buggy Puma 6 chipset in the CM...). Restarting WAN unnecessarily tends to annoy users!
If ping does not respond, the timeout is 10 seconds (standard ping). So if WAN is not up it waits for 10 secs for a response, then runs the rest of the if clause.

I would imaging that users don't care what the router does if WAN is down. That itself is an annoying state.
 
Disabling the wanduck (setting "Wan: Use DNS probes to determine if WAN is up" to No), didn't help. When I reboot the router I still get the DHCP error.

So after rebooting the router, I manually did the command: service "restart_wan_if $(nvram get wan_primary)"

And it started the WAN properly. So I'll probably put that in /jffs/scripts/wan-start, with a delay, so it can start the wan "for real."
 
I think I've got the work-around working now.

I put it in /jffs/scripts/init-start since having it in wan-start caused it to re-trigger itself.

I added this to init-start:

Code:
sleep 40
logger "init-start: Running"
if ! ping -c1 -W3 8.8.8.8
then
  if ! ping -c1 -W3 8.8.4.4
  then
    logger "init-start: Internet appears to be down, restarting WAN"
    service "restart_wan_if 0"
    sleep 1
    service "restart_wan_if 1"
    sleep 10
  else
    logger "init-start: Internet is up, no need to restart WAN"
  fi
else
  logger "init-start: Internet is up, no need to restart WAN"
fi

It's dependent on the sleep time to start-up at the correct time. I added a little more than usually necessary to be safe.

Thanks for all the great answers and help, I appreciate it.
 
Under the wan tab set DHCP query frequency to aggressive mode. I get the same error on my fiber without it.
 
For what it's worth, my DHCP query frequency is already set to Aggressive mode (and I tried switching it back and forth), but it doesn't seem to make any difference in my setup.
 
For what it's worth, my DHCP query frequency is already set to Aggressive mode (and I tried switching it back and forth), but it doesn't seem to make any difference in my setup.
Did you test a mac clone yet?
 
No, I'm scared to try the mac cloning. With the changes I put in init-start, it's working ok now, though. It's a work-around, but it seems to be good enough.

If I turn both the fiber modem and router off, and then turn them back on, there's no problems, either. It only seems to get messy when the router is rebooted on it's own.
 
Mac clone is not scary it won't break anything. I'm using it.
 
If ping does not respond, the timeout is 10 seconds (standard ping). So if WAN is not up it waits for 10 secs for a response, then runs the rest of the if clause.

I would imaging that users don't care what the router does if WAN is down. That itself is an annoying state.
Do you know how to fix this ? or anyone ,
May 5 13:04:59 WAN Connection: ISP's DHCP did not function properly.
May 5 13:04:59 WAN Connection: Ethernet link down.
May 5 13:05:04 WAN Connection: Ethernet link up.
May 5 13:05:04 rc_service: wanduck 160:notify_rc restart_wan_if 0
May 5 13:05:05 dnsmasq[178]: warning: no upstream servers configured
May 5 13:05:05 RT-AC1200G+: start httpd:80
May 5 13:05:05 NAT Tunnel: AAE Service is stopped
May 5 13:05:06 AAE: AAE Service is started
May 5 13:05:06 disk monitor: be idle
May 5 13:05:06 syslog: Generating SSL certificate...
May 5 13:05:06 hour monitor: daemon is starting
May 5 13:05:06 hour monitor: daemon terminates
May 5 13:05:06 jffs2: valid logs(1)
May 5 13:05:06 miniupnpd[221]: version 1.9 started
May 5 13:05:06 miniupnpd[221]: HTTP listening on port 59285
May 5 13:05:06 miniupnpd[221]: Listening for NAT-PMP/PCP traffic on port 5351
May 5 13:05:07 syslog: module ax88179_178a not found in modules.dep
May 5 13:05:08 Mastiff: init
May 5 13:05:08 syslog: module ledtrig-usbdev not found in modules.dep
May 5 13:05:08 syslog: module leds-usb not found in modules.dep
May 5 13:05:09 kernel: SCSI subsystem initialized
May 5 13:05:11 kernel: Attempt to kill tasklet from interrupt
May 5 13:05:14 WAN Connection: ISP's DHCP did not function properly.
May 5 14:06:06 rc_service: httpd 184:notify_rc restart_wan_if 0
May 5 14:06:06 kernel: Attempt to kill tasklet from interrupt
 
I'm also getting this error message on my AC86U when trying to use the 4G modem. The modem works fine on the PC and the older 87U just fine. I tried the suggestions in this thread, but none worked.
 
So in the spirit of Colin's and Johns helpful input, one could do this:

Create /jffs/scripts/wan_if_restart.sh and add this code to it:
Code:
#!/bin/sh

# restart primary WAN interface if not connected

check_wanup(){

ping -c 1 -W 1 www.google.com >/dev/null

if [ $? -eq 1 ];then
   logger "restarting WAN interface $(nvram get wan_primary) via $0"
   service "restart_wan_if $(nvram get wan_primary)" >/dev/null
fi

sleep 10

check_wanup

}

check_wanup
Then call it from /jffs/scripts/services-start:

Create or add to /jffs/scripts/services-start
Code:
#!/bin/sh

/jffs/scripts/wan_if_restart.sh # start the WAN checker
Make sure the files are working:
Code:
dos2unix /jffs/scripts/*
chmod a+rx /jffs/scripts/*
This runs continually in the background and checks every 10 seconds if the WAN interface is reported as up.
If not it restarts the interface.

Edit: Code uses ping to determine WAN up

Hello, I have a similar problem - Asus RT-AC57U with USB modem ZTE MF821D (no 2nd WAN provider). And repeatedly my connection to internet is interrupted due to "Cold Standby" state of modem. I can understand you have found solution, concerning scripts (creating or adding) to "wake it up", but please excuse my ignorance - how can one find scripts in question and change them? Can you describe step by step please?
 
So in the spirit of Colin's and Johns helpful input, one could do this:

Create /jffs/scripts/wan_if_restart.sh and add this code to it:
Code:
#!/bin/sh

# restart primary WAN interface if not connected

check_wanup(){

ping -c 1 -W 1 www.google.com >/dev/null

if [ $? -eq 1 ];then
   logger "restarting WAN interface $(nvram get wan_primary) via $0"
   service "restart_wan_if $(nvram get wan_primary)" >/dev/null
fi

sleep 10

check_wanup

}

check_wanup
Then call it from /jffs/scripts/services-start:

Create or add to /jffs/scripts/services-start
Code:
#!/bin/sh

/jffs/scripts/wan_if_restart.sh # start the WAN checker
Make sure the files are working:
Code:
dos2unix /jffs/scripts/*
chmod a+rx /jffs/scripts/*
This runs continually in the background and checks every 10 seconds if the WAN interface is reported as up.
If not it restarts the interface.

Edit: Code uses ping to determine WAN up

Does this solution work in 2020? I'm considering trying it.

Currently using Merlin Firmware Version: 384.17 on my 86U. I disabled the built-in Network Monitoring DNS Query and Ping located in webUI Administration/System/BasicConfig because it didn't help things.

I've seen some people say ASUS is working to solve this known issue with a new WAN continuous mode in future firmware update?
Is that true?
 

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