What are the steps to set up a DHCP server in Ubuntu?
The steps to set up a DHCP server on Ubuntu are as follows:
- Install DHCP server software: Enter the following command in the terminal to install ISC DHCP server software:
sudo apt-get update
sudo apt-get install isc-dhcp-server
- The configuration file for the DHCP server is located at /etc/dhcp/dhcpd.conf.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
option domain-name "example.com";
}
The sample configuration file above specifies the range of IP addresses, gateway, DNS servers, and domain that the DHCP server will allocate.
- The file located at /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
In the example configuration file above, the network interface eth0 is set to a static IP address of 192.168.1.1.
- Start the DHCP server: Initiate the DHCP server and configure it to start automatically at boot.
sudo systemctl start isc-dhcp-server
sudo systemctl enable isc-dhcp-server
- Verify the DHCP server: You can verify if the DHCP server is functioning properly by enabling DHCP on client devices and connecting to the network to see if they successfully receive an IP address assigned by the DHCP server.
The above are the basic steps to set up a DHCP server in Ubuntu, further configuration and adjustments may be necessary depending on actual requirements and network environment.
More tutorials
How to restore DHCP after it crashes in Ubuntu?(Opens in a new browser tab)
How to add or remove nodes in a Cassandra cluster?(Opens in a new browser tab)
What are the steps for configuring environment variables in CentOS 7?(Opens in a new browser tab)
A native guide to the atop command in Linux(Opens in a new browser tab)
How to create a cpp file in vscode?(Opens in a new browser tab)