How To Install And Configure DHCP Server On Debian

how to install and configure dhcp.

 How To Install And Configure DHCP Server On Debian


Configure DHCP Server On Debian


Creating and configuring DHCP Server on Debian is very necessary. Maybe if you only have a few computers to manage, usually a desktop or laptop, a manual or static IP address is preferable. But nowadays, with so many small and mobile network devices, static/manual configuration for individual devices can be difficult.


Therefore, this should be the main factor that you should consider in support of installing or creating a DHCP server service at your place. A DHCP server can limit the amount of time and effort you have to invest in manually configuring each network-related device and maintaining what IP tables are set up for any device.


Also Read: How to Configure Debian IP Address


Configure DHCP Server On Debian


1. First make sure you install the DHCP server package, using the command.

~#apt get-install isc-dhcp-server


The DHCP server's main configuration file is in /etc/dhcp/dhcpd.conf . The configuration file will contain multiple comments, denoted by a hash sign (#). All other uncommented lines are DHCP server parameters (used for common configuration features of the dhcp daemon) or declarations, which describe network IP ranges and IP addresses or other network values ​​that the server can send to client devices.


2. Next, edit the dhcpd.conf configuration file and adjust the contents of the file as in the example.

~#nano /etc/dhcp/dhcpd.conf

# A slightly different configuration for an internal

subnet subnet 192.168.10.0 netmask 255.255.255.0 {

range 192.168.10.10 192.168.10.100;

subnet-mask option 255.255.255.0;

option domain-name-servers 192.168.10.2, 8.8.8.8;

option domain-name “debianserver.com�;

option routers 192.168.10.1;

option broadcast-address 192.168.10.255;

default-lease-time 600;

max-lease-time 7200;

}


We explain the contents of the DHCP configuration. All parameter lines end with a semicolon (;) in the dhcp configuration file. Some parameters may have more than one value, such as domain-name-server which has two IP addresses separated by a comma. Lines starting with the hashtag # are comments and are not parsed by the dhcp server. You must replace the values ​​presented with parameters specific to your own network. Some common DHCP server parameters:

  * default-lease-time = Integer specifying the default lease time in seconds.

  * max-lease-time = Integer specifying the maximum lease time, in seconds

  * option domain-name–servers = IP addresses or DNS server addresses that clients can use.

  * option domain-name = The domain name that will give the fr of the client to use.

  * option broadcast-address = Broadcast address that should be used by clients requesting DHCP IPs

  * subnet 192.168.10.0 netmask 255.255.255.0 {whatever is attached here} subnet declaration for network 192.168.1.10

  * range 192.168.10.10 192.168.10.100 = specify the range of IP addresses to be rented by the server.

  * option routers = defines the IP address of your gateway or network exit point.


Also Read: How To Configure DNS Server With Bind9 On Debian


3. After you have edited the main configuration file and declared your own IP range, open the /etc/default/isc-dhcp-server file and replace the INTERFACESv4 parameter with the name of the network interface to be configured for your network, as illustrated in the image below .

~#nano /etc/default/isc-dhcp-server

Etc Default Isc-dhcp-server


4.Once you have done all the changes, restart the dhcp server to apply the new configuration and check the service status by issuing the below command.

~#/etc/init.d/isc-dhcp-server restart

~#/etc/init.d/isc-dhcp-server status


5. Now try on the client computer, and make sure the client gets an IP that matches the IP given from your DHCP server service.

DHCP Client Debian Server

  __________________________________________________________________________________________________________________________________________________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ _________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ ________________________________________________________________________________________________ ________

default-lease-time 600;

max-lease-time 7200;

}


We explain the contents of the DHCP configuration. All parameter lines end with a semicolon (;) in the dhcp configuration file. Some parameters may have more than one value, such as domain-name-server which has two IP addresses separated by a comma. Lines starting with the hashtag # are comments and are not parsed by the dhcp server. You must replace the values ​​presented with parameters specific to your own network. Some common DHCP server parameters:

  * default-lease-time = Integer specifying the default lease time in seconds.

  * max-lease-time = Integer specifying the maximum lease time, in seconds

  * option domain-name–servers = IP addresses or DNS server addresses that clients can use.

  * option domain-name = The domain name that will give the fr of the client to use.

  * option broadcast-address = Broadcast address that should be used by clients requesting DHCP IPs

  * subnet 192.168.10.0 netmask 255.255.255.0 {whatever is attached here} subnet declaration for network 192.168.1.10

  * range 192.168.10.10 192.168.10.100 = specify the range of IP addresses to be rented by the server.

  * option routers = defines the IP address of your gateway or network exit point.


Also Read: How To Configure DNS Server With Bind9 On Debian


3. After you have edited the main configuration file and declared your own IP range, open the /etc/default/isc-dhcp-server file and replace the INTERFACESv4 parameter with the name of the network interface to be configured for your network, as illustrated in the image below .

~#nano /etc/default/isc-dhcp-server

Etc Default Isc-dhcp-server


4.Once you have done all the changes, restart the dhcp server to apply the new configuration and check the service status by issuing the below command.

~#/etc/init.d/isc-dhcp-server restart

~#/etc/init.d/isc-dhcp-server status


5. Now try on the client computer, and make sure the client gets an IP that matches the IP given from your DHCP server service.

DHCP Client Debian Server

  __________________________________________________________________________________________________________________________________________________________________________________________________ ___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ _________________________________________________________________________________________________________________ _________________________________________________________________________________________________________________ ________________________________________________________________________________ ________

Hopefully, this article about How To Install And Configure DHCP Server On Debian, gives you a little insight. Also, read an article about How to Install Android Apps Remotely that you may need to know. Thank you.

Previous Post Next Post