2

OK well I was just wondering if there was a server with a dynamic (changing) IP address and a client that is connected to it, would it be able to change the IP Address, so in other words, could I avoid the IP address changing by having at least one active connection?

2
  • If you want a static ip address you should pay your internet provider for a static ip address. Eventually the client will close the connection and that's when your dynamic ip address would change. In other words the connection likely would be forced closed when the lease expires.
    – Ramhound
    Mar 7, 2013 at 9:20
  • OK I thought they would maybe do something like that. Mar 7, 2013 at 19:10

4 Answers 4

1

As long as your connection "stays up", your IP address really should remain the same. That said (depending on your connection), your connection is probably being restarted at a "lower level" then TCP, eg the connection is loosing its PPP link and needs to renegotiate it in case of DSL.

0
5

Generally, a computer will just renew its lease when it expires, keeping the same IP. The DHCP server (which assigns IP addresses) can deny this request and give the computer a new IP, but ISPs generally don't do this. Keeping a client connected to the computer isn't necessary to avoid the change; the IP address will generally be renewed whether or not a client is connected, and a client being connected won't stop an IP change.

3
  • No I'm talking about the IP address that is accessible globally, not the router or DHCP IP address. Mar 7, 2013 at 2:23
  • ISPs use DHCP to assign the external IP.
    – cpast
    Mar 7, 2013 at 2:33
  • @cpast - Not neccessarily, or even typically - when I was running an ISP we used Radius and it IP address pools.
    – davidgo
    Mar 7, 2013 at 2:43
2

In thinking this may be a XY problem, if your real question is "how can reliably get the current IP of my server" the solution to that is use a dynamic DNS service.

If you don't care that your computer will be at xxxxxxx.DnsProviderName.com where the only thing you can customize is the xxxxxxx part there are a lot of free providers out there who offer the service. Often you just need to run a program on your server (or some routers have the software built in) that detects when your IP changes and will update your DNS name to the new IP.

Here is a list of a few free dynamic DNS providers.

1

If you read about the DHCP protocol, you'll encounter the term "lease". The IP given to a system by DHCP is typically leased, and can be changed when that lease expires. If the end system refuses to change IP when the lease expires, you'll have an IP conflict on that network. In the case of your router ignoring an ISP's DHCP lease ending, you'll lose connectivity.

It may be that when your lease expires that your ISP is giving you the same one again if no one else has claimed that IP address in the meantime. You can't count on that always being the case, though. You never know when they may reorganize their network and give you a different one.

If your lease expires and you weren't supposed to get the same IP via DHCP, it means someone else in the cable company's network has it. So traffic going to what used to be your IP will be going to someone else.

There is no rule, law or limitation saying that the ISP has to allow current connections to complete or expire before switching IP addresses on you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .