Data convertion and pre-defined variables for Dhcp site.
CpServiceSPb
cpservicespb at gmail.com
Sun Jun 9 19:48:06 CEST 2019
> Because DHCP-SIP-Servers-DHCP-Option is an "octets" data type, so you have to feed it octets. e.g.
> &DHCP-SIP-Servers-DHCP-Option = 0x01c0a800fe
> That will work.
>* Dhcpdump shows:
*> >* OPTION: 120 ( 12) SIP Servers DHCP Option *3131302e31302e302e323534*
*> Because you gave the attribute a text string. Which isn't hex,
and it isn't an IP address.
But option 43 - DHCP-Vendor is octet also. However
&DHCP-Vendor = "http://user:pass@%{listen:src_ipaddr}/pbx"
works fine.
> You just typed it there. You can add that as hex to the "update" statement.
>* I specified this option at isc-dhcp-server simply
*>* *option sip-pbx-servers 1 192.168.0.254;*
*> That's nice for them.
I added it
&DHCP-SIP-Servers-DHCP-Option = "0x01c0a800fe"
to update section.
If you talked about it.
But it would be easy that it is in human readable/clear format.
> That's unfortunately more difficult to do in FreeRADIUS. Your best bet is to just use hex.
Is there string to hex convertion ? Look like
%{hex:%{listen:str_ipaddr}} ?
But what about your previous words:
> I looked into a lot of docs but didn' t find any success resolution.
> So, how is the best way at unlang to:
> - convert ipaddr type to octet;
> - convert string to octet;
> - convert string to ipaddr ?
> You don't. The server should automatically do this.
As I understood, in case of 120 option conversion in particular is
made automatically, is it ?
More information about the Freeradius-Users
mailing list