Data convertion and pre-defined variables for Dhcp site.

CpServiceSPb cpservicespb at
Sun Jun 9 18:16:10 CEST 2019

>* I try to set up Dhcp Option 120 - freeradius
DHCP-SIP-Servers-DHCP-Option *

>* and Dhcp Option 43 - DHCP-Vendor using unlang, both are octet type.
*>* But is still faulted.
>  What does that mean?

That is:
switch "%{string:&DHCP-Vendor-Class-Identifier}" {
        case "sip Phone ID" {
              update reply {
                     &DHCP-TFTP-Server-Name =
"tftp://%{listen:src_ipaddr}" - works fine
                     &DHCP-Vendor =
"http://user:pass@%{listen:src_ipaddr}/pbx" - I made it working a few
time ago - works fine
                     &DHCP-SIP-Servers-DHCP-Option =
"*1***" - does not work

First value means - order of servers, second - IP of specified address.

Dhcpdump shows:

OPTION: 120 ( 12) SIP Servers DHCP Option *3131302e31302e302e323534*

Sip phone doesn' t accept these setting.

The right settings phone accepts is: *01c0a800fe*
But I can' t get such result.

I specified this option at isc-dhcp-server simply
*option sip-pbx-servers 1;*

Regarding pre-defined or constant variables: I used successfully
%{listen:src_ipaddr} in places where string type is acceptable.
It is very convenient for particular for me, to specify the same
repeating value for all necessary attributes and it will not be
necessary to change it for each of
many attributes when IP of dhcp is changed.

And I would use it variable for ipaddr attributes also but I don' t
know how to convert string variable to ipaddr, to get working:
&DHCP-Domain-Name-Server += %{ipaddr:%{listen:src_ipaddr}} instead of
&DHCP-Domain-Name-Server +=

More information about the Freeradius-Users mailing list