Description

This article explains how to configure the DHCP sub-option 43.

Symptoms

SRX/J-series device support generic options and values in Junos. It is possible to generate nearly any DHCP reply. Sub-options are just a way to interpret the option 43 value.

Understand exactly which raw data is expected from the device on the client side and then fill it manually using statement "option 43 byte-stream".

Example:

The following are the sub-options required by client from SRX:

Option 43: with sub otions

Option Number Option Name ASCII Value
001 UCIdentifier MS-UC-Client
002 URLScheme https
003 WebServerFQDN Ebdc1ucpool1.dimensions-uk.org
004 WebServerPort 443
005 CertProvRelPath /CertProv/CertProvisioningService.svc

Solution


For each sub-option we need to build a byte-stream in the following format:
<id> <length> <value>
where:
id - sub-option ID (1 byte)
length - length of the value in chars (1 byte)
value - the actual value (converted from ASCII to byte-array)

So, in our example:

Let's take the first sub-option:

id = 01
length = 12
(we just count the letters in the value)
value = MS-UC-Client
(as we said, 12 letters here)         <<<<<<<<< convert this into byte-array

Using a byte-array ASCII-Hex-Unicode-Base64 converter for the following.

Just choose "Convert ASCII text into Unicode/Decimal", put " " (space) as a delimeter and remove "Padded" checkbox. Now you can paste your values one by one and translate them -
make sure you don't leave any extra spaces, newlines etc.

For our text "MS-UC-Client" we get the following byte-stream: 77 83 45 85 67 45 67 108 105 101 110 116 (12 numbers, one per letter, as expected).
So now we have our first suboption:
01 12 77 83 45 85 67 45 67 108 105 101 110 116

Same needs to be done for all other sub-options:

( id = 02, length = 5, value = https ) gives us: 02 05 104 116 116 112 115
( id = 03, length = 30, value = Ebdc1ucpool1.dimensions-uk.org ) gives us:
03 30 69 98 100 99 49 117 99 112 111 111 108 49 46 100 105 109 101 110 115 105 111 110 115 45 117 107 46 111 114 103

( id = 04, length = 3, value = 443 ) gives us: 04 03 52 52 51
( id = 05, length = 37, value = /CertProv/CertProvisioningService.svc ) gives us:
05 37 47 67 101 114 116 80 114 111 118 47 67 101 114 116 80 114 111 118 105 115 105 111 110 105 110 103 83 101 114 118 105 99 101 46 115 118 99

Concatenating this into one long byte-stream:
01 12 77 83 45 85 67 45 67 108 105 101 110 116 02 05 104 116 116 112 115 03 30 69 98 100 99 49 117 99 112 111 111 108 49 46 100 105 109 101 110 115 105 111 110 115 45 117 107 46 111 114 103 04 03 52 52 51 05 37 47 67 101 114 116 80 114 111 118 47 67 101 114 116 80 114 111 118 105 115 105 111 110 105 110 103 83 101 114 118 105 99 101 46 115 118 99

Finally configure the option as follows (again, all in one line):
# set system services dhcp pool 10.101.1.1/22 option 43 byte-stream "01 12 77 83 45 85 67 45 67 108 105 101 110 116 02 05 104 116 116 112 115 03 30 69 98 100 99 49 117 99 112 111 111 108 49 46 100 105 109 101 110 115 105 111 110 115 45 117 107 46 111 114 103 04 03 52 52 51 05 37 47 67 101 114 116 80 114 111 118 47 67 101 114 116 80 114 111 118 105 115 105 111 110 105 110 103 83 101 114 118 105 99 101 46 115 118 99"

You can refer to the following ASCII conversion table for conversion:

http://www.asciitable.com

Related Information