Thursday, January 2, 2014

DHCP options for SIP server and SIP port

In a recent deployment of a VOIP system (NEC sv8100) I wanted to setup DHCP to hand out the SIP options.

This is pretty simple although some of the references I looked at made it look confusing.
For the system I was working on only two options are necessary, SIP Server IP address and SIP server port (if different than the default).

  1. Open up DHCP, right click IPv4 and choose "Set Predefined Options"
  2. Note that "option name" for 120 doesn't exist (unless added previously).  Click "Add"
  3. Put in a name of SIP Server IP Address, Data type should be binary, code equals 120, and a description as you see fit.
  4. Click OK
  5. Go to your server options (or scope options depending on what you want). 
  6. Click "Configure options"
  7. Check mark option 043 Vendor Specific Info
    1. This option specifies the port to use
    2. enter the HEX value under the binary section with A8 02 appended to the front. For instance for port 5080 it would look like A8 02 13 D8
      1. A8 = 168 sub option
      2. 02 = required first byte
      3. 13 D8 = 5080 in HEX
      4. if you wanted port 5060 it would be A8 02  13 C4
  8. Check mark option 120 SIP Server IP Address
    1. Here you enter the SIP server IP address in HEX format with a 01 appended to the front.
    2. Then the ip, so 192.168.1.2 would be C0 A8 01 02.
    3. Put the 01 in front and get 01 C0 A8 01 02
    4. 01 = indicates that it's the first sip server
    5. C0 = 192
    6. A8 = 168
    7. 01 = 1
    8. 02 = 2
    9. Put the hex value in the binary section.  (note, the ASCII will look like nonsense)
Your all set.  Bounce your phone so it gets DHCP from your server and ensure it finds the SIP server.  If you get an error "SIP Server not found" then you either have the IP address incorrect or the SIP Server port incorrect. 

Note: troubleshooting DHCP is very easy with wireshark, just filter for the Bootp.  This way you can see what options it's handing out.  There is also a handy tool out there called DHCPtest
http://blog.thecybershadow.net/2013/01/10/dhcp-test-client/

8 comments:

  1. Thank you, thank you, thank you! :)

    ReplyDelete
  2. Found this trying to configure SV9100 but should also work for SV8100 and Sonicwall. Options are correct for 120 Sip Server (01) = 1st Sip Server and Option 42 Vendor (A802) for port number. Here are the Option codes to convert this to HEX options on the Sonicwall: Option Object 1: Option Number 43: Option Array checked, One Byte Data, Option Value: 0xA8;0x02;0x13;0xD8 (Equals decimal: 5080) Option Object 2: Option Number 120: Option Array checked, One Byte Data, Option Value: 0x01;0xC0;0xA8;0x01;0x02 (Equals decimal: 1 192 168 1 2) - then add both to an option group and assign that to the DHCP scope under advanced, also check Send Generic Options Always. Also if you need a different IP just do a Google search for IP address to HEX. Thanks!

    ReplyDelete
  3. Awesome... Thank you!
    Also, great app for Android is CIDR Calculator(by Randy McEion). I use it all the time for subnetting, but thought I remembered seeing a converter built in... worked like a charm... same as your succinct write-up.
    Thanks again!

    ReplyDelete
  4. How to add second server sip on DHCP options?

    ReplyDelete
    Replies
    1. Option 120 specifies Server, the first pad in Aaron's example specifies server 1. So to specify a 2nd server add an additional DHCP option 120 with a 02 at the beginning

      43 A8 02 13 D8
      120 01 C0 A8 01 02
      120 02 C0 A8 01 03

      Delete
  5. Thank you!

    Managed to use this to configure NEC DT800 series phones on a Huawei S5720, enough to say that the documentation from NEC is absolute crap (they still use Windows2003 instructions).

    ReplyDelete