Static DHCP problem

Discussion in 'Tomato Firmware' started by leeb, Sep 24, 2008.

  1. leeb

    leeb LI Guru Member

    Most of my computers use static dhcp, and they can access each other by hostname.

    Recently I booted a machine from a boot CD, (Clonezilla, to make backups) and the PC gets a dynamic IP. Why? (the MAC is now listed twice in Tomato device list)

    When I reboot into the OS, the PC takes the dynamic IP again. So there's a problem: Other PCs on my LAN can't access it. Their trying to resolve the name to the statically assigned dhcp IP.

    In Tomato (v1.19) there are now TWO devices with the same MAC address. One with the (unwanted) dynamic IP, one with the static. Is there a way to prevent this?
  2. antiplex

    antiplex Addicted to LI Member

    hmm, being a newbie myself i am very unsure if i can help, but i guess that the hostname of the computer changes when you boot of the cd.
    so the devicelist should show 2 entries with the same MAC-address.
    the list in the static dhcp tab allows to manually assign hostnames to its entries, but i'm not sure if they could conflict with the hostname returned by the computer itself.

    from you wrote i assume you reference your pc's by their hostname, so check if the hostname returned by the computer is actually the one you try to connect to from the other computers...

    to me, it seems like a good feature that not only the (spoofable) MAC-address is is considered when assigning static dhcp-ips but also the hostname. through this, you could assign different static dhcp-ips to one machine running different OS through different hostnames (e.g. mymachine1_win and mymachine1_deb).
  3. leeb

    leeb LI Guru Member

    Although I'm not sure, I believe the static-lease IP is determined based on the MAC address, not the hostname.

    This could have something to do with this backup utility's ability to allow clients to boot from the network. I read something about unique IPs but didn't understand it... need to ask the Clonezilla folks too I think.

  4. fyellin

    fyellin LI Guru Member

    There's a kludge you can use to force a machine to lose a dynamic ip address:

    1. Modify Tomato's set of dynamic IP addresses so that it no longer includes the specific IP address.
    2. Reboot the machine (or just tell it it needs to renew its lease).
    3. Undo Step 1
    Most computers, by default, will ask for their old IP address. Tomato has to inform them that that address is no longer a valid DHCP address.
  5. leeb

    leeb LI Guru Member

    Not sure I understand. Is there an advantage to the above method over simply deleting the lease in the device list? Deleting the lease and rebooting worked last time I tried it, but I'd rather not have to do it.
  6. fyellin

    fyellin LI Guru Member

    I confess to being inobservant. I knew that the MAC address and the IP address both were links. But since the "name", "RSSI", and "quality" columns didn't do anything, my mouse never wandered over to the lease column. Thanks for teaching me something new.

    But. . . .

    I noticed that for many devices, when I asked the device to drop its lease and then get a new lease, the device always seems to ask for its previous IP address, and Tomato seems happy to give it that old address, even if I've specifically requested a different static address for that MAC address. That was my reason for specifically making the old IP address into an illegal DHCP address.

    I don't know what happens when Tomato drops the lease, rather than the device. I'll be running some experiments tonight.
  7. mstombs

    mstombs Network Guru Member

    You can't revoke a dhcp lease, the server has to wait until the client tries to renew. I guess it would be a security issue - easy way for an attacker to start a man in the middle attack. Half bridge modems often use a 30 second lease to force the client to continuously renew - so the leased address can be readily changed.
  8. leeb

    leeb LI Guru Member

    When you hover over the lease date on the device list, the help text says "delete lease" so maybe it gets deleted when the client is rebooted...?

    For my immediate purposes, I can tell the clonezilla backup boot CD to use a static IP address, and then it picks up is static lease when the system reboots into Linux.

    What I would like to understand though, is how does Tomato assign static leases? Is it by the machine's MAC address or its Hostname?
  9. mstombs

    mstombs Network Guru Member

    Check what Tomato tells dnsmasq to do

    cat /etc/dnsmasq.conf
    In there it is clear IP addresses are reserved for MAC address

    But dnsmasq also knows the IP address for the hosts names

    cat /etc/hosts.dnsmasq
    I'm pretty sure this is only used for dns name to ip conversions.

    dnsmasq does check that an IP is not in use before giving it out by dhcp, I wonder if your problem could be solved by waiting 5 mins for the arp table to flush before powering up the PC in differnt OS?
  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