• 12 heures
  • Moyenne

Ce cours est visible gratuitement en ligne.

course.header.alt.is_video

course.header.alt.is_certifying

J'ai tout compris !

Mis à jour le 01/06/2022

Install a DHCP Server

In this part,  you’re going to learn the different roles Microsoft offers before installing them on your server. First, we’ll start with the DHCP server role, which you use to configure your network devices automatically.

Review the DHCP Basics

Let’s review how DHCP works. Dynamic Host Configuration Protocol is a protocol for managing the configuration of your dynamic devices, eliminating the risk of errors, and making your network more reliable. 

Install the DHCP Server Role

You know what you’re doing by now! Head to Server Manager, and tick the DHCP server box under Add roles and features:

DHCP role installed
DHCP role installed

The dashboard is giving you lots of red alerts and a notification. But don’t worry – you’re not finished configuring the role yet.

Click on the notification and then on Complete DHCP configuration. You should end up on this screen:

Configuration Wizard for the DHCP server role
Configuration Wizard for the DHCP server role

You can now close the wizard. Let’s use the DHCP management console to administer and configure DHCP. To do this, go to the DHCP section, right-click and select the DHCP manager

Launching the DHCP manager
Launching the DHCP Manager

You’ll find all of the options for configuring this role:

DHCP manager
DHCP Manager

The window is in three sections:

  • Your DHCP servers are on the left

  • Configuration options are in the middle

  • Actions you can take (depending on the context) are on the right. You’ll find shortcuts to menus in the actions (displayed by right-clicking).

Manage the DHCP Service

As mentioned earlier, a role uses features that rely on services. The first thing you can do with this manager is stop, pause, start, or restart the service associated with the DHCP role. You’ll have to restart the DHCP service to load the configuration again, but that couldn’t be easier. Right-click on the name of the server hosting this role, and you can carry out these actions in All Tasks:

Actions on the DHCP service
Actions on the DHCP service

Another thing to note is that if you open the properties (right-click on the server), you’ll see where the database used by the DHCP service is located:

Location of the DHCP database
Location of the DHCP database

You have the following settings available:

  • Server Options

  • Policies

  • Filters

By selecting IPv4 and right-clicking this setting, you can create scopes of addresses to distribute with your server.

Next, you can set specific options for each scope and global options, which are server options that apply to all scopes. Then, you’ll set the conditions for providing options or addresses according to particular criteria in policies. For example, you could specify a different default gateway for your older equipment. Or, more likely, provide specific configuration options to devices with MAC addresses featured on a list.

Setting up a DHCP condition
Setting up a DHCP condition

Finally, you can set up Allow or Deny lists via filters:

DHCP filters
DHCP filters

I suggest using both: save the MAC addresses for all your devices here and only provide an IP address if the MAC address is on the list. You can then pair this with policies by specifying known client identifiers. This gives you control over which devices have access to your network.

Your First DHCP Scope

Now that you can operate the DHCP Manager blindfolded, let's create your first scope. Start by right-clicking IPv4 under the server name, and select New Scope:

New Scope Wizard
New Scope Wizard

Again, Microsoft has provided a wizard to help you with the configuration!

Click on Next and enter a name and description for your scope. After the name and description, you have the range of addresses you’re going to provide via DHCP and the subnet mask (You’re familiar with this because you’ve taken the Set Up TCP/IP Networks course)!

Fill in the different fields according to your needs. In general, you’ll configure the address range (the starting and ending addresses), the gateway, and the DNS server:

Address range
Address range

The next screen is for entering exclusions or delaying server responses, which is practical when several DHCP servers are on the same subnet.

Finally, set the length of the lease on the next screen.

Lease duration
Lease duration

After you’ve set your lease duration, you can stop there or continue with the wizard to configure the DHCP options.

If you carry on with the wizard, you’ll be guided through the most useful options to configure:

  • Router (default gateway) 

  • Domain name and DNS servers

  • WINS server

Finally, you’ll be able to activate the scope. 

Once you’ve activated your scope, your DHCP role is operational. After configuring or activating a scope, you’ll see more options in the manager under IPv4, including those linked to address pools, address leases, reservations, and scope options.

DHCP scope
DHCP scope

Through this, you can return to your settings, set up IP address reservations, inspect active leases, or implement a strategy for that scope.

Define Advanced Scope Settings

Before going any further, right-click on the name of your scope. You’ll have access to additional options that might be of interest:

Scope properties
Scope properties

This first tab isn’t necessarily that interesting, as they are the scope settings you just configured. However, the two other tabs are new:

  • The DNS tab lets you manage updates for DNS records every time configuration is provided. This option is practical for getting an IP<->qualified name association from your DHCP clients. Careful, though – the DHCP server may overwrite existing DNS records, which is why it might be a good idea to set up name protection.

  • The Advanced tab lets you choose whether you will only use the DHCP protocol, the BOOTP protocol, or both! Only the DHCP is used by default. However, the BOOTP enables you to provide all boot options to a client. In some instances, this can be very practical. Here, you’ll find the response delay the server can include before responding to a client requesting a configuration.

Authorize DHCP Server Streams

There’s a final stage to put in place for things to work correctly: authorize streams at the Windows firewall level. Head to Administration Tools (in the Start menu) and open Windows Firewall with Advanced Security. Create an Inbound Rule, selecting the UDP protocol on ports 67 and 68, then authorize this stream and name the rule (e.g., DHCP Server). Ta-da! You’ve just set up a Windows server with a DHCP server role. Congratulations!

Diagnose a Problem With DHCP 

Ah, diagnostics. Your server may become a bit temperamental and stop providing IP configuration from time to time. If this happens, the first thing to do is to take a look at the lease configuration:

  • Are there still leases available?

  • Were two identical configuration packages distributed?

  • Are your streams open, and is your server reachable on the network?

To look at your lease configuration, go to the Address Leases section in your DHCP Manager.

Sometimes, the problem might run a bit deeper. If so, you’ll need to bring up Event Viewer. You’ll see that a new log is available for you to analyze for more details about the issue:

New DHCP server log
New DHCP server log

Replicate Your DHCP Server

It is possible to set up two DHCP servers to provide a single scope. You would do this to guarantee high availability of the role. Create a new server with the DHCP server role and stop there (no scopes), and then right-click on your server name in the DHCP Manager under IPv4 and select Configure Failover:

Configure failover
Configure failover

Now the databases will synchronize, and the provided configuration will be followed by not just one server but by two.

Your DHCP Server Properties

If you click on IPv4 and display the properties, you’ll see that it’s possible to carry out a more advanced configuration of your role just like for your scope:

IPv4 Properties
IPv4 Properties

You have the option of automatically setting up statistics, allowing you to regularly see whether your server is responding correctly, if clients are formulating coherent requests, and your scope occupation:

DHCP server statistics
DHCP server statistics

And there you have it! Now you know almost all there is to know about the DHCP role. Play around with all of the options Microsoft offers on the subject because it would take a whole other course to go into them all.

Additional Resources

Let’s Recap!

  • The DHCP server role enables simplified configuration of clients within a network.

  • All parameters and options are accessible using a wizard that simplifies setup and startup. 

  • Microsoft allows you to increase security by replicating a server that has the DHCP server role.

In the next chapter, we’ll look at the DNS service, how it operates, and how it’s configured.

Exemple de certificat de réussite
Exemple de certificat de réussite