DHCP server configuration under debian

In this article you will learn how to configure the DHCP is-dhcp-server. In addition, you will set up a reservation and configure it to work in two areas.

Isc-dhcp-server installation

To install our dhcp server we run:

It will give us the following error as it is not configured:

Configuration of is-dhcp-server

The first thing we have to do is set up the network interface that the dhcp server will work for, for this we edit the following file:

And we add our interface that will deliver addresses:

Configure the dhcp server with the following features:

  • Range of addresses to be distributed: 192.168.0.100 - 192.168.0.110
  • Network mask: 255.255.255.0
  • Duration of the concession: 1 hour
  • Liaison door: 192.168.0.1
  • DNS servers: 8.8.8.8

For this we edit the following file:

We now add the following:

Here we are configuring our scope according to the statement.

We will now have to restart the service with the following command:

Configuration of customers for dynamic steering

We will edit the network configuration to use the dhcp:

In the debian we edit the network / interfaces:

Now we reboot the network card:

Now we’ll check if we’re assigned ip with ipconfig:

We see that it has been assigned correctly. We will repeat the same with our client windows.

We set up the network card to use the dhcp protocol, restart the card and check the ip you have assigned us:

Now let’s check the address concessions for it we’ll have to see the following file. We’ll open it with cat because it’s important not to edit it, it can cause trouble.

Book an IP address

For this we will need to edit the configuration file of our dhcp server:

Once here we will add the following lines:

  • Name of reservation
  • Ethernet hardware: It is the MAC address of the host’s network card.
  • fix

Our reservation would remain this way (we will put it out of the configuration of our field):

Now we’ll start the service again.

We will check that the concession has been made, for that we will go to windows. We may have to renew the concession or restart the network card.

Let’s check what happens to the client configuration in certain circumstances, for this we’ll put a very low concession time. I’ll give you a minute.

  1. Customers take a configuration, and then we turn off the dhcp server. What about the window client? What about the Linux client?

In windows we will be assigned an address of APIPA

While in Linux it does not assign me any ip address, though then I assign an APIPA address

What happens when we modify the configuration?

Customers take a configuration, and then we change the dhcp server settings (e.g. range). What about the window client? What about the Linux client?

We change the range:

And we restart the service

With windows I keep the booking address:

And with Linux we are assigned the direction of the new range:

Configure Two Ambit

Make the necessary modifications to the current configuration of our dhcp server to share ip addresses to two different networks, the 192.168.0.0 and the 192.168.2.0.

The first thing we will do is add a fourth network card and set it up manually. If we don’t know the name of the interface we can see it with ip to:

We will now set it static, following the statement and add it to / etc / default / isch-dhcp-server.

And we set our second range:

We now restart the service:

I will now add several network cards to my client to check the concessions and set up the cards:

And we would have been given ip address in both ranges: