Based on the Linux Master 1 exam syllabusReport an error
dhcpd.conf, range is the dynamic pool, and host + hardware ethernet (MAC) + fixed-address is a fixed reservation. It is safest to keep fixed IPs outside the pool.chronyc sources, chronyc tracking, and timedatectl.| Item | Manual setup | DHCP |
|---|---|---|
| Address assignment | A person types it in | Server distributes automatically |
| Conflict risk | High | Server tracks it and prevents it |
| Mobility | Reconfigure every time | Automatic anywhere |
| Extra info | Type in one by one | Gateway and DNS delivered too |
What DHCP gives is not ownership but a lease. It lends the address only for a set period (lease time), and the client attempts to renew about halfway through. That is why the IP of a device that has left is reclaimed over time and reused. The key point is that, unless it is a static IP, "this IP is mine forever" does not hold.
| Step | Message | Sender | Direction | Meaning |
|---|---|---|---|---|
| D | DISCOVER | Client | Broadcast | "Is there a DHCP server?" |
| O | OFFER | Server | (Unicast/broadcast) | "How about this IP?" |
| R | REQUEST | Client | Broadcast | "I'll use that IP" |
| A | ACK | Server | "Confirmed. Leased to you" |
[Client] [DHCP server]
|---- DISCOVER (broadcast) --------->| No IP yet → starts from 0.0.0.0
|<--- OFFER (includes proposed IP) --|
|---- REQUEST (acceptance notice) -->|
|<--- ACK (lease confirmed) ---------|
| The IP is now usable |
DHCP uses UDP, with the server on port 67 and the client on port 68. Because the client must communicate while it has no IP, the source IP is 0.0.0.0 and the destination is the broadcast address. Also, because broadcasts cannot cross a router, to use a DHCP server on another subnet you must configure a DHCP relay (relay agent) on the intermediate router so that it forwards the request on the client's behalf. "DHCP is broadcast, so beyond a router a relay is needed" is the key point.
dhcp, the daemon dhcpd, and the config file /etc/dhcp/dhcpd.conf.# Install
yum install dhcp-server
# Daemon control
systemctl start dhcpd
systemctl enable dhcpd
# Check lease status
cat /var/lib/dhcpd/dhcpd.leases# Global defaults
default-lease-time 600; # Default lease time (seconds)
max-lease-time 7200; # Maximum lease time (seconds)
authoritative; # Declare this the official DHCP server for this network
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200; # IP range to hand out (pool)
option routers 192.168.1.1; # Default gateway
option subnet-mask 255.255.255.0; # Subnet mask
option domain-name-servers 192.168.1.10; # DNS server
option domain-name "example.com"; # Domain name
}
# Assign a fixed IP to a specific device (by MAC)
host printer {
hardware ethernet 00:1A:2B:3C:4D:5E; # Target MAC address
fixed-address 192.168.1.50; # Always gives this IP
}| Directive | Role |
|---|---|
range | The IP address range (pool) to distribute dynamically |
default-lease-time / max-lease-time | Default and maximum lease durations (seconds) |
option routers | Default gateway to tell clients |
option domain-name-servers | DNS server address |
option subnet-mask | Subnet mask |
host + hardware ethernet + fixed-address | Reserve a fixed IP for a specific MAC |
authoritative | Declares this the official DHCP server for this subnet |
⚠️ Trap: When reserving a fixed IP, the key is to identify the device with
hardware ethernet(MAC address) and specify the IP to give withfixed-address. In this case, it is safest to keep the fixed IP outside the dynamic pool specified byrange— placing it inside the pool can conflict with dynamic distribution. Also make sure the IP range ofrangedoes not include the gateway or server IPs.
DHCP's predecessor is BOOTP (Bootstrap Protocol). BOOTP was created so that diskless workstations could get an IP at boot, but it assigned addresses permanently and required manual mapping. DHCP extended it by adding the concepts of "lease" and "automatic pool management", so even now it shares the same ports (67/68) and much of the message format. That is why you often see BOOTP-compatibility options in dhcpd.conf.
dhclient to request and renew an IP.# Request an IP lease (specified interface)
dhclient eth0
# Release the current lease (give it back)
dhclient -r eth0
# Check lease info
cat /var/lib/dhclient/dhclient.leases| Stratum | Meaning |
|---|---|
| 0 | The reference clock itself, such as an atomic clock or GPS (not directly connected to the network) |
| 1 | Primary server directly connected to Stratum 0 (most accurate) |
| 2 | Server that synchronizes from Stratum 1 |
| ... | Each step further away adds +1 to the stratum number (max 15, 16 is unsynchronized) |
Memory anchors:
pool.ntp.org).NTP does not simply "receive the time and overwrite it"; it computes the round-trip delay and offset, compensates for network latency, and gradually adjusts (slews) the clock. Suddenly jumping the time would break logs and timers, so for small errors it smoothly aligns the clock by making it run slightly faster or slower. This is why time synchronization is not a simple copy.
ntpd, the default time-sync daemon on the RHEL/CentOS family today is chrony.# Install
yum install chrony
# Daemon control
systemctl start chronyd
systemctl enable chronyd/etc/chrony.conf.# Time servers (or pool) to synchronize with
pool 2.pool.ntp.org iburst
server time.bora.net iburst # Specify a particular server
# Record the system clock to the RTC (hardware clock)
rtcsync
# Allow providing time to clients (downstream network)
allow 192.168.1.0/24
# Treat itself as stratum 10 when external sync is unavailable
local stratum 10| Directive | Role |
|---|---|
server / pool | Time server to synchronize with. iburst sends several quick queries at startup |
allow | Client range allowed to use this server as a time source |
rtcsync | Reflect the system time to the hardware clock (RTC) |
local stratum | Own stratum value when external sources are cut off |
chronyc sources # List and status of time sources being synchronized
chronyc sources -v # Verbose (includes legend)
chronyc tracking # Current sync accuracy, offset, stratum
timedatectl # System time, timezone, whether NTP sync is on⚠️ Trap: In the output of
chronyc sources, the symbol in front of a source carries meaning.*is the reference source currently being synchronized to,+is a candidate,?is unreachable, andxis a falseticker (a bad clock). Questions also ask about the difference thatserverspecifies a single machine whilepoolspecifies a pool for which DNS returns multiple IPs. If ntpd and chrony are run at the same time, they conflict over UDP port 123 (not 53), so only one of them should be on.
# Time status at a glance
timedatectl # Whether NTP is synchronized, local/UTC time, timezone
chronyc tracking # Check the reference server, offset, stratum
chronyc sources # Which servers it is attached to
# Change timezone
timedatectl set-timezone Asia/Seoul
# Renew the DHCP lease immediately and verify
dhclient -r eth0 && dhclient eth0
ip addr show eth0 # Check the received IPNTP synchronized: yes in the timedatectl output, the time is properly synchronized.Stratum and Last offset (the current error) in chronyc tracking together lets you gauge the sync quality.Tomorrow we move on to the web server, Apache, which serves real content on top of this infrastructure.
range : The directive in dhcpd.conf that sets the IP range (pool) to hand out dynamically.fixed-address + hardware ethernet : The combination that always reserves the same IP for a device with a specific MAC address.authoritative : The directive declaring this server the official DHCP server for that subnet.iburst : An option that sends several quick queries right after startup to speed up synchronization.chronyc sources : * current reference source / + candidate / ? unreachable / x falseticker.server vs pool : Specifies one server / specifies a group of servers for which DNS returns multiple IPs.Click a choice to reveal the answer and explanation.
Question 1
What is the correct order of the 4 steps (DORA) of DHCP IP assignment?
Question 2
Which directive in dhcpd.conf specifies the IP address range to distribute dynamically?
Question 3
Which of the following is correct about NTP stratum?
Question 4
You want DHCP to always give the same IP to a specific printer. Which directive must be written in the host block to identify the device?
Question 5
Which IP range (APIPA) does a client automatically take when it cannot find a DHCP server?
Question 6
Which command in chrony checks the sync quality, such as the currently synchronized time source, offset, and stratum?
Question 7
DHCP broadcasts cannot cross a router. What should be configured on the router so that clients on another subnet can use a central DHCP server?