Discussion in 'Tomato Firmware' started by fyellin, May 27, 2008.

  1. fyellin

    fyellin LI Guru Member

    I've noticed that when I use a Tomato router in WET (bridge) mode or WDS mode, I'm required to give it a fixed IP address rather than have it get an address via DHCP. Is this simply something that has not yet implemented, or is there a more intrinsic reason why this is impossible?

    I do know that at least for WET mode, it is theoretically feasible. I own a Linksys WET54G, which is a standalone wireless bridge. It has no problem getting its IP address from the router.

    Maintenance and configuration is so much easier if IP addresses come from a central source.
  2. HennieM

    HennieM Network Guru Member

    It has just not been implemented in the web interface.

    A router, different from bridges or WAPs, traditionally is a pivot point on the network; i.e. it usually IS the "central source". As that, it must have a fixed IP as it normally is the gateway that other devices on the network route packets through.

    Further, if your device is also your DHCP server, it must know it's own address in order to communicate with DHCP clients. Your WET can still be your DHCP server.

    It has therefore never been really necessary for a router to have its LAN address DHCP'd.

    The WET/WDS/other options that Tomato and other 3rd party firmware provide are "add-ons". You could however, (I would think) add-on some more, and manually configure your Tomato box for LAN DHCP.

    In my personal opinion, it's better anyway to have links in your network backbone on static IPs. If you need to fix it or connect to it, you know exactly where it is. DHCP assigned addresses are for clients that may now be using an IP, and later on another device may use that IP.
  3. fyellin

    fyellin LI Guru Member

    I absolutely agree with you that "backbone" needs to be at fixed IP addresses. My intent is that the WDS have a fixed address, but that it get its fixed address from the DHCP server (using static DHCP) rather than have it hardwired.

    I recently had to change the "network address" of my home network, and it certainly simplified my life that this knowledge was centralized in one place. I changed the LAN IP address of the router, rebooted everything else, and I was done.

    So your message makes it sound like there is some configuration that I could set using SSH, but not via the web interface, that gives me DHCP. Do you know what it is?
  4. HennieM

    HennieM Network Guru Member

    I don't know how. However, there is a DHCP client in the firmware as you can DHCP on the WAN side, so I would think that (i) you assign some address in the web interface, then (ii) setup a script that runs say 10 seconds after startup which launches the DHCP client on the br0 interface, overwriting the statically assigned stuff.

    What you mention about ease of configuration with DHCP is very true. But, what if your server is off/broken or does not start up after a power failure or something. In one scenario you now cannot get to your server to do a WoL or something, because the network path to the server is not there. In another scenario, your server works, but you screwed up the DHCP server/parameters and rebooted everything. Again you cannot get to the server to fix it.

    The list of possible scenarios is long, and, although unlikely, I have learnt the hard way to rather config my 13+ network linking points manually.
  5. fyellin

    fyellin LI Guru Member

    Just to follow up on my original post.

    The kernel seems to include explicit support only for a DHCP client on the WAN (vlan0). I cannot find any support for a DHCP client on the LAN.

    However, as HennieM points out, it is probably possible (though non-trivial) to get what I want. Tomato handles client-side DHCP by creating a process named "udhcpc" when in turn calls /sbin/dhcpc-event when an "event" occurs, such as acquiring or renewing a lease.
  6. HennieM

    HennieM Network Guru Member

    If you are really interested in pursuing this:

    You can configure the udhcp client to work on whatever interface you want. Tomato has an instance of udhcpc sort of hard-coded for the WAN, but if you run another instance (or just "an" instance) "stand-alone", you can specify whatever interface (like br0) it should work on, and which script to run on DHCP events.

    See http://udhcp.busybox.net/README.udhcpc

    Configuring an interface to not use the fixed IP is trivial. I would think you just do
    ifconfig br0 down
    and then run udhcpc on br0. (It may not even be necessary to bring br0 down beforehand.)
  7. fyellin

    fyellin LI Guru Member

    This is one of these things such that if the code already existed, I'd look at it and use it. But it's not worth the hassle of implementing it myself. There are more important things in the queue.

    I suppose I should add this as a Tomato request. "If on the basic-network.asp page, the "DHCP server" box is unchecked, then add the option of letting the box get its own LAN address via DHCP from elsewhere."
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice