en:dpi:dpi_options:brass:opt_bras:reference_bras:attribute_dhcp:start [Документация VAS Experts]

This is an old revision of the document!


2 VSA attributes for DHCP options

Starting with the VAS Experts DPI version 7.4 the following VSA attributes (vendor-id=43823) are defined in Access-Accept in order to specify almost any DHCP option:

 ATTRIBUTE VasExperts-DHCP-Option-IP 45 string # IPv4 option: "opt:192.168.6.90", for example: "42:192.168.6.90"
 ATTRIBUTE VasExperts-DHCP-Option-Num 46 string # Numeric option: "opt:1500", for example: "58:3600"
 ATTRIBUTE VasExperts-DHCP-Option-String 47 string # String option: "opt:text", for example: "56:Hello from DHCP!"
 ATTRIBUTE VasExperts-DHCP-Option-Bin 48 string # Binary option in hex form: "opt:xxxxxxxx", for example: "58:100E"

All these attributes are of a string type and abide by the following single format:

"DHCP_option_number:string_as_a_value"

A complete list of all possible DHCP options can be found on the iana.org website.

File and SName BOOTP fields are also supported to specify using VSA attributes:

ATTRIBUTE VasExperts-BOOTP-SName 43 string # BOOTP SName
ATTRIBUTE VasExperts-BOOTP-File 44 string # BOOTP File
VasExperts-DHCP-Option-IP

The attribute is used to specify the IP address. For example, DHCP opt42 (NTP Server Addresses) is specified as:

&VasExperts-DHCP-Option-IP += "42:213.108.248.178"

Many DHCP options may contain not one, but a list of IP addresses, typically in order of preference. The list of IP addresses for one option is specified by a set of RADIUS attributes, that is, each attribute contains one IP address, for example:

&VasExperts-DHCP-Option-IP += "42:213.108.248.178"
&VasExperts-DHCP-Option-IP += "42:148.251.68.100"

It specifies the list of NTP servers (opt42) with value of "213.108.248.178, 148.251.68.100". The order in which attributes are listed within a single option specifies the order in the list.

VasExperts-DHCP-Option-Num

The attribute is used to set numeric DHCP options. Int32, int16 and int8 options are supported. The VAS Experts DPI controls the option type and if integer overflow occurs it will prevent to set such an option and will log to the fastpcrf log file. Examples:

# opt35 (int32) - ARP Cache Timeout = 600 seconds
&VasExperts-DHCP-Option-Num += "35:600"
# opt22 (int16) - Max Datagram Reassembly Size
&VasExperts-DHCP-Option-Num += "22:16000"
# opt23 (int8) - Default IP Time to Live
&VasExperts-DHCP-Option-Num += "23:64"
# if you try to set such a value for opt23 the VAS experts DPI will log: int8 overflow
&VasExperts-DHCP-Option-Num += "23:1024"
# opt19 (bool - 0 или 1) - Enable/Disable IP Forwarding
&VasExperts-DHCP-Option-Num += "19:1"
VasExperts-DHCP-Option-String

The attribute is used to specify DHCP string options. Example:

# opt15 - DNS domain name of the client
&VasExperts-DHCP-Option-String += "15:example.com"
VasExperts-DHCP-Option-Bin

The attribute is used to specify the option value using hex string. It is used for DHCP options that do not fall into any of the above categories. Typically, the vendor-specific DHCP options are defined such a way. Each byte of the option value is specified by the two hex digits, so the length of the hex string should be even. When specifying values, one should take into account that all numerical values should be specified using network byte order. Example:

# Specifying the 10.11.12.13 IP address as a hex string
&VasExperts-DHCP-Option-Bin += "7:0a0b0c0d"
# Specifying the bool option as a hex string
&VasExperts-DHCP-Option-Bin += "19:01"
# Specifying an int16-option as a hex string (number 16000)
&VasExperts-DHCP-Option-Bin += "22:3e80"
# Specifying an int32 option as a hex string (number 600)
&VasExperts-DHCP-Option-Bin += "35:00000258"