LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2022, 02:31 AM   #1
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Rep: Reputation: Disabled
Reset router counter to 192.168.1.100


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,

rw
 
Old 12-30-2022, 03:26 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
You should not have to manually do anything. It should automatically assign an unused address or reuse an address with an expired lease.
 
Old 12-30-2022, 03:32 AM   #3
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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?

thanks

rw

Last edited by Rotwang2; 12-30-2022 at 05:56 AM.
 
Old 12-30-2022, 04:11 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
I don't know if you can clear all leases. Not familiar with your router but based on how dhcp works in general.
 
Old 12-30-2022, 06:40 AM   #5
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
I don't know if you can clear all leases. Not familiar with your router but based on how dhcp works in general.

Ok here's a picture. See I don't know why it's up to 195.

https://www.linuxquestions.org/quest...1&d=1672403953
Attached Thumbnails
Click image for larger version

Name:	dhcpscreencapture-192-168-1-1-DHCP-Static-asp-session-id-ef63faae776cead8eea0f0a78a4433aa-2022-1.png
Views:	21
Size:	94.0 KB
ID:	40119  
 
Old 12-30-2022, 08:54 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
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.
 
Old 12-30-2022, 09:30 AM   #7
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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.

thanks for sticking with this mystery!

https://www.linuxquestions.org/quest...1&d=1672414102
Attached Thumbnails
Click image for larger version

Name:	routersettings.png
Views:	9
Size:	54.8 KB
ID:	40120  
 
Old 12-30-2022, 09:59 AM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by Rotwang2 View Post
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 View Post
Also if a MAC is changing, that wouldn't prevent the leases expiring right?
Correct.
Quote:
Originally Posted by Rotwang2 View Post
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 View Post
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.
 
Old 12-30-2022, 10:40 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
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.

Last edited by michaelk; 12-30-2022 at 10:48 AM.
 
Old 12-30-2022, 10:42 AM   #10
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
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.

thanks
 
Old 12-30-2022, 10:47 AM   #11
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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.
 
Old 12-30-2022, 12:58 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
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.
 
Old 12-30-2022, 01:09 PM   #13
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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?
 
Old 12-30-2022, 01:20 PM   #14
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
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).
 
Old 12-30-2022, 01:27 PM   #15
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I access a LAN IP on 192.168.100.0/24 subnet from 192.168.0.0/24 subnet? Usalabs Linux - Networking 5 01-20-2020 03:00 PM
[root@wlxxb ~]# telnet 192.168.192.12 25 Trying 192.168.192.12... telnet problem cnhawk386 Linux - Networking 1 10-10-2007 02:50 PM
What route to access daisy chained 2d router 192.168.1.1 after 192.168.0.1 (subnets?) Emmanuel_uk Linux - Networking 6 05-05-2006 01:47 AM
Is someone on my network?! ::ffff:192.168.0.10:ssh ::ffff:192.168.0.:38201 ESTABLISHE ming0 Linux - Security 4 04-12-2005 01:04 AM
192.168.2.1 network with 192.168.0.1? Micro420 Linux - Networking 2 02-27-2005 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration