Configuring DHCP SCOPE Using GUI (Windows Server 2008 r2) & Windows Powershell (Windows Server 2012 r2)
Configuring DHCP SCOPE Using GUI (Windows Server 2008 r2) & Windows Powershell (Windows Server 2012 r2)
Before we could discuss about DHCP Scope, first let’s find out what is DHCP and SCOPE
What is DHCP?
Dynamic Host Configuration Protocol (DHCP) is a network protocol that enables a server to automatically assign an IP address to a computer
DHCP Scope
DHCP assigning an IP address to a computer from a defined range of numbers (i.e., a scope) configured for a given network is called DHCP Scope.
Benefits of DHCP
In Windows Server 2003, the DHCP Server service provides the following benefits:
- Reliable IP address configuration. DHCP minimizes configuration errors caused by manual IP address configuration, such as typographical errors, or address conflicts caused by the assignment of an IP address to more than one computer at the same time.
- Reduced network administration. DHCP includes the following features to reduce network administration:
- Centralized and automated TCP/IP configuration.
- The ability to define TCP/IP configurations from a central location.
- The ability to assign a full range of additional TCP/IP configuration values by means of DHCP options.
- The efficient handling of IP address changes for clients that must be updated frequently, such as those for portable computers that move to different locations on a wireless network.
- The forwarding of initial DHCP messages by using a DHCP relay agent, thus eliminating the need to have a DHCP server on every subnet.
Configuring DHCP SCOPE Using GUI (Windows Server 2008 r2)
Prerequisites:
- Make sure that you have already installed Windows Server 2008 r2 and configured with a static IP address.
- You will need to know your network’s IP address range.
- The range of IP addresses you will want to provide to your clients machines.
- Your DNS server IP addresses, and your default gateway.
- Additionally, you will want to have a plan for all subnets involved.
What scopes you will want to define, and what exclusions you will want to create.
Configuration:
Open the Server Manager:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp1.png?w=300
Click Add Roles, you can see the New Box opened as shown below:
Select “DHCP Server” and click Next.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp2.png?w=300
Click Next.
Note: Make sure that this PC should have Static IP address assigned otherwise, it will popup with “Warning Message”.
As we are configuring DHCP SCOPE, here it shows my network connection binding and we need to verify it, as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp3.png?w=300
When click Next, we have to provide the details like Parent Domain, Primary DNS Server, and Alternate DNS Server (as you see below) and click Next.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp4.png?w=300
When you click Next, you will be asked to Specify WINS Server.
Here I have Selected not to go WINS Server as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp5.png?w=300
Click Next.
Now it’s time to add the IP Address range to configure the SCOPE.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp6.png?w=300
Click Add to provide the IP Address range.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp7.png?w=300
Please provide the SCOPE Name, Starting IP Address , Ending IP Address, Subnet mask & Default gateway.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp8.png?w=300
Click OK.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp9.png?w=300
Click Next. And now here we have to decide if we want to “Enable or Disable IPV6″
In my Scenario I have selected to Disable this option as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp10.png?w=300
Now it time for Authorization.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp11.png?w=300
Click Next, you can find the Summary info as shown below:
Click Install.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp12.png?w=300
Great the Install was Successful as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp13.png?w=300
Now let’s see how to Manage DHCP SCOPE
Managing your Windows Server 2008 DHCP Server
Click Start -> Administrative Tools -> DHCP
Open the MMC (DHCP) as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp14.png?w=300
Let’s begin Step by Step
Expand Scope, you can find
1: Address Pool
2: Address Leases
1: Address Pool
http://www.techrid.com/wp-content/uploads/2014/10/dhcp15.png?w=300
2: Address Leases
http://www.techrid.com/wp-content/uploads/2014/10/dhcp16.png?w=300
Now Select Scope Options and check if everything is configured properly.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp17.png?w=300
Now let’s discuss about Filters.
In Filters we have to options
1: Allow
2: Deny
http://www.techrid.com/wp-content/uploads/2014/10/dhcp18.png?w=300
Oops it’s showing Error message on both the Tabs “Allow and Deny”.
No problem, Right Click on Allow Tab and click Enable and same thing task to Deny Tab as well output without error on the Tabs as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp19.png?w=300
Once you Enable you can see the change and shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp20.png?w=300
Configuration of both these two Tabs you can see after configuration of DHCP Scope on Windows Server 2012 r2 using Power Shell.
Allow : Clients who want to avail the DHCP Services.
Deny : Client who don’t want to avail the DHCP Services.
Adding the users is pretty simple Right click on Allow Tab and click on Filter and Add the MAC Addresses.
Great by this we have configure the DHCP Scope in Windows Server 2008 r2.
Part II
Configuring DHCP SCOPE Using Windows Powershell (Windows Server 2012 r2)
Configuration:
Open Windows Power Shell as “Run as Administrator”
Before we begin let’s install the feature using the command
Install-WindowsFeature -Name:DHCP
http://www.techrid.com/wp-content/uploads/2014/10/dhcp21.png?w=300
We can see the Output below
http://www.techrid.com/wp-content/uploads/2014/10/dhcp22.png?w=300
If you want to Install DHCP RSAT, you can run the following command.
Install-WindowsFeature –Name RSAT-DHCP
Now the next step is to Bind the DHCP server to a network interface where it can listen for the client requests and lease out IP addresses.
This network interface should be configured with a static IPv4 or IPv6 address. The following PowerShell command would bind the DHCP server to the network interface.
Let run the below command
Add-DhcpServerv4Scope -Name ” Scope Name” -StartRange 10.x.x.x -EndRange 10.x.x.x -SubnetMask 255.0.0.0
Here it will prompt for Scope ID which is nothing but IP address for the mentioned Scope
http://www.techrid.com/wp-content/uploads/2014/10/dhcp23.png?w=300
Now we have to confirm and check if the above command was successful.
To check run the command ” Get-DHCPServerv4Statistics”
http://www.techrid.com/wp-content/uploads/2014/10/dhcp24.png?w=300
Great the output is clear.
Now Open DHCP MMC
Click Start
http://www.techrid.com/wp-content/uploads/2014/10/dhcp25.png?w=300
Click Administrative Tools -> DHCP
http://www.techrid.com/wp-content/uploads/2014/10/dhcp26.png?w=300
Here we might see Error on IPV4 & IPV6, not to worry we just need to Authorize.
Right click on “dhcp.dc2.com” and select Authorize Tab to go green which indicates that we have traced out the error, on Tabs IPV4 & IPV6 as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp27.png?w=300
Now let’s see how to Manage DHCP, we have already discussed about the options while configuring DHCP on Windows Server 2008 r2.
So let’s jump into the Tabs “Allow and Deny”
Allow and Deny are the Executions for the Client Machine to Connect.
For the Client that we want to avail the dhcp services.
Right click on Allow and Add New Filter, and provide the MAC Address and Description as shown below:
http://www.techrid.com/wp-content/uploads/2014/10/dhcp28.png?w=300
For the Deny please provide the MAC Address where the clients DO Not Want to Avail the DHCP Services.
Oops the Tab “Allow & Deny” indicates that those two are not configured in right way http://www.techrid.com/wp-includes/images/smilies/icon_sad.gif
Nothing to worry, please right click on Allow Tab and click Enable and same applies to Deny as well.
Now the Tab high lighted below New Tab is to add the MAC addresses to Allow or Deny the Accounts.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp29.png?w=300
Now you can see for one of the Client Allow Execution has been added, and both the options has been “Enabled” so the Red Mark on the Tabs has been traced out.
http://www.techrid.com/wp-content/uploads/2014/10/dhcp30.png?w=300
One more thing here in Windows Server 2012 r2 we can specify if we require the time to Enable this DHCP Services.
Also we can mention time as Unlimited (bases on your requirement)
http://www.techrid.com/wp-content/uploads/2014/10/dhcp31.png?w=266
Note: If you have MAC Addresses on Excel and if you wish to add all at a time the please find the command mentioned below:
List,MacAddress,Description
Allow, <MAC ADDRESS>, Filter for ClientPC1
Allow, <MAC ADDRESS>, Filter for ClientPC2
Allow, <MAC ADDRESS>, Filter for ClientPC3
Deny, <MAC ADDRESS>, Filter for ClientPC4
The following command adds all these filters to the local DHCP Server.
Import-Csv Filter.csv | Add-DhcpServerv4Filter -Force
Great by this we have learned configuring DHCP SCOPE on Both Windows Server 2008 r2 & 2012r2.
For More Info : http://technet.microsoft.com/en-us/library/cc756865%28v=ws.10%29.aspx
Praveen Kumar