0

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 10.0.17.45 set optionvalue 249 IPADDRESS 10.0.0.0 255.0.0.0 10.0.16.1

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

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: 10.1.1.0/24 accessible via 10.1.1.1 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.

1
  • 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.