Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have an old Linksys E1200 and it assigns ip addresses gradually from 192.168.1.100. I'm up to 192.169.1.195. I want to reset the counter iteration to 100. I can't find that in the settings. What should I be looking for? thanks,
You should not have to manually do anything. It should automatically assign an unused address or reuse an address with an expired lease.
Oh I see, so if a new computer (entity) comes along it can assign it to something underneath the 195? I don't think it's doing that, although it should be....
Can I manually expire leases? Can I manually expire all of them? Or change the TTL?
If your wireless devices automatically change their MAC that might be the reason your seeing the IP address change. I am not sure about your particular router but typically now days DHCP servers do not assign addresses sequentially so seeing a higher number is not necessarily bad. I am also not sure if the lease's are stored in non volatile memory but if so recycling power might "reset" the starting address.
If your wireless devices automatically change their MAC that might be the reason your seeing the IP address change. I am not sure about your particular router but typically now days DHCP servers do not assign addresses sequentially so seeing a higher number is not necessarily bad. I am also not sure if the lease's are stored in non volatile memory but if so recycling power might "reset" the starting address.
Oh I've recycled power very many times over the past few years and I still get these oddly high IP's.
I gotta ask- if they don't assign sequentially then how do they do it?
Also if a MAC is changing, that wouldn't prevent the leases expiring right?
I just went into my router settings and set the expiration to 1 minute and rebooted. All these high ip's are still there.
Also what's very odd is I rarely have my tv on, so one would assume it's lease would expire right. Not only does it not expire, but I just turned it on and now it's not listed in that DHCP reservation window. And yet, I'm using it right now it's online.... but not in DHCP??
Anyway here's what my settings look like. The DHCP reservation button opens the window showed before.
I gotta ask- if they don't assign sequentially then how do they do it?
I've yet to see a DHCP server that doesn't assign addresses sequentially. ISC DHCP (probably the most commonly used DHCP server on Linux-based equipment) used to assign addresses from the top down, then at some point this was changed to start at the lower end of the range instead.
Quote:
Originally Posted by Rotwang2
Also if a MAC is changing, that wouldn't prevent the leases expiring right?
Correct.
Quote:
Originally Posted by Rotwang2
I just went into my router settings and set the expiration to 1 minute and rebooted. All these high ip's are still there.
Rebooting doesn't delete the lease file, and changing the lease time doesn't affect previously assigned addresses.
Quote:
Originally Posted by Rotwang2
Also what's very odd is I rarely have my tv on, so one would assume it's lease would expire right. Not only does it not expire, but I just turned it on and now it's not listed in that DHCP reservation window. And yet, I'm using it right now it's online.... but not in DHCP??
DHCP Lease != DHCP Reservation.
A reservation is something you create manually, and it permanently ties an IP address to a given MAC address.
It depends on what version of ISC DHCP server is running. Per the Manual
Quote:
The DHCP server generates the list of available IP addresses from a hash table. This means that the addresses are not sorted in any particular order, and so it is not possible to predict the order in which the DHCP server will allocate IP addresses. Users of previous versions of the ISC DHCP server may have become accustomed to the DHCP server allocating IP addresses in ascending order, but this is no longer possible, and there is no way to configure this behavior with version 3 of the ISC DHCP server.
I forgot to mention the old lease is also saved on the client and that it will in the negotiation process request the old IP address, if not used the server will just acknowledge it so it is a bit more complicated. Releasing or renewing the lease from the client might get a new IP address.
I've yet to see a DHCP server that doesn't assign addresses sequentially. ISC DHCP (probably the most commonly used DHCP server on Linux-based equipment) used to assign addresses from the top down, then at some point this was changed to start at the lower end of the range instead.Correct.Rebooting doesn't delete the lease file, and changing the lease time doesn't affect previously assigned addresses.DHCP Lease != DHCP Reservation.
A reservation is something you create manually, and it permanently ties an IP address to a given MAC address.
Oh duh, I feel dumb haha. Yea I conflated the two- I actually knew that but in just fussing with the settings I conflated them.
Well I can tell you- this router (like I say it's an old router), originally assigned low IP's and iterated upward. 8 years ago the highest IP it had was like 106, and then two years later it had grown to 135, and I was like "woa! what? 135?!". And now I'm at 195 hence I'm here going huh?!
And I totally get what you're saying about the previous lease- but well two things- if you look at the screen cap it says "0 means 1 day", and the tv has been off for like... 3 weeks. I guess the fact that it's still plugged in at all means it's holding onto the lease?
But nonetheless none of this explains why I'm at 195. I have had that many devices in my life, let alone with this particular router.
Well hell- here- even if it was counting backwards- I've never had 35 devices to get it to 165 either, ok. It's all still very fishy.
It depends on what version of ISC DHCP server is running. Per the Manual
I forgot to mention the old lease is also saved on the client and that it will in the negotiation process request the old IP address, if not used the server will just acknowledge it so it is a bit more complicated. Releasing or renewing the lease might get a new IP address.
OK let's do an experiment- I'll unplug the tv entirely. Remember (as in the screenshot), it says an empty 0 field will mean 1 day.
So what's our hypothesis on what will happen on like sunday when I plug the tv back in? What will its ip be? If it's back to 195 then that could mean the iteration is in fact upwards, right. After 1 day it opens up 195 for a new lease and then just simply provided a new one at 195 again. But if it's iterating up then shouldn't it be smart enough to give the tv, say, 100? Nothing else is occupying anything under 164.
I have no idea. If you change the pool range to start from say 192.168.1.50 with 50 addresses then the DHCP negotiation would need to start over since the old leases would not be valid.
I have no idea. If you change the pool range to start from say 192.168.1.50 with 50 addresses then the DHCP negotiation would need to start over since the old leases would not be valid.
Wait you mean all the other leases above 50 would get wiped and need new leases? hmmm... wait so- it can't just insert one underneath lower than the established ones and just leave them alone?
I mean can't the code just say "ok you want a lease for a new ip, ok, what's the lowest unleased number?" and then leave the other leases alone? That seems pretty simple, no?
If you change the LAN IP of the router to a different network/subnet (say, 192.168.0.1/24), all existing leases will immediately become invalid (or rather, irrelevant).
If you change the LAN IP of the router to a different network/subnet (say, 192.168.0.1/24), all existing leases will immediately become invalid (or rather, irrelevant).
It would need to do something that drastic to give a lease to give a client asking for an ip? Just, like "hey router gimme an ip, any ip", the router can't just go "ok this 150 is free, here you go". It needs to change the subnet to do that?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.