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

static dhcp

Discussion in 'Tomato Firmware' started by petm, Sep 24, 2010.

  1. petm

    petm Networkin' Nut Member

    hi.
    i want my laptop to always have the same ip in this network. i use temato 1.28 on a WRT54GL v1.1. entries in "static dhcp" dont seem to do anything. i pick my laptop in the device list, click static, change the ip address i want (of course in the same subnet but not in the dhcp range, i.e. i select 192.168.1.2 and the automatic ips come from 192.168.1.50-192.168.1.99). this results in my computer listed twice in the device list, once with the chosen static ip and once with something automatic like 192.169.1.69. the second one is the ip my computer really has.

    what am i doing wrong?
     
  2. rhester72

    rhester72 Network Guru Member

    Static DHCP _should_ be within the DHCP range...hence the "DHCP" part. Also bear in mind that just because you declare a static IP doesn't mean you'll automatically get it - your laptop will prefer the IP it already has, regardless of what the router is willing to offer. The only way to be guaranteed to prevent this from happening (only needs to be done once) is to power off the laptop, bounce dnsmasq (service dnsmasq restart) to clear the cache, and then boot the laptop again. Also be aware that the MAC address on the laptop's wireless adapter _will_ be different from the one on the wired connection...that's why there are two MAC boxes for each static DHCP entry (just in case you switch between the two).

    Rodney
     
  3. polilla

    polilla LI Guru Member

    I'm not sure what rhester72 wrotes because i'm a native german speaker but static DHCP-addresses must be OUT of your dhcp-range not within.
    I have static dhcp-addresses like 192.168.2.11 and my dhcp range is 192.168.2.200-254 for the guest.
    So it doesnt gave any conflict.
     
  4. rhester72

    rhester72 Network Guru Member

    dnsmasq will allow static DHCP out of range but it is not part of the RFC and is not compliant. There is no conflict having static addresses within the DHCP range because dnsmasq knows never to hand them out except to the listed MAC.

    Rodney
     
  5. TexasFlood

    TexasFlood Network Guru Member

    I always thought static IPs should be outside the DHCP range but the official Tomato FAQ seems to indicate that it doesn't matter although cleaner if outside.
     
  6. polilla

    polilla LI Guru Member

    Its posibel to have an address in the range, but normally its out of range.
    For the problem that the thread-opener has i think its more clearly first he set his static-dhcp-clients out of range.
     
  7. mstombs

    mstombs Network Guru Member

    I have always used static dhcp outside a small dhcp range since HyperWRT days - easy to identify the auto ones.

    I think the problem the OP had was that there is nothing the dhcp server can do to revoke a lease when issued - the computer with the old assignment needs to do "dhcp release, dhcp renew" or "repair" on XP - then the router will issue the new IP.
     
  8. Toastman

    Toastman Super Moderator Staff Member Member

    Once again the poor original documentation has allowed a myth to take hold. Usually the Static IP is inside the range, but it doesn't matter to Tomato whether the static address is inside or outside the "allowed" range - as Rhester72 has already stated. Tomato's DHCP will not issue that number to anyone else. End of discussion.

    Whether or not it's "easier to see" if the IP is outside the range is moot - the problem is that the wording of the original documentation has really confused the issue.

    I recall the OP's question was - why is he getting 2 IP's in his list? Perhaps simply because the new Static IP is issued but the old one's lease has not yet expired? Or somehow Tomato has issued a static IP but the PC has not relinquished it's old IP? I think there may be some confusion here, needing a recheck. The PC should be using the new (static) IP. Is it?

    If it isn't - then why is the PC using the old IP and not the (newer) Static one that it was offered and presumably accepted?
     
  9. mstombs

    mstombs Network Guru Member

    The router will remember the old IP vs the computer MAC address for around 5 minutes in the "arp table". The device list merges the contents of the arp table with the dhcp client list.

    All my static dhcp assignments are less than .100, so for me it is easy to see new dynamic ones!
     
  10. petm

    petm Networkin' Nut Member

    hi.

    i of course tried the repair and also the ipconfig /release and /renew, even with a router soft reboot (i.e. via gui) in between. but my laptop will always get its stupid 192.168.1.69 even though it's supposed to get 192.168.1.2.

    in case i need to do a "service dnsmasq restart", what does that mean?

    about the leases, i think you can terminate them by clicking on them in the device list, but playing with that didnt help me either.
     
  11. occamsrazor

    occamsrazor Network Guru Member

    Just to say this is how I've been doing it for a number of years without problem. My DHCP range goes from 192.168.0.2 - 192.168.0.150, and I have about 20 static DHCPs from 192.168.0.2 to 192.168.0.30.
     
  12. petm

    petm Networkin' Nut Member

    i just, by accident, changed my ip from 192.168.1.69 to the desired 192.168.1.2: looking at the device list for the 100th time, i wondered what that "measure noise floor" meant. so i clicked it, my laptop lost its wlan connection for a few seconds, and it came back with the new ip! either a freak accident, or that does the trick.

    by the way, the measurement gave -95dB. is that good? what does it mean?
     
  13. TexasFlood

    TexasFlood Network Guru Member

    Doesn't make sense to me based on my experience with Tomato. I guess you're sure that you're client is properly set up to receive DHCP? Maybe post an image of your static IP setup and see if there is anything in the logs.
     
  14. Toastman

    Toastman Super Moderator Staff Member Member

    You forced the client to reconnect - it seems to have relinquished the old IP and finally got the new one. It appears to have retained the wrong IP for a long time - why ??? Never seen it happen here either!

    Noise floor of 95 is fine BTW
     
  15. rhester72

    rhester72 Network Guru Member

    Are you 100% certain the MAC is correct (for the wireless adapter)?

    service dnsmasq restart restarts the DNS/DHCP service - a soft reboot would have the same effect.

    Rodney
     
  16. TexasFlood

    TexasFlood Network Guru Member

    Good question. I came back to ask the same thing and also are we 100% sure there isn't another DHCP server on the network? Maybe a silly question but doesn't hurt to ask to be sure.
     
  17. petm

    petm Networkin' Nut Member

    no other dhcp server and mac is taken from the device list. but you neednt worry any more (except for your own curiosity) since as i said it works now.

    thanks for all the replies. i am impressed by the activeness of this forum.
     
  18. petm

    petm Networkin' Nut Member

    i just accessed my router from the outside (dyndns) for the first time. no computers are running at home, but the device list lists my laptop (the one with the static ip this thread was about). is it normal for that list to list all static ip devices all the time? so i will not be able to tell form the outside which of them are connected and which arent?

    also in that device list, what does the first column mean? (interfaces bro and eth1 i saw so far i think.)

    thanks.
     
  19. rhester72

    rhester72 Network Guru Member

    The device list will show all devices with an entry in the ARP table whose lease has not yet expired. Disconnected devices will remain on the list until that expiration.

    The first column indicates which interface they connected on - br0 for wired/N, eth1 for wireless B/G.

    Rodney
     
  20. Toastman

    Toastman Super Moderator Staff Member Member

    You might also look at the Tools - Wake On LAN list for a display of what devices are active.
     
  21. petm

    petm Networkin' Nut Member

    wow, every aspect of my question is covered. respect, guys!
     
  22. TexasFlood

    TexasFlood Network Guru Member

    Or you can run this from a telnet/ssh window or the Tools - System window. The "arp" command will list these devices. Below are some examples. Handy if you want to cut and paste the info or maybe write a script to log it or something like that.
    Code:
    arp -a
    Will list all devices in the ARP table, including the WAN interface.
    
    arp -a|grep -v vlan2
    At least in my case this will remove the WAN interface entry.
     
  23. petm

    petm Networkin' Nut Member

    i dont seem to have an entry "system" under "tools". but since we're talking cli: is it possible to overclock the WRT54GL in tomato via cli?
     
  24. TexasFlood

    TexasFlood Network Guru Member

    Oops. I'm using the Teddy Bear build, that might not exist in some other builds. My bad. But you can still do it via telnet, ssh, or a script. Yes it's possible to overclock the WRT54GL via the CLI. I'm pretty sure Toastman has posted how to do this. I'm a little scared to post what I can't test and can't test this as I don't have a GL but am sure you can find it by searching. Let me check, Here you go, have a look here.
     
  25. petm

    petm Networkin' Nut Member

    thank you! i must not have found the right words to search for that.

    i currently us tomato with speedmod, if i use teddybear, i wont have speedmod any more, right? but such a cli in the gui would be nice, saves the trouble with putty.
     
  26. TexasFlood

    TexasFlood Network Guru Member

    Teddybear includes speedmod per the feature list in the original Tomato ND USB Mod thread. And in the TomatoUSB historical changelog, "Included SpeedMod by Rodney Chua" is noted at build 11 with updates a couple of times thereafter. It's on build 50 now and I saw no record of speedmod being removed. The TomatoUSB Build Types page has details on the different editions to help identify which will work for you.
     

Share This Page