LKBEN10618: Howto configure a dhcp server from the command line or from a remote system


This article has not been checked!

LKB | Created: 02/04/2020 | Version: 0 | Language: EN | Rating: 0 | Outdated: False | Marked for deletion: False

Author: Wim Peeters - Keskon GmbH & Co. KG


Symptom

You need to script your dhcp server configuration

Cause

none

Solution

You can use a command line or create a cmd file and execute it accordingly.
In the following commands the DHCP server is 10.1.1.10, the Router is 10.1.1.1 and the range we want to create runs

from 100 till 200. The DNS servers are 10.1.1.2 and 10.1.1.3.


netsh Dhcp Server 10.1.1.10 add scope 10.31.0.0 255.255.255.0 "Lubby DHCP Range" "Lubby DHCP Range"
netsh Dhcp Server 10.1.1.10 Scope 10.1.1.0 set state 0
netsh Dhcp Server 10.1.1.10 Scope 10.1.1.0 Add iprange 10.1.1.100 10.1.1.200
netsh Dhcp Server 10.1.1.10 Scope 10.1.1.0 set optionvalue 51 DWORD "691200"
netsh Dhcp Server 10.1.1.10 Scope 10.1.1.0 set optionvalue 3 IPADDRESS "10.1.1.1"
netsh Dhcp Server 10.1.1.10 Scope 10.1.1.0 set optionvalue 6 IPADDRESS "10.1.1.2" "10.1.1.3"

About the Author

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!