I want to add netsh command to set Classless Static Route 249 in DHCP Scope, I use this command but it gave me an erorr, I am using windows server 2003 R2

netsh dhcp server \SRVDC01 scope set optionvalue 249 IPADDRESS

  • 2
    It would help if we knew what error. – Chris S Dec 1 '10 at 19:49

I suspect the errors you're seeing are:

Option data type supplied is not valid for the Option.

DHCP Server Set OptionValue failed.

Parameter(s) passed are either incomplete or invalid.

You're seeing these because option 249 must be specified as as BINARY value, not as an IPADDRESS value.

If you can't set this with the GUI then you'll have to convert your desired route into a hexadecimal string yourself. An example would be as follows: accessible via converts into "180a01010a010101". The first octet, "18", is the number of bits of subnet mask (0x18 = 24 decimal). The next octets are the network ID (0a = 10, 01 = 1, 01 = 1, for "10.1.1"), padded by zeros on the right if the subnet mask doesn't end on an even octet boundary. The last four octets are the IP address of the gateway.

Set the value in the GUI and you'll be happier.

  • Thanks, exactly, but somehow different to set 200 DHCP scope :-) – user19049 Dec 3 '10 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.