Posted: Fri Jul 01, 2011 16:24 Post subject: TL-WR740N no wan IP after reboot
I have a big problem getting IP when I reboot the router.
Everything works fine until i reboot it, it just doesn't get WAN IP, it stays at 0.0.0.0.
However, I found a simple solution - I just go to Setup -> Click "Apply settings", the router reboots again and I have WAN IP and internet.
My question is how to make it work every time without having to go to DD-WRT, clicking, reboot again - All I want is when I reboot to get my connection working as it was.
I had the exact same problem with my WR740N. Whenever I'd turn it on, I need to "apply" the settings in order to get a WAN connection. Tried a couple of different builds (15778, 17201) and both had the problem.
However, I found that if I run the Automatic Connection Repair script, then it will fix the WAN connection. (Go to Administration > Commands to access the shell.) And if I set it to run at startup, then it will run the script when I turn it on and my problem is practically fixed!
I'd still like to find another way to fix this without having to run this script upon startup. (Could this possibly be a modem-specific issue?) But this will do for now.
I had the exact same problem with my WR740N. Whenever I'd turn it on, I need to "apply" the settings in order to get a WAN connection. Tried a couple of different builds (15778, 17201) and both had the problem.
However, I found that if I run the Automatic Connection Repair script, then it will fix the WAN connection. (Go to Administration > Commands to access the shell.) And if I set it to run at startup, then it will run the script when I turn it on and my problem is practically fixed!
I'd still like to find another way to fix this without having to run this script upon startup. (Could this possibly be a modem-specific issue?) But this will do for now.
-scoot[/url]
I'll try this to see if this works.
Thanks so much!
I had the exact same problem with my WR740N. Whenever I'd turn it on, I need to "apply" the settings in order to get a WAN connection. Tried a couple of different builds (15778, 17201) and both had the problem.
However, I found that if I run the Automatic Connection Repair script, then it will fix the WAN connection. (Go to Administration > Commands to access the shell.) And if I set it to run at startup, then it will run the script when I turn it on and my problem is practically fixed!
I'd still like to find another way to fix this without having to run this script upon startup. (Could this possibly be a modem-specific issue?) But this will do for now.
-scoot[/url]
I'll try this to see if this works.
Thanks so much!
OK, I was trying this for hours, tried both the first and the seconds script, but with no luck. When I restart the router I still don't have WAN IP.
Can you tell me your exact build version and steps how to make it work.
Thanks.
ME=`basename $0`
RUNNING=`ps | awk '/'"$ME"'/ {++x}; END {print x+0}'`
if [ "$RUNNING" -gt 3 ]; then
echo "Another instance of \"$ME\" is running"
exit 1
fi
if [ "$RET" -ne "$PACKETS" ]; then
echo "Ping failed, releasing IP address on $IFACE"
#send a RELEASE signal
kill -USR2 `cat /var/run/udhcpc.pid` 2> /dev/null
#ensure udhcpc is not running
killall udhcpc 2> /dev/null
echo "Renewing IP address: $IFACE"
$UDHCPC
echo "Waiting 10 s..."
sleep 10
else
echo "Network is up via $TARGET"
fi
done
* If you want to merely TEST the script, click "Run Commands"
* If you want to make it run at startup, click "Save Startup"
* Later, if you want to remove it, click the "Edit" button below where the script appears, empty the box above, and click "Save Startup"
hope this works better for you! Have you made any tweaks to your system that might prevent the script from running or something?
For me the reason for no WAN IP by dhcp (cable) was the cloned mac which was not set properly at startup. Just call "ipconfig" via ssh/telnet if your router got no WAN IP after (re-)boot. The WAN-interface on the WZR-HP-G300NH is eth1, don't know if the interface on a WR740N is really vlan1 as used in the always_on.sh-script. To be sure, which interface is the right, just call "ifconfig" again after doing "Apply settings".
I tried several steps: restarting udhcpc as shown in always_on.sh, setting the mac manually, restart udhcpc after setting mac manually and and and ... nothing ... BTW: the always_on.sh isn't meant to use as code in the startup.
But finally, just very simple ...
Code:
# _________________________________________________________ for Buffalo
# / ___ / ______/ ______/_ ___/ ___ / ___ /_ ___/ WZR-HP-G300NH
# / __ _/ ___/__/____ / / / / ___ / __ _/ / / with DD-WRT r17201
# /__/ \__\_______/_______/ /__/ /__/ /__/_/ \__\ /__/_ _____________ ___
# / /__/ / ___ / \ / /
# Workaround to fix issue of "MAC Address Clone" is / / / / ___ / / / /
# not set properly before starting dhcp-client. /________/_/ /__/_/ \___/
#
# The "SLEEPER" is needed to prevent repeatedly run by calling "rc restart".
#
# Remark: Don't forget "#!/bin/sh" when no other startupcode is set before!
#
# *1
if [ `ps | grep -c "sleep\ 12345"` -ne "0" ]; then
kill `ps | awk '/sleep\ 12345/ {print $1}'`
else
TARGET=`ip route | awk '/default via/ {print $3}'`
RET=`ping -c 1 $TARGET 2> /dev/null | awk '/packets received/ {print $4}'`
if [ -z "$RET" -o "$RET" != "1" ]; then
sleep 12345 &
rc restart
fi
fi
*edit*If there is no code which causes some sleep, you may need to insert "sleep 5" or "sleep 10" before (on "# *1"). Didn't test without and my code waits at least 7 secs before reaching the restart-sequence. */edit*
It simply does what you doing manually. It makes a "rc restart" when no gateway ip is found (like always_on.sh), what seems to be the same like pressing "Apply settings".
Hope it helps out while this issue isn't fixed in DD-WRT.