Symptoms
- Cisco IP Phones failed to get IP from the DHCP server.
Diagnosis
- The DHCP scope configured on the Windows server is as below for the Cisco IP Phones.
IP Range: 10.136.x.x to 10.136.x.x
Router: 10.136.y.z
DNS Servers: a.b.c.d
DNS Domain Name: XYZ.com
TFTP Server: 10.136.123.11
- The network is configured to relay the DHCP request to the above server.
- However, the phones doesn't get the IP from the DHCP server.
- Configuring the DHCP on the Cisco Router on the same site, works fine. Phones get the IP. Disabled the DHCP server on the Router after testing.
- Moving the phones to default VLAN (where computers are connected), phones get the IP from the Windows DHCP server.
- Issue only with the scope configured for the phones (the above said scope) on the Windows Server.
- Moved the phone back to voice vlan.
- Did the packet captures on the DHCP server.
- Packet shows the DHCP server offering the IP with the below TFTP details:
![TFTP Error.PNG TFTP Error.PNG](https://community.cisco.com/t5/image/serverpage/image-id/34624i2F30A65B0191F197/image-size/large?v=v2&px=999)
- The TFTP IP address configured on the server is 10.136.123.11. But the captures shows 3 different TFTP IP's:
Option: (150) TFTP Server Address
Length: 14
TFTP Server Address: 49.48.46.49
TFTP Server Address: 51.54.46.49
TFTP Server Address: 50.51.46.49
[Expert Info (Error/Protocol): Option length isn't a multiple of 4]
[Option length isn't a multiple of 4]
[Severity level: Error]
[Group: Protocol]
- The TFTP IP configured is taken as ASCII Character and the server converts it into Decimal. So, the converted Decimal values are seen in the captures.
![ASCII to Decimal.png ASCII to Decimal.png](https://community.cisco.com/t5/image/serverpage/image-id/34626i56C0AF45DC74D1DE/image-size/large?v=v2&px=999)
- The above Decimal is split into 3 different IP's - 49.48.46.49, 51.54.46.49, 50.51.46.49 and then 49.
- The above format doesn't match the option length which should be multiple of 4. So, we see the error "Option length isn't a multiple of 4".
Please see the below link for the option length calculation: (search for the "option lenght isn't a multiple of 4")
https://github.com/wireshark/wireshark/blob/master/epan/dissectors/packet-dhcp.c
- Phones rejected with the error DHCP: ERROR parsing options -- cnt = -1, tag = 49, len = 0
- The TFTP option input value might be either configured to accept different Data Type like text or word or url instead of IP Address and then convert to decimal like above case or the TFTP option would have corrupted in the DHCP server.
Solution
- Delete the TFTP Predefined value from the Microsoft Windows DHCP server.
- DHCP Server > IPv4 > Right Click > Set Predefined Value > Search for Option "150 TFTP Server" under Option name Drop down > Delete.
![Set Predefined Option_1.PNG Set Predefined Option_1.PNG](https://community.cisco.com/t5/image/serverpage/image-id/34742i72D0B769F8B466A9/image-size/large?v=v2&px=999)
![Delete TFTP Option.PNG Delete TFTP Option.PNG](https://community.cisco.com/t5/image/serverpage/image-id/34629i59FC2647916CF929/image-size/large?v=v2&px=999)
- To Add the the value, go to the same page and Click on "Add".
- Add the Option Type with the name as "TFTP Server", Data Type as "IP Address" and the code as "150".
![Add New Option type for TFTP.png Add New Option type for TFTP.png](https://community.cisco.com/t5/image/serverpage/image-id/34630i6FFA46DE3FCD3780/image-size/large?v=v2&px=999)
- Now, configure the TFTP option for the Voice Scope. Goto DHCP Server > Scope configured for Phones > Scope Option > Right Click > Configure Options > Scroll Down to select "150 TFTP Server" added above and add the IP address > Apply > Ok.
![Adding TFTP Confiugre options.PNG Adding TFTP Confiugre options.PNG](https://community.cisco.com/t5/image/serverpage/image-id/34631i7E8096C89C1A9704/image-size/large?v=v2&px=999)
- Reset the phone from the CUCM or Power cycle to send out the DHCP request.
- Now the phones get the correct IP address with the option 150. The packet capture shows the correct TFTP IP.
![Correct TFTP IP in capture.PNG Correct TFTP IP in capture.PNG](https://community.cisco.com/t5/image/serverpage/image-id/34633iB9A828AA36603372/image-size/large?v=v2&px=999)