LFCA 43 ๐ง DHCP vs Static IP
An IP address can be assigned in two ways. It can be statically configured โ written into the device’s configuration and kept until an administrator changes it. Or it can be dynamically assigned โ requested from a DHCP server and leased for a period of time, with the server deciding which address the device gets. The two are the opposite ends of the management spectrum, and the choice between them is one of the recurring decisions in network design. Static addressing gives the administrator control and predictability; DHCP gives automation and efficiency. Most networks use both: DHCP for the client devices, static addressing for the servers, the routers, and the printers. This chapter covers the two methods, the DHCP’s lease process, the static configuration, the reservation, the lease duration, the renewal, the failure modes, and the tools โ the ip addr add, the dhclient, the resolvectl, the dhcpd, and the NetworkManager. It builds on the interface material from LFCA 42 and the routing from LFCA 41, and it prepares the ground for the DNS and the firewall.
Key point: A static IP is configured on the device and does not change. A dynamic IP is assigned by a DHCP server and leased for a duration, after which the device must renew or release it. The DHCP’s process is the DORA โ the Discover, the Offer, the Request, the Acknowledge. The lease has a duration, and the client renews at the half of the lease. A DHCP reservation maps a MAC address to a specific IP, combining the automation of DHCP with the predictability of a static address. The ip addr add configures a static address temporarily, the dhclient requests a lease, the dhcpd is the server, and the NetworkManager and the systemd-networkd are the modern managers.
Why two methods exist
The IP address is a resource. Each device on a network needs one, and the network’s administrator must decide how the addresses are allocated. The two methods โ the static and the DHCP โ are the two strategies.
The static’s case. A server, a router, a printer, a switch โ the devices that other devices need to find at a known address โ are the static. The address is the fixed, and the clients can rely on it. The static’s addressing is the predictability, and the predictability is the requirement for the infrastructure.
The DHCP’s case. A laptop, a phone, a guest device โ the devices that come and go, that the network does not need to find โ are the DHCP. The server assigns the addresses from a pool, and the addresses are reused as the devices leave. The DHCP’s addressing is the automation, and the automation is the efficiency.
Why the static is the manual. The static address is configured on each device, and the administrator must keep the record. The record is the spreadsheet, the IPAM, or the database, and the record is the discipline. The manual is the overhead, and the overhead is the cost.
Why the DHCP is the automatic. The DHCP server has the pool, and the devices request the addresses. The server records the leases, and the record is the automatic. The automatic is the efficiency, and the efficiency is the benefit.
Why the two are the complementary. The static is for the infrastructure, and the DHCP is for the clients. The two are the design, and the design is the balance. The static for the servers, the DHCP for the laptops, and the reservation for the middle.
Why the choice matters for the security. The static address is the known, and the firewall’s rules can reference the address. The DHCP address is the dynamic, and the firewall’s rules cannot reference the address reliably. The static is the security’s preference for the sensitive.
Why the choice matters for the troubleshooting. The static address is the predictable, and the ping is the test. The DHCP address is the changing, and the diagnosis is the lease’s log. The static is the simpler, and the DHCP is the convenient.
Why the two methods coexist. The static and the DHCP are not the competing; the two are the different tools for the different cases. The network’s design uses both, and the balance is the design’s decision. The static for the servers, the DHCP for the clients, and the reservation for the devices that need the fixed address with the automation.
The DHCP’s process โ the DORA
The DHCP’s process has the four steps: the Discover, the Offer, the Request, the Acknowledge. The acronym is the DORA.
The Discover. The client broadcasts the DHCP Discover message to the 255.255.255.255 (the broadcast) or the 224.0.0.1 (the multicast). The message asks the available servers for the offer.
The Offer. The server responds with the DHCP Offer message, which contains the proposed address, the subnet mask, the gateway, the DNS, and the lease’s duration. The server reserves the address briefly.
The Request. The client broadcasts the DHCP Request message to the servers, which contains the address the client chose. The broadcast informs every server, so the ones that offered the other addresses release them.
The Acknowledge. The server responds with the DHCP Acknowledge message, which confirms the address and the parameters. The client configures the address, and the lease begins.
Why the four steps. The four steps are the handshake, and the handshake ensures the address is the unique and the parameters are the consistent. The Discover is the broadcast, the Offer is the proposal, the Request is the choice, and the Acknowledge is the confirmation.
Why the DHCP uses the broadcast. The client has no address yet, so it cannot unicast. The broadcast reaches every device on the local segment, and the servers respond. The broadcast is the necessity, and the DHCP is the broadcast protocol.
Why the DHCP relay exists. The DHCP’s broadcast does not cross the routers, so a network with the DHCP server on the other subnet needs the relay agent. The relay forwards the DHCP’s messages between the client and the server, and the ip helper-address is the Cisco’s configuration.
Why the DHCP’s lease matters. The lease is the time, and the client must renew before the lease expires. The lease is the server’s control, and the control is the pool’s management.
Why the DHCP can fail. The DHCP can fail when the server is down, the pool is exhausted, the relay is misconfigured, or the client’s request is not reaching the server. The failure’s symptom is the 169.254.x.x address (the APIPA), which the client self-assigns when the DHCP fails.
Why the APIPA matters. The 169.254.x.x is the link-local, and it is the sign that the DHCP failed. The client can communicate on the local link, but not beyond. The APIPA is the diagnosis, and the check is the ip addr.
The lease and the renewal
The DHCP’s lease is the duration the client may use the address. The lease has the valid_lft and the preferred_lft, and the client renews at the half.
The lease’s duration. The lease is the server’s choice, and the common is the 24 hours (the 86400 seconds). The shorter lease is the dynamic, and the longer is the static-like.
The valid_lft. The valid_lft is the lease’s remaining time, and the address is valid until it expires. The valid_lft 86350sec is the ~24 hours.
The preferred_lft. The preferred_lft is the time the address is preferred, and the new connections use the preferred. The deprecated address is the valid but not the preferred.
The renewal. The client renews at the half of the lease, which is the T1. The renewal is the unicast to the server, and the server extends the lease. If the renewal fails, the client tries again at the T2 (the 7/8 of the lease), and the rebind is the broadcast.
Why the half. The half is the convention, and the client has the time to try the renewal and the rebind. The half is the safety, and the pattern is the standard.
Why the renewal matters. The renewal keeps the address, and the client does not have to go through the DORA again. The renewal is the efficiency, and the lease is the continuity.
Why the lease can expire. The lease expires when the client does not renew, which happens when the client is off, the server is down, or the network is broken. The expired lease releases the address, and the server can assign it to another client.
Why the DHCP’s lease is the visibility. The server’s lease table shows the current leases, and the dhcp-lease-list or the dhcpd.leases is the source. The visibility is the management, and the table is the record.
Why the lease can be the infinite. The infinite lease is the permanent, and the pattern is the server’s configuration. The infinite is the static-like, and the use is the specific.
Why the lease should be the appropriate. The short lease is the dynamic (the guest network), and the long lease is the stable (the office network). The appropriate is the design, and the design is the balance.
The static configuration
The static configuration is the manual, and the address is the fixed. The ip addr add is the temporary, and the configuration file is the persistent.
The temporary. The ip addr add 192.168.1.100/24 dev eth0 adds the address, and the ip route add default via 192.168.1.1 adds the route. The two are the temporary, and the reboot loses them.
sudo ip addr add 192.168.1.100/24 dev eth0
sudo ip route add default via 192.168.1.1 dev eth0
Why the temporary matters. The temporary is the test, and the test is the diagnosis. The ip addr add is the way to test the address before the persistence, and the ip addr del is the revert.
The persistent on the Debian and the Ubuntu. The /etc/network/interfaces is the classic, and the ifupdown is the tool.
# /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
The iface eth0 inet static declares the static, and the address, the netmask, the gateway, and the dns-nameservers are the parameters.
The persistent on the RHEL and the Fedora. The /etc/sysconfig/network-scripts/ifcfg-eth0 is the classic, and the NetworkManager is the modern.
# /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=none
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
The BOOTPROTO=none declares the static, and the IPADDR, the NETMASK, the GATEWAY, and the DNS1 are the parameters.
The persistent on the systemd-networkd. The /etc/systemd/network/10-eth0.network is the modern, and the networkd is the tool.
# /etc/systemd/network/10-eth0.network
[Match]
Name=eth0
[Network]
Address=192.168.1.100/24
Gateway=192.168.1.1
DNS=8.8.8.8
The [Match] is the interface, and the [Network] is the parameters. The networkd is the modern, and the systemctl restart systemd-networkd is the apply.
The persistent on the NetworkManager. The nmcli is the command, and the nmtui is the interactive.
nmcli con mod eth0 ipv4.addresses 192.168.1.100/24
nmcli con mod eth0 ipv4.gateway 192.168.1.1
nmcli con mod eth0 ipv4.dns 8.8.8.8
nmcli con mod eth0 ipv4.method manual
nmcli con up eth0
The nmcli con mod is the modify, and the ipv4.method manual is the static. The nmcli con up is the apply.
Why the persistence matters. The temporary is the test, and the persistent is the production. The configuration file is the source, and the reboot applies it. The persistence is the requirement, and the file is the mechanism.
Why the static should be the documented. The static address is the manual, and the record is the discipline. The IPAM, the spreadsheet, or the wiki is the record, and the record is the prevention. The undocumented static is the collision, and the collision is the conflict.
The DHCP reservation
The DHCP reservation is the middle ground: the DHCP server assigns the address, but the address is reserved for a specific MAC, so the device always gets the same address.
The reservation’s mechanism. The server’s configuration maps the MAC to the address, and the server always offers that address to the MAC. The device uses the DHCP (the automatic), and the address is the fixed (the predictable).
# /etc/dhcp/dhcpd.conf
host printer {
hardware ethernet aa:bb:cc:dd:ee:ff;
fixed-address 192.168.1.50;
}
The host printer is the name, the hardware ethernet is the MAC, and the fixed-address is the reserved address.
Why the reservation is the best of both. The device does not need the manual configuration, and the address is the predictable. The server is the single source, and the device is the automatic. The reservation is the pattern for the servers, the printers, and the devices that need the fixed address without the manual.
Why the reservation is the management’s preference. The server’s configuration is the single place, and the change is the one edit. The manual configuration is the per-device, and the change is the N edits. The reservation is the central, and the central is the efficient.
Why the reservation requires the MAC. The reservation maps the MAC to the address, so the MAC must be known. The MAC is the hardware’s, and the ip link show is the source. The MAC is the physical, and the reservation is the binding.
Why the reservation can fail. The reservation fails when the device’s MAC changes (the new card, the spoofed MAC), the server’s configuration is wrong, or the device uses the static instead. The failure’s diagnosis is the server’s log and the device’s address.
Why the reservation is the common. The reservation is the common in the enterprise, and the pattern is the standard for the infrastructure. The static is the legacy, and the reservation is the modern.
Why the reservation is the hybrid. The reservation uses the DHCP’s automation and the static’s predictability. The two are the combined, and the combined is the reservation. The hybrid is the modern, and the modern is the preference.
The tools
The tools for the DHCP and the static are the dhclient, the dhcpd, the nmcli, the resolvectl, the ip addr, and the ip route.
The dhclient. The dhclient is the DHCP client, and the dhclient eth0 requests the lease.
sudo dhclient eth0
sudo dhclient -r eth0 # release
The dhclient eth0 requests, and the dhclient -r eth0 releases. The -v is the verbose, and the output is the DORA.
The dhcpd. The dhcpd is the DHCP server, and the /etc/dhcp/dhcpd.conf is the configuration.
sudo systemctl start isc-dhcp-server
sudo systemctl status isc-dhcp-server
The isc-dhcp-server is the service, and the dhcpd.conf is the configuration. The dhcpd.leases is the lease table, and the dhcp-lease-list is the command.
The nmcli. The nmcli is the NetworkManager’s command, and the nmcli con show is the connection’s list.
nmcli con show
nmcli dev status
nmcli con mod eth0 ipv4.method auto # the DHCP
nmcli con mod eth0 ipv4.method manual # the static
The ipv4.method auto is the DHCP, and the ipv4.method manual is the static. The nmcli con mod is the modify, and the nmcli con up is the apply.
The resolvectl. The resolvectl is the systemd-resolved’s command, and the resolvectl status is the DNS’s status.
resolvectl status
resolvectl dns eth0
The resolvectl status is the DNS’s, and the resolvectl dns eth0 is the interface’s. The DNS is the DHCP’s parameter, and the resolvectl is the query.
The ip addr. The ip addr shows the current addresses, and the valid_lft and the preferred_lft are the DHCP’s lease.
ip addr show eth0
# inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
# valid_lft 86350sec preferred_lft 86350sec
The dynamic is the DHCP, and the valid_lft is the lease. The ip addr is the interface’s, and the lease is the DHCP’s.
The ip route. The ip route shows the routes, and the default via is the gateway.
ip route
# default via 192.168.1.1 dev eth0
The default via is the gateway, and the gateway is the DHCP’s parameter or the static’s.
Why the tools are the layered. The ip addr and the ip route are the current, the dhclient and the dhcpd are the DHCP’s, and the nmcli and the resolvectl are the managers’. The layered is the diagnosis, and the combination is the complete.
Why the tools should be the known. The ip addr is the first, the dhclient is the request, the dhcpd is the server, and the nmcli is the manager. The tools are the vocabulary, and the knowledge is the fluency.
Why the tools should be the appropriate. The nmcli is the modern on the NetworkManager’s systems, and the ip is the universal. The appropriate is the distribution’s, and the choice is the system’s. The nmcli for the config, the ip for the diagnosis, and the dhclient for the manual.
Complete Example Session
# ============================================
# PART 1: THE CURRENT ADDRESS
# ============================================
ip addr show eth0
# inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
# valid_lft 86350sec preferred_lft 86350sec
# The 'dynamic' means the DHCP.
# ============================================
# PART 2: THE STATIC ADDRESS
# ============================================
sudo ip addr add 192.168.1.150/24 dev eth0
sudo ip route add default via 192.168.1.1 dev eth0
# The temporary.
# ============================================
# PART 3: THE DHCP REQUEST
# ============================================
sudo dhclient -r eth0 # release
sudo dhclient eth0 # request
# The DORA:
# DHCPDISCOVER
# DHCPOFFER
# DHCPREQUEST
# DHCPACK
# ============================================
# PART 4: THE DHCP LEASE
# ============================================
ip addr show eth0
# inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
# valid_lft 86350sec preferred_lft 86350sec
# ============================================
# PART 5: THE PERSISTENT STATIC (DEBIAN)
# ============================================
# /etc/network/interfaces
# auto eth0
# iface eth0 inet static
# address 192.168.1.100
# netmask 255.255.255.0
# gateway 192.168.1.1
# dns-nameservers 8.8.8.8
# ============================================
# PART 6: THE PERSISTENT STATIC (NETWORKMANAGER)
# ============================================
sudo nmcli con mod eth0 ipv4.addresses 192.168.1.100/24
sudo nmcli con mod eth0 ipv4.gateway 192.168.1.1
sudo nmcli con mod eth0 ipv4.dns 8.8.8.8
sudo nmcli con mod eth0 ipv4.method manual
sudo nmcli con up eth0
# ============================================
# PART 7: THE DHCP RESERVATION
# ============================================
# /etc/dhcp/dhcpd.conf
# host printer {
# hardware ethernet aa:bb:cc:dd:ee:ff;
# fixed-address 192.168.1.50;
# }
# ============================================
# PART 8: THE APIPA
# ============================================
ip addr show eth0
# inet 169.254.1.100/16 brd 169.254.255.255 scope link eth0
# The 169.254.x.x means the DHCP failed.
# ============================================
# PART 9: THE DNS
# ============================================
resolvectl status
# Link 2 (eth0)
# Current Scopes: DNS
# DNS Servers: 192.168.1.1
# ============================================
# PART 10: WHAT NOT TO DO
# ============================================
# Don't use the static without the record
# The undocumented static is the collision.
# Don't forget the persistence
# The ip addr add is temporary.
# Don't assume the DHCP is the failure
# The 169.254.x.x is the sign.
# Don't forget the reservation for the servers
# The static is the manual; the reservation is the automatic.
# Don't ignore the lease
# The DHCP's lease is the continuity.
# Don't use the short lease for the stable
# The short lease is the dynamic.
The ten parts cover the current address, the static address, the DHCP request, the DHCP lease, the persistent static (Debian), the persistent static (NetworkManager), the DHCP reservation, the APIPA, the DNS, and the anti-patterns.
Quick Reference
The Two Methods
| Method | Assignment | Duration | Use |
|---|---|---|---|
| Static | Manual | Permanent | Servers, routers |
| DHCP | Automatic | Lease | Clients, guests |
| Reservation | Automatic | Permanent | Printers, servers |
The DORA
| Step | Message | Purpose |
|---|---|---|
| D | Discover | The client’s broadcast |
| O | Offer | The server’s proposal |
| R | Request | The client’s choice |
| A | Acknowledge | The server’s confirmation |
The Lease
| Field | Meaning |
|---|---|
valid_lft | The remaining time |
preferred_lft | The preferred time |
| The renewal | At the half |
| The rebind | At the 7/8 |
The dynamic | The DHCP |
The Configuration Files
| Distribution | File |
|---|---|
| Debian/Ubuntu | /etc/network/interfaces |
| RHEL/Fedora | /etc/sysconfig/network-scripts/ifcfg-* |
| systemd-networkd | /etc/systemd/network/*.network |
| NetworkManager | The nmcli |
| DHCP server | /etc/dhcp/dhcpd.conf |
The Commands
| Command | Purpose |
|---|---|
ip addr | The current address |
ip addr add | The temporary static |
dhclient | The DHCP request |
dhclient -r | The DHCP release |
nmcli con mod | The NetworkManager’s modify |
nmcli con up | The apply |
resolvectl status | The DNS |
dhcp-lease-list | The server’s leases |
The Failure Signs
| Sign | Meaning |
|---|---|
169.254.x.x | The DHCP failed |
No dynamic | The static |
| The expired lease | The renewal failed |
| The wrong gateway | The DHCP’s parameter |
Best Practices
โ Do This:
# Check the current address
ip addr show eth0 # โ
# Use the static for the servers
# The static is the predictable. # โ
# Use the DHCP for the clients
# The DHCP is the automatic. # โ
# Use the reservation for the printers
host printer {
hardware ethernet aa:bb:cc:dd:ee:ff;
fixed-address 192.168.1.50;
} # โ
# Persist the static
# /etc/network/interfaces or the nmcli # โ
# Check the lease
ip addr show eth0 | grep valid_lft # โ
# Record the static addresses
# The IPAM or the spreadsheet # โ
# Check the APIPA
# The 169.254.x.x is the DHCP's failure. # โ
โ Don’t Do This:
# Don't use the static without the record
# The undocumented static is the collision. # โ ๏ธ
# Don't forget the persistence
ip addr add 192.168.1.100/24 dev eth0 # temporary # โ ๏ธ
# Don't assume the DHCP is the failure
# The 169.254.x.x is the sign. # โ ๏ธ
# Don't use the short lease for the stable
# The short lease is the dynamic. # โ ๏ธ
# Don't ignore the lease
# The DHCP's lease is the continuity. # โ ๏ธ
# Don't forget the reservation for the servers
# The static is the manual. # โ ๏ธ
Common Pitfalls
| Pitfall | Problem | Solution |
|---|---|---|
| The undocumented static | The collision | Record it |
| The temporary address | Lost at reboot | Persist it |
| The APIPA | The DHCP failed | Check the server |
| The expired lease | The renewal failed | Check the server |
| The wrong gateway | The DHCP’s parameter | Check the config |
| The missing reservation | The changing address | Add the reservation |
| The short lease | The dynamic | Use the long |
Real-World Examples
1. The current address
ip addr show eth0
2. The temporary static
sudo ip addr add 192.168.1.150/24 dev eth0
3. The DHCP request
sudo dhclient eth0
4. The DHCP release
sudo dhclient -r eth0
5. The NetworkManager’s static
sudo nmcli con mod eth0 ipv4.method manual
6. The NetworkManager’s DHCP
sudo nmcli con mod eth0 ipv4.method auto
7. The reservation
host printer {
hardware ethernet aa:bb:cc:dd:ee:ff;
fixed-address 192.168.1.50;
}
8. The DNS
resolvectl status
9. The lease
ip addr show eth0 | grep valid_lft
10. The APIPA
ip addr show eth0 | grep 169.254
Visual: The DORA
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ THE CLIENT THE SERVER โ
โ โ โ โ
โ โ DHCPDISCOVER (the broadcast) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโบโ โ
โ โ โ โ
โ โ DHCPOFFER (the proposal) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โ โ DHCPREQUEST (the choice) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโบโ โ
โ โ โ โ
โ โ DHCPACK (the confirmation) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โ The client configures the address. โ
โ The lease begins. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: The Lease
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LEASE START โ
โ The valid_lft = 86400 (the 24 hours) โ
โ โ
โ THE HALF (T1 = 43200) โ
โ The client renews (the unicast). โ
โ The server extends the lease. โ
โ โ
โ THE 7/8 (T2 = 75600) โ
โ The client rebinds (the broadcast) if the renewal failed.โ
โ โ
โ THE EXPIRY (the 86400) โ
โ The lease expires if the renewal and the rebind failed.โ
โ The address is released. โ
โ โ
โ ip addr show eth0 โ
โ inet 192.168.1.100/24 ... dynamic eth0 โ
โ valid_lft 86350sec preferred_lft 86350sec โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: The Static vs the DHCP
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ STATIC โ
โ The address is configured on the device. โ
โ The address is the permanent. โ
โ The record is the manual. โ
โ The use: the servers, the routers, the printers. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ DHCP โ
โ The address is assigned by the server. โ
โ The address is the lease. โ
โ The record is the automatic. โ
โ The use: the clients, the guests, the laptops. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ RESERVATION โ
โ The address is assigned by the server. โ
โ The address is the fixed (the MAC's). โ
โ The record is the server's. โ
โ The use: the printers, the servers, the infrastructure.โ
โ โ
โ The reservation is the middle ground. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: The APIPA
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ THE NORMAL โ
โ ip addr show eth0 โ
โ inet 192.168.1.100/24 ... dynamic eth0 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ THE DHCP FAILED โ
โ ip addr show eth0 โ
โ inet 169.254.1.100/16 brd 169.254.255.255 scope link eth0โ
โ โ
โ The 169.254.x.x is the APIPA. โ
โ The client self-assigned the link-local. โ
โ The DHCP is the suspect. โ
โ โ
โ THE CHECKS โ
โ 1. The server is running. โ
โ 2. The pool is not exhausted. โ
โ 3. The relay is configured (if the server is remote). โ
โ 4. The client's request is reaching the server. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: The Configuration Files
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DEBIAN/UBUNTU โ
โ /etc/network/interfaces โ
โ auto eth0 โ
โ iface eth0 inet static โ
โ address 192.168.1.100 โ
โ netmask 255.255.255.0 โ
โ gateway 192.168.1.1 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ RHEL/FEDORA โ
โ /etc/sysconfig/network-scripts/ifcfg-eth0 โ
โ BOOTPROTO=none โ
โ IPADDR=192.168.1.100 โ
โ NETMASK=255.255.255.0 โ
โ GATEWAY=192.168.1.1 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SYSTEMD-NETWORKD โ
โ /etc/systemd/network/10-eth0.network โ
โ [Match] โ
โ Name=eth0 โ
โ [Network] โ
โ Address=192.168.1.100/24 โ
โ Gateway=192.168.1.1 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ NETWORKMANAGER โ
โ nmcli con mod eth0 ipv4.method manual โ
โ nmcli con mod eth0 ipv4.addresses 192.168.1.100/24 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Summary
| Item | Value |
|---|---|
| Static | The manual, the permanent |
| DHCP | The automatic, the lease |
| Reservation | The MAC’s fixed address |
| DORA | The four steps |
| The lease | The duration |
| The renewal | At the half |
| The APIPA | The 169.254.x.x |
| The lease file | /etc/dhcp/dhcpd.conf |
| The client | The dhclient |
| The manager | The nmcli |
Key takeaways:
- The static and the DHCP are the two assignment methods โ the static is the manual and the permanent, and the DHCP is the automatic and the leased
- The static is for the servers, the routers, and the printers โ the devices that need the predictable address
- The DHCP is for the clients, the guests, and the laptops โ the devices that come and go
- The DORA is the DHCP’s process โ the Discover, the Offer, the Request, and the Acknowledge
- The lease is the duration โ the
valid_lftis the remaining, and the renewal is at the half - The reservation is the middle ground โ the DHCP assigns the address, but the MAC’s reservation makes it fixed
- The
169.254.x.xis the APIPA โ the client’s self-assigned link-local means the DHCP failed - The
ip addrshows the current address โ thedynamicflag means the DHCP, and thevalid_lftis the lease - The persistence is the configuration file โ the
/etc/network/interfaces, the/etc/sysconfig/network-scripts/, the/etc/systemd/network/, or thenmcli - The undocumented static is the collision โ the record is the discipline, and the IPAM is the source
Remember: The static and the DHCP are the two ways to assign an IP address. The static is the manual and the predictable, the DHCP is the automatic and the efficient, and the reservation is the middle ground. The DORA is the DHCP’s process, the lease is the duration, and the renewal is at the half. The 169.254.x.x is the DHCP’s failure, and the ip addr is the check. The static for the infrastructure, the DHCP for the clients, and the reservation for the printers. The choice is the design, and the design is the balance.
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!