How Dynamic and Static IP addresses work?

Started by JimJoe123, June 21, 2023, 03:57:30 AM

Previous topic - Next topic

JimJoe123

I was reading following statement IP conflicts.

"Employing both static and dynamic IP address allocation to configure IP addresses for network devices can lead to IP conflicts. For instance, a network admin might have assigned the IP address 192.168.1.10 to a device A (static IP allocation), and a Dynamic Host Configuration Protocol (DHCP) server operating on that network might assign the same IP address to a requesting network device (dynamic IP allocation); this can cause two different devices to have the same IP address, causing IP conflict on network."

I thought IF I assigned STATIC IP to devices then DHCP server will not(can't) assign the same IP to other devices on network.
But above statement says otherwise..that DHCP can assign same IP(Static) to other devices.
So is this TRUE?

JimJoe123

I think I found my asnwer.

"The DHCP server typically attempts to verify whether an IP address is currently in use before assigning it to a client. However, there is no guarantee that the manually configured client is currently connected to the network or available to respond when the DHCP server is verifying the IP address. So, the DHCP server might assign the IP address to a DHCP client. When the manually configured client connects to the network, you will have duplicate IP addresses on your network. IP addresses that are managed by DHCP should not be used to manually configure the network setup for a client. If a client needs to be manually configured with an IP address, that IP address should be excluded from the DHCP server's address pool."

Otanx

You also have to watch the wording on that. "The DHCP server typically attempts to verify..." So not always, and it may not work. Your quote gives one example of why. The static assigned host may not be online when it attempts to verify. It could also have a firewall between the DHCP server, and the static host that blocks the attempt. Also remember DHCP servers are programmed and configured by humans, and we make mistakes. So maybe it does not do the verification correctly, or not at all. There could be a bunch of reasons why the duplicate address detection (DAD) feature may not work. So it is easier to just avoid it all together and don't put statically assign hosts IPs inside the DHCP range. Let DAD just be the backstop in case someone misconfigures something instead of relying on it for normal operations.

-Otanx

icecream-guy

it also makes a mess with there is more than 1 DHCP server on a network, where a DHCP address can be assigned from DHCP server B. when DHCP server A, has already assigned it to a client.
:professorcat:

My Moral Fibers have been cut.

JimJoe123

Yes, I am learning that it's not a clear cut issue. Many factors are considered.
I ran several DHCP IP scanners, all show different dynamic and static IP lists.  I don;t know which to believe.
Lucky this is only a home network.  I was just curious.

JimJoe123

Quote from: Otanx on June 21, 2023, 11:56:40 AM
So it is easier to just avoid it all together and don't put statically assign hosts IPs inside the DHCP range.
-Otanx
TRUE, but at least here in Philippines ISP router is LOCKED from "Advanced" settings, so users like us can NOT access ISP router to assign DHCP IP ranges.  We can only access simple things changing SSID, password, etc...

What we've noticed is that ISP router don't seem to assign dynamic IP past 192.168.1.100, so all static IP have been using 192.168.1.100 and higher.

What is unknown is when internet is SLOW on devices, was it due to IP conflict? or bad(slow) ISP internet service?
MYSTERY...

JimJoe123

AS mentioned, used several IP scanners, or ways to view IP addresses used  with MAC. whether dynamic? or static?
Well....
each show different sets of IP and MAC, so don;t know which results to believe

For example:
ran "arp -a"
ISP DHCP client lists (I know ISP will list DHCP IP that was assigned for 24hr period, so not same list as "arp -a"
NetScan tools
Advanced IP Scanner
etc.....

ALL show different results. VERY CONFUSING

deanwebb

The answer to the last 2 questions is likely IP address conflict.

If you assign a static IP address to a device and do not restrict the DHCP server from assigning that address, you run the risk that the DHCP server will assign that address to another device. I typically make sure the address is outside the IP range or entered in the DHCP server as a MAC address with a reservation for a particular IP address.
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

priya priya

Dynamic IP Addresses:-

Dynamic IP addresses are temporary and are assigned by a Dynamic Host Configuration Protocol (DHCP) server. When a device (such as a computer, smartphone, or router) connects to a network, it sends a request to the DHCP server to obtain an IP address.

The DHCP server responds by assigning an available IP address from a pool of addresses.
The device then uses this dynamically assigned IP address for communication within the network.
The IP address lease has a specified duration, known as the lease time. Once the lease time expires, the device must renew the lease by requesting a new IP address from the DHCP server.

Static IP Addresses:-

Static IP addresses are manually assigned to devices and remain constant, unlike dynamic addresses. An administrator manually configures a static IP address for a device, typically outside the range of IP addresses managed by the DHCP server.

The device uses this static IP address for communication within the network.
Unlike dynamic IP addresses, static IP addresses do not change unless manually modified.