I believe many of my friends are familiar with the command line. How can I configure DHCP using the command line? I don't know if this method is always used. Let's take a closer look.
In some settings, we can skip this step. Here we will explain how to use the command line to set DHCP. A windows 2000 server is installed in a single-host environment. Let's configure a dhcp server using the command line.
1. First enter the command line dhcp Configuration Mode
- F: \> netsh
- Netsh> dhcp
- Dhcp> server 192.168.0.1 // 192.168.0.1 is the address of the DHCP server you want to manage
- Dhcp server>
2,
- dhcp server>show scope
Total number of scopes: 0
The command is successfully completed. Check the scope configuration on the target. At this time, there is no scope.
3. Use the command line to add a scope
- dhcp server>add scope 192.168.0.0 255.255.255.0 192.168.0.0 MyComment
Okay, let's check dhcp in mmc and see what changes have taken place. Let's look at the large blue exclamation point scope. We didn't worry about any configuration in it. Let's continue, I am just panicking for a long time, a waste of time)
4,
- dhcp server>scope 192.168.0.1
Change the context of the current scope to the 192.168.0.1 scope.
5,
- dhcp server scope>add iprange 192.168.0.2 192.168.0.254 DHCP
Use the command line to add an allocated address range
6,
- dhcp server scope>add excluderange 192.168.0.1 192.168.0.1
-
- dhcp server scope>add excluderange 192.168.0.241 192.168.0.254
Add two exclusion ranges: 192.168.0.1, 192.168.0.241-192.168.0.254
7,
- dhcp server scope>add reservedip 192.168.0.240 08002b30369B Mr.Wu Mr.wu both
Add a retained ip address for MAC 08002b30824b. The retained ip address is called Mr. Wu.
8,
- dhcp server scope>set optionvalue 003 ipaddress 192.168.0.1
-
- dhcp server scope>set optionvalue 006 ipaddress 192.168.0.1
Add two scope options 003 and 006 to this scope.
9. dhcp server scope> set reservedoptionvalue 192.168.0.240 003 ipaddress 192.168.0.1
Set the range option 003 for the reserved address 192.168.0.240
Now the configuration of scope 192.168.0.0 is complete. You can configure other selected projects as needed.
In mmc, refresh scope 192.168.0.0. Everything is normal.
10. Configure two scope 192.168.1.0 and 192.168.2.0 in the same way.
11. Use the command line to configure superscope
- F:\>netsh
- netsh>dhcp
- dhcp>server 192.168.0.1
- dhcp server>scopt 192.168.0.0
- dhcp server scope>set superscope 192.168.0-192.168.2 1
-
- F:\>netsh
- netsh>dhcp
- dhcp>server 192.168.0.1
- dhcp server>scopt 192.168.1.0
- dhcp server scope>set superscope 192.168.0-192.168.2 1
Refresh the DHCP server and see what else is there.
12. Add a class
- Dhcp server> add class workgroup1 workgroup1 ClassForWorkgroup1 0 so that a user class is added.
13. Add and configure multicast Scope
- dhcp server>add mscope 224.0.0.0 mscope 40
- dhcp server>mscope 224.0.0.0
- dhcp server mscope>add iprange 224.0.0.1 224.0.0.10
- dhcp server mscope>add excluderange 224.0.0.1 224.0.0.1
14. dump Problems
- netsh dhcp server 192.168.0.1 dump >>e:\101.txt