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

Renew DHCP leases for other mac addresses

Discussion in 'Tomato Firmware' started by maerd, Feb 28, 2009.

  1. maerd

    maerd Addicted to LI Member

    Does anyone know how I can go about getting my tomato router (1.23 on wrt54g) to renew dhcp leases on another gateway which is also on the network on the lan side of the router for a number of different mac addresses.

    at the moment the modem reboots once a day and runs this script to renew it's own lease:

    ln -s /sbin/rc /tmp/udhcpc
    udhcpc -i br0 -p /var/run/udhcpc.pid -s /tmp/udhcpc -H `nvram get router_name`
    if test `ifconfig br0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` != `nvram get lan_ipaddr`; then
    nvram set lan_ipaddr=`ifconfig br0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`;
    nvram commit;

    The client computers on my network then each have to change from my static ip settings to dhcp and back again to renew their lease once a day. It would be more convinient if I could get my router to do this for all my clients.

    I thought of changing the routers mac to each of the clients mac and running the above script once for each client. I am just worried that it would bring down my router for too long as I have arround 20 clients.

    Does anybody have suggestions of a better way, hopefully one that does not involve interupting the routers service.

    Thanks in advance

Share This Page