1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help: Wrt54GL, Manual dhcp release/renew (WAN) everytime...

Discussion in 'Cisco/Linksys Wireless Routers' started by solar196, Aug 9, 2007.

  1. solar196

    solar196 LI Guru Member

    Okay im running a WRT54GL on dd-wrt at the moment.

    When i turn on the router everything goes as normal and everything looks normal. My pc's are getting ip's from routers dhcp (Wireless and wired), the router acquired ip from my cable modem etc...

    However, the problem is that everytime the router is turned on i need to dhcp release/renew from the router status page to get internet connectivity. (WAN port dhcp release/renew from main router status page)

    Its actually driving me insane since everytime there is a power outage in the area or just normally turning the router on or off, the router loses internet connectivity until i dont dhcp release/renew from the routers status page. Even though the WAN will show an ip

    I have tried everything from the 30/60 seconds hard reset to 10 different firmwares including stock ones... tried turning the router off at night last night also but when i turned it on in the morning, even though it had acquired an ip from the cable modem i still had to dhcp release/renew from the router stats page... (the ip adress remains the same during the dhcp release/renew)

    Basically i think my automatic dhcp of the wan port is fried.... thus i have to do it manually each time i turn on the router...

    The problem is with the router since i tried another WRT54GL on my modem which seems to work normally...
    its wierd and ive been searchign for a solution all day on google...
    any more help would be greatly appreciated...
    Thank you!

    if anything can sumone make me a script so that it automatically does an dhcp release/renew to the wan port on startup? (im a noob at linux)

    Code:
    ~ # ifconfig
    br0       Link encap:Ethernet  HWaddr 00:18:39:D4:31:F2
              inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:23211 errors:0 dropped:0 overruns:0 frame:0
              TX packets:22926 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:3893295 (3.7 MiB)  TX bytes:20628994 (19.6 MiB)
    
    eth0      Link encap:Ethernet  HWaddr 00:18:39:D4:31:F2
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:448770 errors:0 dropped:0 overruns:0 frame:0
              TX packets:46277 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:51744420 (49.3 MiB)  TX bytes:24861001 (23.7 MiB)
              Interrupt:4
    
    eth1      Link encap:Ethernet  HWaddr 00:18:39:D4:31:F4
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:3502 errors:0 dropped:0 overruns:0 frame:3434
              TX packets:6084 errors:974 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:610185 (595.8 KiB)  TX bytes:2068608 (1.9 MiB)
              Interrupt:2 Base address:0x5000
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              UP LOOPBACK RUNNING MULTICAST  MTU:16436  Metric:1
              RX packets:2 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:152 (152.0 B)  TX bytes:152 (152.0 B)
    
    vlan0     Link encap:Ethernet  HWaddr 00:18:39:D4:31:F2
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:21041 errors:0 dropped:0 overruns:0 frame:0
              TX packets:24265 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:3554679 (3.3 MiB)  TX bytes:20506048 (19.5 MiB)
    
    vlan1     Link encap:Ethernet  HWaddr 00:18:39:D4:31:F3
              inet addr:203.81.236.193  Bcast:203.81.236.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:427697 errors:0 dropped:0 overruns:0 frame:0
              TX packets:22014 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:40114633 (38.2 MiB)  TX bytes:4130371 (3.9 MiB)
    
     
  2. mstombs

    mstombs Network Guru Member

    Strange can't explain the strange behaviour but...

    The dd-wrt wiki has a script for checking and repairing dhcp connections, but by default runs continuously when started - looping every 10 seconds

    http://www.dd-wrt.com/wiki/index.php/Useful_Scripts#Automatic_Connection_Repair_.28always_on.sh.29

    To use this you need to create it as a file called 'always_on.sh' on say /jffs (non volatile flash directory), make it executable with the command chmod +x /jffs/always_on.sh, then your startup script should contain

    Code:
    sleep 30
    /jffs/always_on.sh &
    The important commands to release the dhcp lease are

    Code:
    	#send a RELEASE signal
          kill -USR2 `cat /var/run/udhcpc.pid` 2> /dev/null
    	#ensure udhcpc is not running
          killall udhcpc 2> /dev/null
    and to renew

    Code:
    udhcpc -i vlan1 -p /var/run/udhcpc.pid -s /tmp/udhcpc
    You may want to check this is the usual set of parameters for your current version/configuration of dd-wrt, from telnet "ps" will show you most of the command line.

    Note it appears dd-wrt doesn't have the Tomato functions

    Code:
    /sbin/dhcpc-release
    /bin/sleep 5
    /sbin/dhcpc-renew
    Hope that helps...
     
  3. solar196

    solar196 LI Guru Member

    Thanks for the reply....
    im running this script on startup now..
    Code:
    kill -USR2 `cat /var/run/udhcpc.pid` 2> /dev/null
    killall udhcpc 2> /dev/null
    /bin/sleep 5
    udhcpc -i vlan1 -p /var/run/udhcpc.pid -s /tmp/udhcpc
    it seems to fix all my problems... however i wish sumone could find me a solution to this problem at source...
     
  4. mstombs

    mstombs Network Guru Member

    glad that it seems to work, I would have thought you may have needed an extra delay (the sleep command) before those commands to give the normal startup routines a chance to finish - but hey if that's all that is need to wake up your connection through the cable modem...
     

Share This Page