Why your IP address change randomly?
What is the relationship between DHCP and IP address? Have you suffered random IP changing, and what DHCP do to IP address? Why is a DHCP important? Generally speaking, people using DHCP to assign IP Addresses to devices. DHCP allows you to manage the networks’ IP addresses scopes and other TCP/IP settings like DNS, Default Gateway.
Use DHCP and let your router assign an IP address from within its assignable range. My router calls this page “DHCP Settings” where I can tell the router to use DHCP and define a start and end IP address range. For example, my DHCP IP address range is defined as 192.168.1.2 to 192.168.1.100. Then, as most routers allow for Address Reservation, that is they allow you to bind a MAC address to a specific IP address within that DHCP range, use this router feature. This then provides for a deterministic (static like) IP address for a given device from within the DHCP address pool. It works because the MAC address is globally unique to each device on our planet.
My router calls this page “Address Reservation” and I can add a device to the list by clicking “Add New” and then specifying the MAC address and the IP address I want for this device. For example, one of my (fictitious) devices is added within Address Reservation page so MAC address: A1: B2: C3Big Grin4: E5: F6 is assigned the IP address: 192.168.1.2. In this way, one doesn’t have to muck around with client-side settings/configuration files and router settings to have a deterministic IP address for a given device Big Grin. It’s simply done on the router side, once for each device you want a deterministic IP address for it on your network Wink. And it avoids IP address clashes since it’s the router that has the details (all they are all visible to the admin (you) on the one router config page (my router calls it DHCP Clients list) Nod. So, unlike client-side static IP address configuration, we can more easily avoid messy errors and IP address conflicts using the routers DHCP features as intended Cool.
How to get the IP address?
There are two ways of getting an IP address. One is to be assigned a static IP address by your ISP. This address never changes, and you must configure your computer/router to use it. The other way is to use DHCP, which is a network protocol that gets you a dynamic IP address. Such addresses are “leased” out by a DHCP server on the ISP’s network. This means when your computer/router first connects to the internet, it sends out a broadcast to DHCP servers asking for an IP address. The DHCP server responds with an IP address (and other settings) that your computer uses for usually a week or so. Once the lease is up, it must be “renewed”. During a DHCP renew, the IP address (and/or other network settings) might change. This is most likely why you are seeing your IP address change from time to time.
That’s why you’d have a different IP address at a coffee shop than the IP address you’d have at a hotel on the corner. Different networks, different IP addresses. And that’s why you shouldn’t get too attached to your IP address.