Jump to content

When Does the IP Address Change?

Appleboy45

Something I noticed on computers is that every once in a while, the IP address would change. Does it change randomly? Or does it change every time you disconnect it from the network and reconnect it to the same network?

Link to comment
Share on other sites

Link to post
Share on other sites

If you mean your internal IP given out by the router (like 192.168.*.*) it depends on the router.  Some seem to assign a random number every time a device connects, others remember a device and will give it the same number it had last time.  If you mean your public IP, that depends on your ISP.  Most that I know of give out "dynamic IPs" by default, meaning it might change randomly at any time, or if you disconnect your modem for more than a threshold time.  Some give out static IPs though, although most ISPs make you pay for that service.

Solve your own audio issues  |  First Steps with RPi 3  |  Humidity & Condensation  |  Sleep & Hibernation  |  Overclocking RAM  |  Making Backups  |  Displays  |  4K / 8K / 16K / etc.  |  Do I need 80+ Platinum?

If you can read this you're using the wrong theme.  You can change it at the bottom.

Link to comment
Share on other sites

Link to post
Share on other sites

For internal IP addresses some routers will have different options. The airport(which is all i have to play with at the moment) has an option on how often it changes. It keeps a log of MAC addresses mapped to IP addresses that gets cleared how often you tell it. There is another option to have certain MAC addresses never change which is convenient for port forwarding.

If I use words like probably or most likely, it is because I dislike certainty. These words can probably be omitted and the sentence read as a certainty.

Link to comment
Share on other sites

Link to post
Share on other sites

Internal networking:

not randomly, you can change this in your router's settings, it's called DHCP lease time, I think the default on most routers is 1 day, that means that if a device requests an IP they will keep that IP for 1 day before they have to ask again for a new IP.

External networking:

Depends on your ISP, some people's IP address changes when they reboot their modem, some people's IP address just changes whenever the ISP changes your IP.

Link to comment
Share on other sites

Link to post
Share on other sites

This is essentially the process:

 

1. The client doesn't have an IP, it asks for one

2. The DHCP server(s) send a message back with a lease. Basically a vacant IP address with an expiry time

3. The client says it wants to accept the lease, the server says "ok"

4. Before the lease expires the client will (usually) ask for more time. The server can either give more time or ignore it

5. When the lease expires the address becomes vacant and the client loses its address

Fools think they know everything, experts know they know nothing

Link to comment
Share on other sites

Link to post
Share on other sites

Most DHCP servers won't "rock the boat" in run-time by changing IP addresses when the leases become due.  But that's not to say that the DHCP server itself won't be changed, or the network itself undergoes a reconfiguration.

 

Just as an example, I'm using the same public IP that I was using 3 years ago.  The DHCP server of my ISP simply keeps renewing the lease on the existing IP because its working well. 

 

But 2 weeks from now, I am moving to a different "network" within the ISP corresponding to my optical fiber installation at home.  Of course I will be getting a new IP address, and probably an IPV6 block as well.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×