#DHCP #tcp #tcpip #ip #udp #syslog #systemctl #host
*26-07-2025 isc dhcp server will end of life soon. So, the use of #keadhcpserver : [[DHCP Server KEA DHCP]] is recommended.*
### **Reserving a Static IP Address in ISC DHCP Server (Ubuntu)**
To **reserve an IP address** for a specific device in an **ISC DHCP Server**, follow these steps:
---
### **1. Open the DHCP Configuration File**
Open a terminal and edit the **DHCP configuration file**:
`sudo vi /etc/dhcp/dhcpd.conf`
_(If using `nano`, replace `vi` with `nano`.)_
---
### **2. Add a DHCP Reservation**
Inside the correct **subnet definition**, add a **reservation** using the following format:
`host <hostname> { hardware ethernet <MAC-address>; fixed-address <reserved-IP-address>; }`
#### **Replace the placeholders:**
- **`<hostname>`** → Choose a descriptive **name** for the device.
- **`<MAC-address>`** → Enter the **MAC address** of the device (e.g., `00:11:22:33:44:55`).
- **`<reserved-IP-address>`** → Specify the **IP address** you want to reserve (e.g., `192.168.1.100`).
---
### **3. Example Configuration**
A **subnet** configuration with a **reserved IP address** might look like this:
```
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
host mydevice {
hardware ethernet 00:11:22:33:44:55;
fixed-address 192.168.1.100;
}
}
```
---
### **4. Save and Exit**
- **In `nano`**: Press **`CTRL + O`** (save), then **`CTRL + X`** (exit).
- **In `vi`**: Press **`ESC`**, then type `:wq` and hit **Enter**.
---
### **5. Restart the DHCP Server**
Apply the changes by restarting the DHCP service:
`sudo systemctl restart isc-dhcp-server`
_(Alternatively, on older systems:)_
`sudo service isc-dhcp-server restart`
---
### **6. Verify the Configuration**
Check for any syntax errors:
`sudo dhcpd -t`
If everything is correct, you should see:
`Configuration file syntax is OK`
---
### **7. Additional Tips**
✅ **Ensure that the reserved IP address is within the subnet** but **outside the dynamic DHCP range** to prevent conflicts.
✅ **Document reservations** for easy management later.
✅ If the device has an **existing DHCP lease**, restart the network adapter or renew the lease using:
- **Windows:**
`ipconfig /release ipconfig /renew`
- **Linux/macOS:**
`sudo dhclient -r && sudo dhclient`
---
### **Conclusion**
Following these steps, you can **successfully reserve an IP address** for a specific device on an **ISC DHCP Server in Ubuntu**. 🚀
Zie ook [[DHCP Server ISC, Active Leases]]
Zie ook [[DHCP Server ISC, Installing Configuring]]
Zie ook [[Windows, DHCP Server Export and Import, PowerShell]]