How to work with user classes on Windows – Guide
When it comes to choosing a network’s distribution of IP addresses, there are pros and cons to each approach. Automatic allocation means that the network can manage its own address space, but it can also lead to congestion and instability. Manual allocation, on the other hand, is more reliable but can be time-consuming. In most cases, a combination of the two is the best option. ..
Dynamic Host Configuration Protocol (DHCP) is a service that allows computers on a network to be assigned specific IP addresses. You can use DHCP to assign IP addresses to computers on your network, or you can use user classes to specify a range of IP addresses and specific DHCP options. To use DHCP on a Windows DCHP Server, you first need to create user classes. User classes are like templates that you can use to create different types of DHCP clients. You can also use user classes to specify a range of IP addresses and specific DHCP options. To create a user class, open the New User Class dialog box and select the type of client you want to create. For this example, we will create a Windows DCHP Client class. After creating the user class, you will need to provide some information about it. In this example, we will provide only basic information about our client class. In the Name field, enter Windows DCHP Client . In the Type field, enter Client . In the Comments field, enter This is my client class name . In the Addresses field, enter The following address range: 192.168.1-192.168.254 . In the Options field, enter dhcp-option 1:1 . Click OK to finish creating your new user class. Now that we have created our new Windows DCHP Client class, we can start using it in our applications! To do this, we first need to add it as an instance variable in our application code. We do this by opening up our application and adding an instance variable called “Windows_DCHPClient” into its scope within the constructor function of our application object: public void MyApplication() { // Add an instance variable for Windows_DCHPClient } Now that we have added our new instance variable for Windows_DCHPClient into our application code, we can start using it! We
DHCP is a protocol that allows devices on a network to automatically get IP addresses. This makes it easier for people to connect to the network, as well as preventing devices from having to ask for IP addresses individually.
NaaS is the future, but it has challenges
A DHCP function can be performed by different types of hardware, but it need not be just one of them. A common DHCP configuration I use is running the service on a security device to host IP address ranges grouped together as a subnet for dynamic distribution – scopes – that only need Internet access, such as guest or IoT networks. I then run a separate DHCP server to handle devices and scopes within the domain that access internal resources.
DHCP is a simple and efficient way to assign IP addresses to devices on a network. It is easy to use, and most organizations have at least one DHCP server on the network that can provide addresses from at least one scope.
Microsoft’s DHCP server is a very simple to use DHCP server that can handle a lot of scopes. It also has a GUI for configuration and management. It also supports subsets of scopes, called classes, to help organize addresses by users and devices in a logical way. User and Vendor classes allow you to assign DHCP options to groups of clients, specifying policies that will apply to some users or devices, but not everyone in the same scope. In-scope classes can be useful if you want to separate a group of devices into a segment of a scope while maintaining dynamic hosting. For example, I recently used user classes to assign addresses of a specific scope to SD-WAN users working remotely. Because the network between the DHCP server and the proxy server it defines up VPN links to clients were virtual, I used user classes to distinguish SD-WAN clients from native clients.
DHCP User Classes and Vendor Classes are identifiers that use at least 1 octet in the IP address request sent from the DHCP client to the DHCP server. Its purpose is to define policy criteria such as tags that denote the class, vendor-specific information or to specify DHCP servers. When using user or vendor classes with DHCP policies, you can specify device types and organize from which range they receive IP addresses for a given scope. There are several ways to use DHCP policies, but I’ll show you how to use user classes on a Windows DCHP Server to specify a range and assign range-specific DHCP options to that class.
How to implement user classes
To connect to a DHCP server in your domain, you first need to install the DHCP Server role on your Windows 2012 server or later. After the role is installed, you can use the DHCP console to connect to the server. If your DHCP server is not a Windows 2012 server or later, you can still use user classes to implement network configuration. However, you will need to use a different method for connecting to the DHCP server. ..
In the User Classes dialog box, click the Add button and then select Class A, B, or C from the drop-down menu. After selecting a class, type a name for the user class in the Name text box and then click OK. Next, in the DHCPv4 Properties dialog box, under IPv4 Address Allocation tab, type an address for each of your users in the IPv4 Address text boxes. Finally, under DHCPv4 Options tab, type any desired DHCP options for your users in the Option text boxes. ..
In the “DHCP User Classes” dialog, you will see the existing user classes by name and description. To add a new one, just click “Add…”.
To add a new class to your organization, you will need to enter the display name, description and ASCII name of the class. The display name and description are just for your own organization, but having them describe what you’re trying to use the class for can help make it easier to identify them later. ..
The ASCII field is the important area that will act as the real “tag” for packets arriving at the DHCP server. For this field do not use spaces between the words and be sure to be case sensitive as it is case sensitive. I had mixed success with special characters. Some, like hyphens or underscores, work and some, like pound signs, don’t. I haven’t seen restrictions on the use of characters in Microsoft documentation, so keep this in mind. Be sure to write down what you put in there for later and click “OK” when done. The “Binary” field to the left of the ASCII field will be filled in automatically as you fill in the ASCII name.
Once your new user class has been added, close this dialog to exit it.
In the New Policy dialog box, type a name for your policy (e.g. “Default Domain Policy”), select the “User Classes” tab, and then click on the “Add” button. In the Add User Class dialog box, type a name for your new user class (e.g. “Domain Users”), select the appropriate radio button(s) in the “Type of user account” column, and then click on the “OK” button. In the User Classes Policy dialog box, under the heading “Scope of this policy:”, click on the drop-down menu and select your scope (e.g. “The entire domain”). Underneath that heading, in the “Action” column, click on the drop-down menu and select one of three options: “Allow”, “Deny”, or “Allow with Conditions”. In this example we will choose “Allow”. In this example we will choose “Allow”. Underneath that heading, in the “Action” column, click on the drop-down menu and select one of three options: “Allow”, “Deny”, or “Allow with Conditions”. In this example we will choose “Allow with Conditions”. Click on OK to apply your new policy to your scope. ..
The Policy Name: Policy for the Protection of Children from Sexual Abuse Description: This policy applies to all adults who work with or are associated with children. It requires that all adults take reasonable steps to protect children from sexual abuse, and that they report any suspected abuse to law enforcement or child protective services.
In the “Condition” field, type “IPv4Address=192.168.1.1” and click “OK”. ..
To add a new condition to an order, in the “Add / Edit Condition” dialog, use the drop-down menu to change the “Criteria:” field from Supplier Class to User Class. ..
In this example, I have created a new user class called “User” and changed the “Value:” field to be of type “int”.
Please enter your name.
The Setup Wizard will now ask you to provide some basic information about your computer. Click “Next” to continue. The Setup Wizard will now ask you to provide some basic information about your printer. Click “Next” to continue.
You can choose to use the default range or to specify a range for devices. After you make your selection, the wizard will display the percentage of the available scope you are reserving for this policy. ..
On the next screen of the wizard, you can configure unique settings for the policy by selecting the “Vendor Class” drop-down item. This will allow you to choose from a variety of vendor-specific DHCP options, such as “Default DHCP Options”, “Microsoft Options”, etc. ..
Now, you will be asked to choose a file type. You can choose to save your project in a variety of formats, including PDF, DOCX, and JPEG. Click “Next” to continue. ..
The wizard presents you with a summary of your selections. If they are correct, click “Finish” to close the dialog box.
To apply the user class to the network interface, open a command prompt as an administrator and type “ipconfig”.
To set the user class type “ipconfig / setclassid ethernet” testuserclass “Ethernet”
If you rebooted and ran ipconfig again from an administrative console, you should see that the policy has been applied to your system. In my case, I was assigned an IP address from the range defined by the policy. ..
Final note
This guide will show you how to work with user classes in Windows. If you have any questions about this article, feel free to ask us. Additionally, please share this article with your friends if you enjoyed it! ..