FreeRADIUS 4: DHCP v4: ERROR: Expansion "network" needs to be resolved before it is used

Alan DeKok aland at deployingradius.com
Fri Nov 8 11:59:59 UTC 2024


On Nov 8, 2024, at 11:27 AM, Dima Ermakov <demonihin at gmail.com> wrote:
> I am trying to test FreeRADIUS 4 on RockyLinux 9.4 built from commit
> c01f1dbb733966ac51f7d2bacb6343fc04450024
> I know that this software is not supposed to be used in production
> (and I don't do it, it is testing only for now).

  It should mostly work, barring some corner cases and features which aren't implemented.

> I tried to configure a simple DHCPv4 service which uses the "files"
> module to assign per-network properties.
> The processing fails with expansion of "key" in files:
> 
> """
> files files_dhcp_network {
> ...
>        key = 'network'

  Why are you using a fixed string here?  This doesn't make sense.

  What are you trying to do?  Why are all of the "files" entries using a fixed name "network"?

> with error: files_dhcp_network - ERROR: Expansion "network" needs to
> be resolved before it is used.

  Yes, the documentation explains that the "key" field should be an expansion, an attribute reference, etc.  It shouldn't be a fixed string.

> Here is a part of my ${moddir}/dhcp_config (inspired by
> https://www.freeradius.org/documentation/freeradius-server/3.2.7/howto/protocols/dhcp/policy_network_options.html
> ):
> 
> """
> network IP-Pool.Name := "local"
>    Domain-Name := "example.org",
>    Subnet-Mask := 255.255.255.0,
>    Router-Address := 172.16.1.1,
>    Domain-Name-Server := 192.168.20.2,
>    Fall-Through := yes
> 
> network Network-Subnet < 172.25.1.0/24
>    IP-Pool.Name := "pool-172.25.1.0/24",
>    Subnet-Mask := 255.255.255.0,
>    Broadcast-Address := 172.25.1.255
> """

  So every "files" entry is keyed with the word "network".  Why?

  What are you trying to do?  Why do you expect it to do when you configure a fixed key of "network"?

> Could you, please, if possible point me to what should be corrected?

  Use the word DEFAULT to match all entries, or configure the "key" field to use an actual key, and not a fixed string.

  Alan DeKok.



More information about the Freeradius-Users mailing list