Recipe 14.8. Configuring Scope OptionsProblemYou want to configure scope options. While you want to configure as many options as possible at the server level, some options that are specific to a scope need to be configured within the scope. An example of this is the default router option (code 3) when you have multiple subnets and only one DHCP Server. SolutionUsing a graphical user interface
Using a command-line interfaceThe following command configures a scope option: > netsh dhcp server \\<ServerName> scope <SubnetID> set optionvalue <OptCode> <DataType> <OptValue> In this example, the "default router" option (code 3) is configured with a value of 192.168.10.1: > netsh dhcp server \\dhcp01 scope 192.168.10.0 set optionvalue 3 IPADDRESS 192.168.10.1 You can view all of the scope options for a scope with this command: > netsh dhcp server \\<ServerName> scope <SubnetID> show optionvalue Using VBScriptSee the Introduction for more information on how to run the netsh command from within a script. DiscussionWhen a DHCP Server responds to a client request for a lease, the server also responds with any configured options for the scope. Options are nothing more than bits of configuration information, such as the servers to use for name resolution, the default domain name, default router, etc. Some options may be specific to a particular scope (for example, the default router for a subnet) or may be more global (such as the default domain name). The former are called scope options and the latter are called server options. I covered server options in Recipe 14.3. See AlsoRecipe 14.3 |