dynamic lookup of list entries

James Potter Jim.Potter at jisc.ac.uk
Mon Jan 29 15:21:34 UTC 2024


Bah. OK, a spot more refinement and testing, I have:

Tunnel-Private-Group-ID := "%{config:sites.%{client:site}.remote}"

(not sure why its ${client.site} with a fullstop but %{client:site} with a colon - is there any info on all variables/?namespaces? available within FreeRad?)

This looks better... now 2 clients configured:
client localhost {
        ipaddr = 127.0.0.1
        proto = *
        secret = testing123
        site = 2
}

client eth0 {
        ipaddr = 192.168.0.34
        proto = *
        secret = testing123
        site = 1
}

...and the sites

sites {
        1 {
                local = 123
                remote = 234
        }
        2 {
                local = 345
                remote = 543
        }
}

Now, when I eapol_test from:
- 127.0.0.1 I get Tunnel-Private-Group-Id := "543"
- 192.168.0.34 I get Tunnel-Private-Group-Id := "234"
Which looks like it works to me

Does that look correct?

Thanks,

Jim

-----Original Message-----
From: Freeradius-Users <freeradius-users-bounces+jim.potter=jisc.ac.uk at lists.freeradius.org> On Behalf Of Alan DeKok
Sent: Monday, January 29, 2024 1:14 PM
To: FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
Subject: Re: dynamic lookup of list entries

[You don't often get email from aland at deployingradius.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

On Jan 29, 2024, at 7:22 AM, James Potter via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> OK, after a bit of tweaking I got this working:
>
>              Tunnel-Private-Group-ID := "%{config:sites.${client.site}.remote}"

  Except that the ${...} is expanded only once, when the server starts.  So this works (maybe) for one client.  It doesn't work when there are multiple clients.

  Alan DeKok.

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list