The command to exclude an IP range is similar to setting the IP range for a particular DHCP scope. For example, the command
Netsh dhcp server
\\mydhcpserver
scope 192.168.100.0
add excluderange 192.168.100.1
192.168.100.10
would exclude any IP address from 192.168.100.1 through 192.168.100.10 from being assigned by the DHCP server named mydhcpserver. It's important to note that the exclusion range must fall within the IP inclusion range you set earlier because you're only excluding a subset of IP addresses within the IP range for that scope.
A sample command for creating a DHCP reservation is:
Netsh dhcp server
\\mydhcpserver
scope 192.168.100.0
add reservedip 192.168.100.2
00433FBB0023
printerA "test printer" BOTH
This sample command would reserve the IP address 192.168.100.2 for the node with the MAC address 00433FBB 0023. It gives the reservation the name printerA and the comment test printer. BOTH is the client type, indicating that the reservation should work for both DHCP and BOOTP client requests. . . .
In the case of NETSH for DHCP configuration, I always see one ommission regarding using this commandline tool for scripting DHCP configuration, and it can be confounding until you realize what's happening: You cannot configure remote DHCP servers with NETSH unless you have the DHCP service installed locally. In other words, if you try to use NETSH to get to the DHCP configuration commands for a remote server from an XP workstation, the DHCP subset of commands is not available. And if you are on a server without DHCP installed, the commands will also not be available.
Many admins (like myself) install all available Microsoft support tools and ResKit tools, but none of that matters (in this case) if you don't have Microsoft DHCP service installed locally.
If there's some DLL that can be registered to alleviate this, I'd love to hear about it.
-- Rob "I" --
Sr Windows Admin
WintelRobIT September 27, 2007 (Article Rating: