Score:0

How to fetch attribute in freeradius plicy.d/filter

mo flag

I have an issue with getting empty Called-Station-Id in policy.d/filter of Freeradius. there are different VLANs the user can connect from I want to assign VLAN by filtering the WIFI name in the request packet EX: Called-Station-Id = "1A-EC-DA-8A-FD-73:WIFIRadius".

filter

filter_ssid {
        if ("%{Called-Station-Id}" =~ /WIFIRadius/) {
                 update reply {
                        Tunnel-Type = VLAN,
                        Tunnel-Medium-Type = IEEE-802
                        Tunnel-Private-Group-Id = 10
                        Reply-Message = "Authenticated as %{User-Name} CSID: %{Called-Station-Id}"
                 }
                 ok
         }
        elsif ("%{Called-Station-Id}" =~ /WIFIRadius2/) {
                  update reply {
                        Tunnel-Type = VLAN
                        Tunnel-Medium-Type = IEEE-802
                        Tunnel-Private-Group-Id = 15
                        Reply-Message = "Authenticated as %{User-Name} CSID: %{Called-Station-Id}"
                 }
                 ok
         }
}

Access-Request

Thu Mar 30 10:16:41 2023 : Debug: (7) Received Access-Request Id 112 from x.x.x.x:port to x.x.x.x:1812 length 303
Thu Mar 30 10:16:41 2023 : Debug: (7)   User-Name = "[email protected]"
Thu Mar 30 10:16:41 2023 : Debug: (7)   NAS-IP-Address = x.x.x.x
Thu Mar 30 10:16:41 2023 : Debug: (7)   NAS-Identifier = "1aecda8afd73"
Thu Mar 30 10:16:41 2023 : Debug: (7)   Called-Station-Id = "1A-EC-DA-8A-FD-73:WIFIRadius"
Thu Mar 30 10:16:41 2023 : Debug: (7)   NAS-Port-Type = Wireless-802.11
Thu Mar 30 10:16:41 2023 : Debug: (7)   Service-Type = Framed-User
Thu Mar 30 10:16:41 2023 : Debug: (7)   Calling-Station-Id = "74-C1-7D-13-0D-AD"

logs

policy filter_ssid {
Thu Mar 30 10:42:15 2023 : Debug: (7)         if ("%{Called-Station-Id}" =~ /WIFIRadius/) {
Thu Mar 30 10:42:15 2023 : Debug: (7)         EXPAND %{Called-Station-Id}
Thu Mar 30 10:42:15 2023 : Debug: (7)            --> 
Thu Mar 30 10:42:15 2023 : Debug: (7)         if ("%{Called-Station-Id}" =~ /WIFIRadius/)  -> FALSE
Thu Mar 30 10:42:15 2023 : Debug: (7)         elsif ("%{Called-Station-Id}" =~ /WIFIRadius2/) {
Thu Mar 30 10:42:15 2023 : Debug: (7)         EXPAND %{Called-Station-Id}
Thu Mar 30 10:42:15 2023 : Debug: (7)            --> 
Thu Mar 30 10:42:15 2023 : Debug: (7)         elsif ("%{Called-Station-Id}" =~ /WIFIRadius2/)  -> FALSE
Thu Mar 30 10:42:15 2023 : Debug: (7)       } # policy filter_ssid = notfound

the filter_ssid is liste in sites-enabled/default and inner-tunnel after filter_username

User-Name is being passed in filter with value but Called-Station-Id is empty. I am using: freeradius 3.0 Authentication: EAP-GTC

any help how I can get this Called-Station-Id in filter with value in it.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.