Issue with %{home_server_dynamic:name} dynamic home server and accounting
I'm using this code as per the documentation in order to support dynamic home servers: -------- if (User-Name =~ /@(.*)$/) { switch "%{home_server_dynamic:%{1}}" { case "1" { # Proxy to this one particular home server update control { &Home-Server-Name := "%{1}" } } case "0" { # Proxy with home server pool, failover, etc. update control { &Proxy-To-Realm := "%{1}" } } case { # no home server exists, ask DNS update control { &Temp-Home-Server-String := `%{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp` } if ("%{control:Temp-Home-Server-String}" == "" ) { reject } else { update control { &Home-Server-Name := "%{1}" } } } } } -------- If there is no existing dynamic server in the home_servers folder it works fine and dynamically creates it (i.e. home_servers/openroaming.goog), all good: -------- Sat Jul 13 19:28:14 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:14 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:14 2024 : Debug: (0) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:14 2024 : Debug: (0) --> Sat Jul 13 19:28:14 2024 : Debug: (0) case { Sat Jul 13 19:28:14 2024 : Debug: (0) update control { Sat Jul 13 19:28:14 2024 : Debug: (0) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: Sat Jul 13 19:28:14 2024 : Debug: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: xlat --> config Sat Jul 13 19:28:14 2024 : Debug: { Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: literal --> /mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: confdir Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND confdir Sat Jul 13 19:28:14 2024 : Debug: (0) --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: (0) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: %{config:confdir} Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: xlat --> config Sat Jul 13 19:28:14 2024 : Debug: { Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: confdir Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND confdir Sat Jul 13 19:28:14 2024 : Debug: (0) --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{config:confdir} Sat Jul 13 19:28:14 2024 : Debug: (0) --> /usr/local/etc/raddb Sat Jul 13 19:28:14 2024 : Debug: %{1} Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: regex-var --> 1 Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{1} Sat Jul 13 19:28:14 2024 : Debug: (0) --> openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: Waking up in 0.3 seconds. Sat Jul 13 19:28:14 2024 : Debug: ... new connection request on command socket Sat Jul 13 19:28:14 2024 : Debug: Listening on command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:14 2024 : Debug: Waking up in 0.2 seconds. Sat Jul 13 19:28:14 2024 : Debug: radmin> add home_server file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/tls.conf Sat Jul 13 19:28:14 2024 : Debug: home_server openroaming.goog { Sat Jul 13 19:28:14 2024 : Debug: nonblock = no Sat Jul 13 19:28:14 2024 : Debug: ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] Sat Jul 13 19:28:14 2024 : Debug: port = 2083 Sat Jul 13 19:28:14 2024 : Debug: type = "auth" Sat Jul 13 19:28:14 2024 : Debug: proto = "tcp" Sat Jul 13 19:28:14 2024 : Debug: secret = "radsec" Sat Jul 13 19:28:14 2024 : Debug: response_window = 30.000000 Sat Jul 13 19:28:14 2024 : Debug: response_timeouts = 1 Sat Jul 13 19:28:14 2024 : Debug: max_outstanding = 65536 Sat Jul 13 19:28:14 2024 : Debug: zombie_period = 40 Sat Jul 13 19:28:14 2024 : Debug: status_check = "none" Sat Jul 13 19:28:14 2024 : Debug: ping_interval = 30 Sat Jul 13 19:28:14 2024 : Debug: check_timeout = 4 Sat Jul 13 19:28:14 2024 : Debug: num_answers_to_alive = 3 Sat Jul 13 19:28:14 2024 : Debug: revive_interval = 300 Sat Jul 13 19:28:14 2024 : Debug: limit { Sat Jul 13 19:28:14 2024 : Debug: max_connections = 16 Sat Jul 13 19:28:14 2024 : Debug: max_requests = 0 Sat Jul 13 19:28:14 2024 : Debug: lifetime = 0 Sat Jul 13 19:28:14 2024 : Debug: idle_timeout = 0 Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: coa { Sat Jul 13 19:28:14 2024 : Debug: irt = 2 Sat Jul 13 19:28:14 2024 : Debug: mrt = 16 Sat Jul 13 19:28:14 2024 : Debug: mrc = 5 Sat Jul 13 19:28:14 2024 : Debug: mrd = 30 Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: recv_coa { Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: tls { Sat Jul 13 19:28:14 2024 : Debug: verify_depth = 0 Sat Jul 13 19:28:14 2024 : Debug: pem_file_type = yes Sat Jul 13 19:28:14 2024 : Debug: private_key_file = "/usr/local/etc/raddb/certs/x.key" Sat Jul 13 19:28:14 2024 : Debug: certificate_file = "/usr/local/etc/raddb/certs/x.crt" Sat Jul 13 19:28:14 2024 : Debug: ca_file = "/usr/local/etc/raddb/certs/ca/x.ca" Sat Jul 13 19:28:14 2024 : Debug: private_key_password = "" Sat Jul 13 19:28:14 2024 : Debug: fragment_size = 8192 Sat Jul 13 19:28:14 2024 : Debug: include_length = yes Sat Jul 13 19:28:14 2024 : Debug: check_crl = no Sat Jul 13 19:28:14 2024 : Debug: cipher_list = "ALL" Sat Jul 13 19:28:14 2024 : Debug: ca_path_reload_interval = 0 Sat Jul 13 19:28:14 2024 : Debug: ecdh_curve = "prime256v1" Sat Jul 13 19:28:14 2024 : Debug: tls_max_version = "1.3" Sat Jul 13 19:28:14 2024 : Debug: tls_min_version = "1.2" Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:15 2024 : Debug: (0) Program returned code (0) and output 'openroaming.goog' Sat Jul 13 19:28:15 2024 : Debug: (0) &Temp-Home-Server-String := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (0) if ("%{control:Temp-Home-Server-String}" == "" ) { Sat Jul 13 19:28:15 2024 : Debug: (0) if ("%{control:Temp-Home-Server-String}" == "" ) -> FALSE Sat Jul 13 19:28:15 2024 : Debug: (0) else { Sat Jul 13 19:28:15 2024 : Debug: (0) update control { Sat Jul 13 19:28:15 2024 : Debug: (0) EXPAND %{1} Sat Jul 13 19:28:15 2024 : Debug: (0) --> openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) &Home-Server-Name := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # else = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # case = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # switch %{home_server_dynamic:%{1}} = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # if (User-Name =~ /@(.*)$/) = noop -------- It then does it's normal EAP transaction to/from the client, and on each incoming request during the negotiation, it's correctly detecting that the home_server file exists, so does not perform the lookup again as expected, i.e.: -------- Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:15 2024 : Debug: (1) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:15 2024 : Debug: (1) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:15 2024 : Debug: (1) --> 1 Sat Jul 13 19:28:15 2024 : Debug: (1) case 1 { Sat Jul 13 19:28:15 2024 : Debug: (1) update control { Sat Jul 13 19:28:15 2024 : Debug: (1) EXPAND %{1} Sat Jul 13 19:28:15 2024 : Debug: (1) --> openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (1) &Home-Server-Name := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (1) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # case 1 = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # switch %{home_server_dynamic:%{1}} = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # if (User-Name =~ /@(.*)$/) = noop ---------- Once the EAP stuff is all done, it fires off the request to the dynamic home_server: ---------- Sat Jul 13 19:28:15 2024 : Debug: (0) Proxying due to Home-Server-Name Sat Jul 13 19:28:15 2024 : Debug: (0) Starting proxy to home server 146.148.44.172 port 2083 Sat Jul 13 19:28:15 2024 : Debug: (0) proxy: Trying to allocate ID (0/2) Sat Jul 13 19:28:15 2024 : Debug: (0) proxy: Trying to open a new listener to the home server Sat Jul 13 19:28:15 2024 : Debug: Waking up in 0.1 seconds. Sat Jul 13 19:28:15 2024 : Info: ... shutting down socket command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:15 2024 : Debug: ... cleaning up socket command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:15 2024 : Debug: Waking up in 0.1 seconds. Sat Jul 13 19:28:15 2024 : Debug: (TLS) Trying new outgoing proxy connection to proxy (0.0.0.0, 0) -> home_server (146.148.44.172, 2083) [snip] Sat Jul 13 19:28:16 2024 : Auth: (4) Login OK: [anonymous@openroaming.goog] Sat Jul 13 19:28:16 2024 : Debug: (4) Sent Access-Accept Id 35 Sat Jul 13 19:28:16 2024 : Debug: (4) MS-MPPE-Recv-Key = 0xaf73c99cadd7b68fe589b4a55648308437e348ce1a733f77623ef0d69faa32d4 Sat Jul 13 19:28:16 2024 : Debug: (4) MS-MPPE-Send-Key = 0x2f965f6006a00599da680104627ddc25271e67dc3bc5f8e1491668d39e04cc77 Sat Jul 13 19:28:16 2024 : Debug: (4) EAP-Message = 0x031a0004 Sat Jul 13 19:28:16 2024 : Debug: (4) Message-Authenticator = 0x1e4dbd72d829dc1f639bf159e99556ce Sat Jul 13 19:28:16 2024 : Debug: (4) User-Name = " anonymous@openroaming.goog" -------- And the user is authed successfully. Now, when the accounting start packet comes in, it fails to see that the home_server file exists, tries to create it again, fails, then doesn't proxy it: -------- Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:17 2024 : Debug: (8) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:17 2024 : Debug: (8) --> Sat Jul 13 19:28:17 2024 : Debug: (8) case { Sat Jul 13 19:28:17 2024 : Debug: (8) update control { Sat Jul 13 19:28:17 2024 : Debug: (8) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: Sat Jul 13 19:28:17 2024 : Debug: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: xlat --> config Sat Jul 13 19:28:17 2024 : Debug: { Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: literal --> /mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: confdir Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND confdir Sat Jul 13 19:28:17 2024 : Debug: (8) --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: (8) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: %{config:confdir} Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: xlat --> config Sat Jul 13 19:28:17 2024 : Debug: { Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: confdir Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND confdir Sat Jul 13 19:28:17 2024 : Debug: (8) --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{config:confdir} Sat Jul 13 19:28:17 2024 : Debug: (8) --> /usr/local/etc/raddb Sat Jul 13 19:28:17 2024 : Debug: %{1} Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: regex-var --> 1 Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{1} Sat Jul 13 19:28:17 2024 : Debug: (8) --> openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: Waking up in 0.3 seconds. Sat Jul 13 19:28:17 2024 : Debug: ... new connection request on command socket Sat Jul 13 19:28:17 2024 : Debug: Listening on command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:17 2024 : Debug: Waking up in 0.2 seconds. Sat Jul 13 19:28:17 2024 : Debug: radmin> add home_server file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/tls.conf Sat Jul 13 19:28:17 2024 : Debug: home_server openroaming.goog { Sat Jul 13 19:28:17 2024 : Debug: nonblock = no Sat Jul 13 19:28:17 2024 : Debug: ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] Sat Jul 13 19:28:17 2024 : Debug: port = 2083 Sat Jul 13 19:28:17 2024 : Debug: type = "auth" Sat Jul 13 19:28:17 2024 : Debug: proto = "tcp" Sat Jul 13 19:28:17 2024 : Debug: secret = "radsec" Sat Jul 13 19:28:17 2024 : Debug: response_window = 30.000000 Sat Jul 13 19:28:17 2024 : Debug: response_timeouts = 1 Sat Jul 13 19:28:17 2024 : Debug: max_outstanding = 65536 Sat Jul 13 19:28:17 2024 : Debug: zombie_period = 40 Sat Jul 13 19:28:17 2024 : Debug: status_check = "none" Sat Jul 13 19:28:17 2024 : Debug: ping_interval = 30 Sat Jul 13 19:28:17 2024 : Debug: check_timeout = 4 Sat Jul 13 19:28:17 2024 : Debug: num_answers_to_alive = 3 Sat Jul 13 19:28:17 2024 : Debug: revive_interval = 300 Sat Jul 13 19:28:17 2024 : Debug: limit { Sat Jul 13 19:28:17 2024 : Debug: max_connections = 16 Sat Jul 13 19:28:17 2024 : Debug: max_requests = 0 Sat Jul 13 19:28:17 2024 : Debug: lifetime = 0 Sat Jul 13 19:28:17 2024 : Debug: idle_timeout = 0 Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: coa { Sat Jul 13 19:28:17 2024 : Debug: irt = 2 Sat Jul 13 19:28:17 2024 : Debug: mrt = 16 Sat Jul 13 19:28:17 2024 : Debug: mrc = 5 Sat Jul 13 19:28:17 2024 : Debug: mrd = 30 Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: recv_coa { Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: tls { Sat Jul 13 19:28:17 2024 : Debug: verify_depth = 0 Sat Jul 13 19:28:17 2024 : Debug: pem_file_type = yes Sat Jul 13 19:28:17 2024 : Debug: private_key_file = "/usr/local/etc/raddb/certs/x.key" Sat Jul 13 19:28:17 2024 : Debug: certificate_file = "/usr/local/etc/raddb/certs/x.crt" Sat Jul 13 19:28:17 2024 : Debug: ca_file = "/usr/local/etc/raddb/certs/ca/x.ca" Sat Jul 13 19:28:17 2024 : Debug: private_key_password = "" Sat Jul 13 19:28:17 2024 : Debug: fragment_size = 8192 Sat Jul 13 19:28:17 2024 : Debug: include_length = yes Sat Jul 13 19:28:17 2024 : Debug: check_crl = no Sat Jul 13 19:28:17 2024 : Debug: cipher_list = "ALL" Sat Jul 13 19:28:17 2024 : Debug: ca_path_reload_interval = 0 Sat Jul 13 19:28:17 2024 : Debug: ecdh_curve = "prime256v1" Sat Jul 13 19:28:17 2024 : Debug: tls_max_version = "1.3" Sat Jul 13 19:28:17 2024 : Debug: tls_min_version = "1.2" Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Error: /usr/local/etc/raddb/home_servers/ openroaming.goog[1]: Duplicate home server name openroaming.goog ERROR: Unable to add home server - Failed adding home_server to the internal data structures -------- Is this a bug, or am I missing something? It appears %{home_server_dynamic:%{1} is not working for accounting packets. Is it because type = "auth" is configured in the dynamically created home_server file and it doesn't realise it should also use it for accounting? p.s. it seems the dynamic home_server files do not allow type = "auth+acct", is that correct? You can't create two home_server files with the same name either, so what should I do? The %{home_server_dynamic:%{1} check in subsequent authentication packets works as expected so it only seems to affect accounting. Thanks, James
I upgraded from 3.2.3 to 3.2.5 and had the same problem. Is there a different way I should be checking for the existence of a dynamic home_server? Thanks On Sat, 13 Jul 2024 at 20:57, James Wood <james.wood@purplewifi.com> wrote:
I'm using this code as per the documentation in order to support dynamic home servers:
-------- if (User-Name =~ /@(.*)$/) { switch "%{home_server_dynamic:%{1}}" { case "1" { # Proxy to this one particular home server update control { &Home-Server-Name := "%{1}" } }
case "0" { # Proxy with home server pool, failover, etc. update control { &Proxy-To-Realm := "%{1}" } }
case { # no home server exists, ask DNS update control { &Temp-Home-Server-String := `%{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp` }
if ("%{control:Temp-Home-Server-String}" == "" ) { reject } else { update control { &Home-Server-Name := "%{1}" } } } } } --------
If there is no existing dynamic server in the home_servers folder it works fine and dynamically creates it (i.e. home_servers/openroaming.goog), all good:
-------- Sat Jul 13 19:28:14 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:14 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:14 2024 : Debug: (0) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:14 2024 : Debug: (0) --> Sat Jul 13 19:28:14 2024 : Debug: (0) case { Sat Jul 13 19:28:14 2024 : Debug: (0) update control { Sat Jul 13 19:28:14 2024 : Debug: (0) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: Sat Jul 13 19:28:14 2024 : Debug: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: xlat --> config Sat Jul 13 19:28:14 2024 : Debug: { Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: literal --> /mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: confdir Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND confdir Sat Jul 13 19:28:14 2024 : Debug: (0) --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: (0) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: %{config:confdir} Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: xlat --> config Sat Jul 13 19:28:14 2024 : Debug: { Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: confdir Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND confdir Sat Jul 13 19:28:14 2024 : Debug: (0) --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{config:confdir} Sat Jul 13 19:28:14 2024 : Debug: (0) --> /usr/local/etc/raddb Sat Jul 13 19:28:14 2024 : Debug: %{1} Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: regex-var --> 1 Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{1} Sat Jul 13 19:28:14 2024 : Debug: (0) --> openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: Waking up in 0.3 seconds. Sat Jul 13 19:28:14 2024 : Debug: ... new connection request on command socket Sat Jul 13 19:28:14 2024 : Debug: Listening on command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:14 2024 : Debug: Waking up in 0.2 seconds. Sat Jul 13 19:28:14 2024 : Debug: radmin> add home_server file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/tls.conf Sat Jul 13 19:28:14 2024 : Debug: home_server openroaming.goog { Sat Jul 13 19:28:14 2024 : Debug: nonblock = no Sat Jul 13 19:28:14 2024 : Debug: ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] Sat Jul 13 19:28:14 2024 : Debug: port = 2083 Sat Jul 13 19:28:14 2024 : Debug: type = "auth" Sat Jul 13 19:28:14 2024 : Debug: proto = "tcp" Sat Jul 13 19:28:14 2024 : Debug: secret = "radsec" Sat Jul 13 19:28:14 2024 : Debug: response_window = 30.000000 Sat Jul 13 19:28:14 2024 : Debug: response_timeouts = 1 Sat Jul 13 19:28:14 2024 : Debug: max_outstanding = 65536 Sat Jul 13 19:28:14 2024 : Debug: zombie_period = 40 Sat Jul 13 19:28:14 2024 : Debug: status_check = "none" Sat Jul 13 19:28:14 2024 : Debug: ping_interval = 30 Sat Jul 13 19:28:14 2024 : Debug: check_timeout = 4 Sat Jul 13 19:28:14 2024 : Debug: num_answers_to_alive = 3 Sat Jul 13 19:28:14 2024 : Debug: revive_interval = 300 Sat Jul 13 19:28:14 2024 : Debug: limit { Sat Jul 13 19:28:14 2024 : Debug: max_connections = 16 Sat Jul 13 19:28:14 2024 : Debug: max_requests = 0 Sat Jul 13 19:28:14 2024 : Debug: lifetime = 0 Sat Jul 13 19:28:14 2024 : Debug: idle_timeout = 0 Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: coa { Sat Jul 13 19:28:14 2024 : Debug: irt = 2 Sat Jul 13 19:28:14 2024 : Debug: mrt = 16 Sat Jul 13 19:28:14 2024 : Debug: mrc = 5 Sat Jul 13 19:28:14 2024 : Debug: mrd = 30 Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: recv_coa { Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: tls { Sat Jul 13 19:28:14 2024 : Debug: verify_depth = 0 Sat Jul 13 19:28:14 2024 : Debug: pem_file_type = yes Sat Jul 13 19:28:14 2024 : Debug: private_key_file = "/usr/local/etc/raddb/certs/x.key" Sat Jul 13 19:28:14 2024 : Debug: certificate_file = "/usr/local/etc/raddb/certs/x.crt" Sat Jul 13 19:28:14 2024 : Debug: ca_file = "/usr/local/etc/raddb/certs/ca/x.ca" Sat Jul 13 19:28:14 2024 : Debug: private_key_password = "" Sat Jul 13 19:28:14 2024 : Debug: fragment_size = 8192 Sat Jul 13 19:28:14 2024 : Debug: include_length = yes Sat Jul 13 19:28:14 2024 : Debug: check_crl = no Sat Jul 13 19:28:14 2024 : Debug: cipher_list = "ALL" Sat Jul 13 19:28:14 2024 : Debug: ca_path_reload_interval = 0 Sat Jul 13 19:28:14 2024 : Debug: ecdh_curve = "prime256v1" Sat Jul 13 19:28:14 2024 : Debug: tls_max_version = "1.3" Sat Jul 13 19:28:14 2024 : Debug: tls_min_version = "1.2" Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:15 2024 : Debug: (0) Program returned code (0) and output 'openroaming.goog' Sat Jul 13 19:28:15 2024 : Debug: (0) &Temp-Home-Server-String := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (0) if ("%{control:Temp-Home-Server-String}" == "" ) { Sat Jul 13 19:28:15 2024 : Debug: (0) if ("%{control:Temp-Home-Server-String}" == "" ) -> FALSE Sat Jul 13 19:28:15 2024 : Debug: (0) else { Sat Jul 13 19:28:15 2024 : Debug: (0) update control { Sat Jul 13 19:28:15 2024 : Debug: (0) EXPAND %{1} Sat Jul 13 19:28:15 2024 : Debug: (0) --> openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) &Home-Server-Name := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # else = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # case = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # switch %{home_server_dynamic:%{1}} = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # if (User-Name =~ /@(.*)$/) = noop --------
It then does it's normal EAP transaction to/from the client, and on each incoming request during the negotiation, it's correctly detecting that the home_server file exists, so does not perform the lookup again as expected, i.e.:
-------- Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:15 2024 : Debug: (1) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:15 2024 : Debug: (1) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:15 2024 : Debug: (1) --> 1 Sat Jul 13 19:28:15 2024 : Debug: (1) case 1 { Sat Jul 13 19:28:15 2024 : Debug: (1) update control { Sat Jul 13 19:28:15 2024 : Debug: (1) EXPAND %{1} Sat Jul 13 19:28:15 2024 : Debug: (1) --> openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (1) &Home-Server-Name := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (1) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # case 1 = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # switch %{home_server_dynamic:%{1}} = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # if (User-Name =~ /@(.*)$/) = noop ----------
Once the EAP stuff is all done, it fires off the request to the dynamic home_server:
---------- Sat Jul 13 19:28:15 2024 : Debug: (0) Proxying due to Home-Server-Name Sat Jul 13 19:28:15 2024 : Debug: (0) Starting proxy to home server 146.148.44.172 port 2083 Sat Jul 13 19:28:15 2024 : Debug: (0) proxy: Trying to allocate ID (0/2) Sat Jul 13 19:28:15 2024 : Debug: (0) proxy: Trying to open a new listener to the home server Sat Jul 13 19:28:15 2024 : Debug: Waking up in 0.1 seconds. Sat Jul 13 19:28:15 2024 : Info: ... shutting down socket command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:15 2024 : Debug: ... cleaning up socket command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:15 2024 : Debug: Waking up in 0.1 seconds. Sat Jul 13 19:28:15 2024 : Debug: (TLS) Trying new outgoing proxy connection to proxy (0.0.0.0, 0) -> home_server (146.148.44.172, 2083) [snip] Sat Jul 13 19:28:16 2024 : Auth: (4) Login OK: [anonymous@openroaming.goog ] Sat Jul 13 19:28:16 2024 : Debug: (4) Sent Access-Accept Id 35 Sat Jul 13 19:28:16 2024 : Debug: (4) MS-MPPE-Recv-Key = 0xaf73c99cadd7b68fe589b4a55648308437e348ce1a733f77623ef0d69faa32d4 Sat Jul 13 19:28:16 2024 : Debug: (4) MS-MPPE-Send-Key = 0x2f965f6006a00599da680104627ddc25271e67dc3bc5f8e1491668d39e04cc77 Sat Jul 13 19:28:16 2024 : Debug: (4) EAP-Message = 0x031a0004 Sat Jul 13 19:28:16 2024 : Debug: (4) Message-Authenticator = 0x1e4dbd72d829dc1f639bf159e99556ce Sat Jul 13 19:28:16 2024 : Debug: (4) User-Name = " anonymous@openroaming.goog" --------
And the user is authed successfully.
Now, when the accounting start packet comes in, it fails to see that the home_server file exists, tries to create it again, fails, then doesn't proxy it:
-------- Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:17 2024 : Debug: (8) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:17 2024 : Debug: (8) --> Sat Jul 13 19:28:17 2024 : Debug: (8) case { Sat Jul 13 19:28:17 2024 : Debug: (8) update control { Sat Jul 13 19:28:17 2024 : Debug: (8) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: Sat Jul 13 19:28:17 2024 : Debug: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: xlat --> config Sat Jul 13 19:28:17 2024 : Debug: { Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: literal --> /mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: confdir Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND confdir Sat Jul 13 19:28:17 2024 : Debug: (8) --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: (8) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: %{config:confdir} Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: xlat --> config Sat Jul 13 19:28:17 2024 : Debug: { Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: confdir Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND confdir Sat Jul 13 19:28:17 2024 : Debug: (8) --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{config:confdir} Sat Jul 13 19:28:17 2024 : Debug: (8) --> /usr/local/etc/raddb Sat Jul 13 19:28:17 2024 : Debug: %{1} Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: regex-var --> 1 Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{1} Sat Jul 13 19:28:17 2024 : Debug: (8) --> openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: Waking up in 0.3 seconds. Sat Jul 13 19:28:17 2024 : Debug: ... new connection request on command socket Sat Jul 13 19:28:17 2024 : Debug: Listening on command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:17 2024 : Debug: Waking up in 0.2 seconds. Sat Jul 13 19:28:17 2024 : Debug: radmin> add home_server file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/tls.conf Sat Jul 13 19:28:17 2024 : Debug: home_server openroaming.goog { Sat Jul 13 19:28:17 2024 : Debug: nonblock = no Sat Jul 13 19:28:17 2024 : Debug: ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] Sat Jul 13 19:28:17 2024 : Debug: port = 2083 Sat Jul 13 19:28:17 2024 : Debug: type = "auth" Sat Jul 13 19:28:17 2024 : Debug: proto = "tcp" Sat Jul 13 19:28:17 2024 : Debug: secret = "radsec" Sat Jul 13 19:28:17 2024 : Debug: response_window = 30.000000 Sat Jul 13 19:28:17 2024 : Debug: response_timeouts = 1 Sat Jul 13 19:28:17 2024 : Debug: max_outstanding = 65536 Sat Jul 13 19:28:17 2024 : Debug: zombie_period = 40 Sat Jul 13 19:28:17 2024 : Debug: status_check = "none" Sat Jul 13 19:28:17 2024 : Debug: ping_interval = 30 Sat Jul 13 19:28:17 2024 : Debug: check_timeout = 4 Sat Jul 13 19:28:17 2024 : Debug: num_answers_to_alive = 3 Sat Jul 13 19:28:17 2024 : Debug: revive_interval = 300 Sat Jul 13 19:28:17 2024 : Debug: limit { Sat Jul 13 19:28:17 2024 : Debug: max_connections = 16 Sat Jul 13 19:28:17 2024 : Debug: max_requests = 0 Sat Jul 13 19:28:17 2024 : Debug: lifetime = 0 Sat Jul 13 19:28:17 2024 : Debug: idle_timeout = 0 Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: coa { Sat Jul 13 19:28:17 2024 : Debug: irt = 2 Sat Jul 13 19:28:17 2024 : Debug: mrt = 16 Sat Jul 13 19:28:17 2024 : Debug: mrc = 5 Sat Jul 13 19:28:17 2024 : Debug: mrd = 30 Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: recv_coa { Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: tls { Sat Jul 13 19:28:17 2024 : Debug: verify_depth = 0 Sat Jul 13 19:28:17 2024 : Debug: pem_file_type = yes Sat Jul 13 19:28:17 2024 : Debug: private_key_file = "/usr/local/etc/raddb/certs/x.key" Sat Jul 13 19:28:17 2024 : Debug: certificate_file = "/usr/local/etc/raddb/certs/x.crt" Sat Jul 13 19:28:17 2024 : Debug: ca_file = "/usr/local/etc/raddb/certs/ca/x.ca" Sat Jul 13 19:28:17 2024 : Debug: private_key_password = "" Sat Jul 13 19:28:17 2024 : Debug: fragment_size = 8192 Sat Jul 13 19:28:17 2024 : Debug: include_length = yes Sat Jul 13 19:28:17 2024 : Debug: check_crl = no Sat Jul 13 19:28:17 2024 : Debug: cipher_list = "ALL" Sat Jul 13 19:28:17 2024 : Debug: ca_path_reload_interval = 0 Sat Jul 13 19:28:17 2024 : Debug: ecdh_curve = "prime256v1" Sat Jul 13 19:28:17 2024 : Debug: tls_max_version = "1.3" Sat Jul 13 19:28:17 2024 : Debug: tls_min_version = "1.2" Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Error: /usr/local/etc/raddb/home_servers/ openroaming.goog[1]: Duplicate home server name openroaming.goog ERROR: Unable to add home server - Failed adding home_server to the internal data structures --------
Is this a bug, or am I missing something? It appears %{home_server_dynamic:%{1} is not working for accounting packets. Is it because type = "auth" is configured in the dynamically created home_server file and it doesn't realise it should also use it for accounting? p.s. it seems the dynamic home_server files do not allow type = "auth+acct", is that correct? You can't create two home_server files with the same name either, so what should I do?
The %{home_server_dynamic:%{1} check in subsequent authentication packets works as expected so it only seems to affect accounting.
Thanks,
James
We'll take a look. I don't think that code changed from 3.2.3 to 3.2.5, so this is another oddity.
On Jul 15, 2024, at 9:40 AM, James Wood via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I upgraded from 3.2.3 to 3.2.5 and had the same problem. Is there a different way I should be checking for the existence of a dynamic home_server?
Thanks
On Sat, 13 Jul 2024 at 20:57, James Wood <james.wood@purplewifi.com> wrote:
I'm using this code as per the documentation in order to support dynamic home servers:
-------- if (User-Name =~ /@(.*)$/) { switch "%{home_server_dynamic:%{1}}" { case "1" { # Proxy to this one particular home server update control { &Home-Server-Name := "%{1}" } }
case "0" { # Proxy with home server pool, failover, etc. update control { &Proxy-To-Realm := "%{1}" } }
case { # no home server exists, ask DNS update control { &Temp-Home-Server-String := `%{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp` }
if ("%{control:Temp-Home-Server-String}" == "" ) { reject } else { update control { &Home-Server-Name := "%{1}" } } } } } --------
If there is no existing dynamic server in the home_servers folder it works fine and dynamically creates it (i.e. home_servers/openroaming.goog), all good:
-------- Sat Jul 13 19:28:14 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:14 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:14 2024 : Debug: (0) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:14 2024 : Debug: (0) --> Sat Jul 13 19:28:14 2024 : Debug: (0) case { Sat Jul 13 19:28:14 2024 : Debug: (0) update control { Sat Jul 13 19:28:14 2024 : Debug: (0) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: Sat Jul 13 19:28:14 2024 : Debug: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: xlat --> config Sat Jul 13 19:28:14 2024 : Debug: { Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: literal --> /mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: confdir Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND confdir Sat Jul 13 19:28:14 2024 : Debug: (0) --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: (0) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:14 2024 : Debug: %{config:confdir} Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: xlat --> config Sat Jul 13 19:28:14 2024 : Debug: { Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: confdir Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: literal --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND confdir Sat Jul 13 19:28:14 2024 : Debug: (0) --> confdir Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{config:confdir} Sat Jul 13 19:28:14 2024 : Debug: (0) --> /usr/local/etc/raddb Sat Jul 13 19:28:14 2024 : Debug: %{1} Sat Jul 13 19:28:14 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:14 2024 : Debug: regex-var --> 1 Sat Jul 13 19:28:14 2024 : Debug: (0) EXPAND %{1} Sat Jul 13 19:28:14 2024 : Debug: (0) --> openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: Waking up in 0.3 seconds. Sat Jul 13 19:28:14 2024 : Debug: ... new connection request on command socket Sat Jul 13 19:28:14 2024 : Debug: Listening on command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:14 2024 : Debug: Waking up in 0.2 seconds. Sat Jul 13 19:28:14 2024 : Debug: radmin> add home_server file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:14 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/tls.conf Sat Jul 13 19:28:14 2024 : Debug: home_server openroaming.goog { Sat Jul 13 19:28:14 2024 : Debug: nonblock = no Sat Jul 13 19:28:14 2024 : Debug: ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] Sat Jul 13 19:28:14 2024 : Debug: port = 2083 Sat Jul 13 19:28:14 2024 : Debug: type = "auth" Sat Jul 13 19:28:14 2024 : Debug: proto = "tcp" Sat Jul 13 19:28:14 2024 : Debug: secret = "radsec" Sat Jul 13 19:28:14 2024 : Debug: response_window = 30.000000 Sat Jul 13 19:28:14 2024 : Debug: response_timeouts = 1 Sat Jul 13 19:28:14 2024 : Debug: max_outstanding = 65536 Sat Jul 13 19:28:14 2024 : Debug: zombie_period = 40 Sat Jul 13 19:28:14 2024 : Debug: status_check = "none" Sat Jul 13 19:28:14 2024 : Debug: ping_interval = 30 Sat Jul 13 19:28:14 2024 : Debug: check_timeout = 4 Sat Jul 13 19:28:14 2024 : Debug: num_answers_to_alive = 3 Sat Jul 13 19:28:14 2024 : Debug: revive_interval = 300 Sat Jul 13 19:28:14 2024 : Debug: limit { Sat Jul 13 19:28:14 2024 : Debug: max_connections = 16 Sat Jul 13 19:28:14 2024 : Debug: max_requests = 0 Sat Jul 13 19:28:14 2024 : Debug: lifetime = 0 Sat Jul 13 19:28:14 2024 : Debug: idle_timeout = 0 Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: coa { Sat Jul 13 19:28:14 2024 : Debug: irt = 2 Sat Jul 13 19:28:14 2024 : Debug: mrt = 16 Sat Jul 13 19:28:14 2024 : Debug: mrc = 5 Sat Jul 13 19:28:14 2024 : Debug: mrd = 30 Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: recv_coa { Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:14 2024 : Debug: tls { Sat Jul 13 19:28:14 2024 : Debug: verify_depth = 0 Sat Jul 13 19:28:14 2024 : Debug: pem_file_type = yes Sat Jul 13 19:28:14 2024 : Debug: private_key_file = "/usr/local/etc/raddb/certs/x.key" Sat Jul 13 19:28:14 2024 : Debug: certificate_file = "/usr/local/etc/raddb/certs/x.crt" Sat Jul 13 19:28:14 2024 : Debug: ca_file = "/usr/local/etc/raddb/certs/ca/x.ca" Sat Jul 13 19:28:14 2024 : Debug: private_key_password = "" Sat Jul 13 19:28:14 2024 : Debug: fragment_size = 8192 Sat Jul 13 19:28:14 2024 : Debug: include_length = yes Sat Jul 13 19:28:14 2024 : Debug: check_crl = no Sat Jul 13 19:28:14 2024 : Debug: cipher_list = "ALL" Sat Jul 13 19:28:14 2024 : Debug: ca_path_reload_interval = 0 Sat Jul 13 19:28:14 2024 : Debug: ecdh_curve = "prime256v1" Sat Jul 13 19:28:14 2024 : Debug: tls_max_version = "1.3" Sat Jul 13 19:28:14 2024 : Debug: tls_min_version = "1.2" Sat Jul 13 19:28:14 2024 : Debug: } Sat Jul 13 19:28:15 2024 : Debug: (0) Program returned code (0) and output 'openroaming.goog' Sat Jul 13 19:28:15 2024 : Debug: (0) &Temp-Home-Server-String := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (0) if ("%{control:Temp-Home-Server-String}" == "" ) { Sat Jul 13 19:28:15 2024 : Debug: (0) if ("%{control:Temp-Home-Server-String}" == "" ) -> FALSE Sat Jul 13 19:28:15 2024 : Debug: (0) else { Sat Jul 13 19:28:15 2024 : Debug: (0) update control { Sat Jul 13 19:28:15 2024 : Debug: (0) EXPAND %{1} Sat Jul 13 19:28:15 2024 : Debug: (0) --> openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) &Home-Server-Name := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (0) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # else = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # case = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # switch %{home_server_dynamic:%{1}} = noop Sat Jul 13 19:28:15 2024 : Debug: (0) } # if (User-Name =~ /@(.*)$/) = noop --------
It then does it's normal EAP transaction to/from the client, and on each incoming request during the negotiation, it's correctly detecting that the home_server file exists, so does not perform the lookup again as expected, i.e.:
-------- Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:15 2024 : Debug: (1) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:15 2024 : Debug: (1) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:15 2024 : Debug: (1) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:15 2024 : Debug: (1) --> 1 Sat Jul 13 19:28:15 2024 : Debug: (1) case 1 { Sat Jul 13 19:28:15 2024 : Debug: (1) update control { Sat Jul 13 19:28:15 2024 : Debug: (1) EXPAND %{1} Sat Jul 13 19:28:15 2024 : Debug: (1) --> openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (1) &Home-Server-Name := openroaming.goog Sat Jul 13 19:28:15 2024 : Debug: (1) } # update control = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # case 1 = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # switch %{home_server_dynamic:%{1}} = noop Sat Jul 13 19:28:15 2024 : Debug: (1) } # if (User-Name =~ /@(.*)$/) = noop ----------
Once the EAP stuff is all done, it fires off the request to the dynamic home_server:
---------- Sat Jul 13 19:28:15 2024 : Debug: (0) Proxying due to Home-Server-Name Sat Jul 13 19:28:15 2024 : Debug: (0) Starting proxy to home server 146.148.44.172 port 2083 Sat Jul 13 19:28:15 2024 : Debug: (0) proxy: Trying to allocate ID (0/2) Sat Jul 13 19:28:15 2024 : Debug: (0) proxy: Trying to open a new listener to the home server Sat Jul 13 19:28:15 2024 : Debug: Waking up in 0.1 seconds. Sat Jul 13 19:28:15 2024 : Info: ... shutting down socket command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:15 2024 : Debug: ... cleaning up socket command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:15 2024 : Debug: Waking up in 0.1 seconds. Sat Jul 13 19:28:15 2024 : Debug: (TLS) Trying new outgoing proxy connection to proxy (0.0.0.0, 0) -> home_server (146.148.44.172, 2083) [snip] Sat Jul 13 19:28:16 2024 : Auth: (4) Login OK: [anonymous@openroaming.goog ] Sat Jul 13 19:28:16 2024 : Debug: (4) Sent Access-Accept Id 35 Sat Jul 13 19:28:16 2024 : Debug: (4) MS-MPPE-Recv-Key = 0xaf73c99cadd7b68fe589b4a55648308437e348ce1a733f77623ef0d69faa32d4 Sat Jul 13 19:28:16 2024 : Debug: (4) MS-MPPE-Send-Key = 0x2f965f6006a00599da680104627ddc25271e67dc3bc5f8e1491668d39e04cc77 Sat Jul 13 19:28:16 2024 : Debug: (4) EAP-Message = 0x031a0004 Sat Jul 13 19:28:16 2024 : Debug: (4) Message-Authenticator = 0x1e4dbd72d829dc1f639bf159e99556ce Sat Jul 13 19:28:16 2024 : Debug: (4) User-Name = " anonymous@openroaming.goog" --------
And the user is authed successfully.
Now, when the accounting start packet comes in, it fails to see that the home_server file exists, tries to create it again, fails, then doesn't proxy it:
-------- Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) -> TRUE Sat Jul 13 19:28:17 2024 : Debug: (8) if (User-Name =~ /@(.*)$/) { Sat Jul 13 19:28:17 2024 : Debug: (8) switch %{home_server_dynamic:%{1}} { Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{home_server_dynamic:%{1}} Sat Jul 13 19:28:17 2024 : Debug: (8) --> Sat Jul 13 19:28:17 2024 : Debug: (8) case { Sat Jul 13 19:28:17 2024 : Debug: (8) update control { Sat Jul 13 19:28:17 2024 : Debug: (8) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: Sat Jul 13 19:28:17 2024 : Debug: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: xlat --> config Sat Jul 13 19:28:17 2024 : Debug: { Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: literal --> /mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: confdir Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND confdir Sat Jul 13 19:28:17 2024 : Debug: (8) --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: (8) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh Sat Jul 13 19:28:17 2024 : Debug: %{config:confdir} Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: xlat --> config Sat Jul 13 19:28:17 2024 : Debug: { Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: confdir Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: literal --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND confdir Sat Jul 13 19:28:17 2024 : Debug: (8) --> confdir Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{config:confdir} Sat Jul 13 19:28:17 2024 : Debug: (8) --> /usr/local/etc/raddb Sat Jul 13 19:28:17 2024 : Debug: %{1} Sat Jul 13 19:28:17 2024 : Debug: Parsed xlat tree: Sat Jul 13 19:28:17 2024 : Debug: regex-var --> 1 Sat Jul 13 19:28:17 2024 : Debug: (8) EXPAND %{1} Sat Jul 13 19:28:17 2024 : Debug: (8) --> openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: Waking up in 0.3 seconds. Sat Jul 13 19:28:17 2024 : Debug: ... new connection request on command socket Sat Jul 13 19:28:17 2024 : Debug: Listening on command file /usr/local/var/run/radiusd/radiusd.sock Sat Jul 13 19:28:17 2024 : Debug: Waking up in 0.2 seconds. Sat Jul 13 19:28:17 2024 : Debug: radmin> add home_server file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/openroaming.goog Sat Jul 13 19:28:17 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/tls.conf Sat Jul 13 19:28:17 2024 : Debug: home_server openroaming.goog { Sat Jul 13 19:28:17 2024 : Debug: nonblock = no Sat Jul 13 19:28:17 2024 : Debug: ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] Sat Jul 13 19:28:17 2024 : Debug: port = 2083 Sat Jul 13 19:28:17 2024 : Debug: type = "auth" Sat Jul 13 19:28:17 2024 : Debug: proto = "tcp" Sat Jul 13 19:28:17 2024 : Debug: secret = "radsec" Sat Jul 13 19:28:17 2024 : Debug: response_window = 30.000000 Sat Jul 13 19:28:17 2024 : Debug: response_timeouts = 1 Sat Jul 13 19:28:17 2024 : Debug: max_outstanding = 65536 Sat Jul 13 19:28:17 2024 : Debug: zombie_period = 40 Sat Jul 13 19:28:17 2024 : Debug: status_check = "none" Sat Jul 13 19:28:17 2024 : Debug: ping_interval = 30 Sat Jul 13 19:28:17 2024 : Debug: check_timeout = 4 Sat Jul 13 19:28:17 2024 : Debug: num_answers_to_alive = 3 Sat Jul 13 19:28:17 2024 : Debug: revive_interval = 300 Sat Jul 13 19:28:17 2024 : Debug: limit { Sat Jul 13 19:28:17 2024 : Debug: max_connections = 16 Sat Jul 13 19:28:17 2024 : Debug: max_requests = 0 Sat Jul 13 19:28:17 2024 : Debug: lifetime = 0 Sat Jul 13 19:28:17 2024 : Debug: idle_timeout = 0 Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: coa { Sat Jul 13 19:28:17 2024 : Debug: irt = 2 Sat Jul 13 19:28:17 2024 : Debug: mrt = 16 Sat Jul 13 19:28:17 2024 : Debug: mrc = 5 Sat Jul 13 19:28:17 2024 : Debug: mrd = 30 Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: recv_coa { Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Debug: tls { Sat Jul 13 19:28:17 2024 : Debug: verify_depth = 0 Sat Jul 13 19:28:17 2024 : Debug: pem_file_type = yes Sat Jul 13 19:28:17 2024 : Debug: private_key_file = "/usr/local/etc/raddb/certs/x.key" Sat Jul 13 19:28:17 2024 : Debug: certificate_file = "/usr/local/etc/raddb/certs/x.crt" Sat Jul 13 19:28:17 2024 : Debug: ca_file = "/usr/local/etc/raddb/certs/ca/x.ca" Sat Jul 13 19:28:17 2024 : Debug: private_key_password = "" Sat Jul 13 19:28:17 2024 : Debug: fragment_size = 8192 Sat Jul 13 19:28:17 2024 : Debug: include_length = yes Sat Jul 13 19:28:17 2024 : Debug: check_crl = no Sat Jul 13 19:28:17 2024 : Debug: cipher_list = "ALL" Sat Jul 13 19:28:17 2024 : Debug: ca_path_reload_interval = 0 Sat Jul 13 19:28:17 2024 : Debug: ecdh_curve = "prime256v1" Sat Jul 13 19:28:17 2024 : Debug: tls_max_version = "1.3" Sat Jul 13 19:28:17 2024 : Debug: tls_min_version = "1.2" Sat Jul 13 19:28:17 2024 : Debug: } Sat Jul 13 19:28:17 2024 : Error: /usr/local/etc/raddb/home_servers/ openroaming.goog[1]: Duplicate home server name openroaming.goog ERROR: Unable to add home server - Failed adding home_server to the internal data structures --------
Is this a bug, or am I missing something? It appears %{home_server_dynamic:%{1} is not working for accounting packets. Is it because type = "auth" is configured in the dynamically created home_server file and it doesn't realise it should also use it for accounting? p.s. it seems the dynamic home_server files do not allow type = "auth+acct", is that correct? You can't create two home_server files with the same name either, so what should I do?
The %{home_server_dynamic:%{1} check in subsequent authentication packets works as expected so it only seems to affect accounting.
Thanks,
James
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 15, 2024, at 9:40 AM, James Wood via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I upgraded from 3.2.3 to 3.2.5 and had the same problem. Is there a different way I should be checking for the existence of a dynamic home_server?
We've pushed a fix: https://github.com/FreeRADIUS/freeradius-server/commit/e4f090e692fe457eed01e... Alan DeKok.
Brilliant, testing now, To confirm, we can now use type = "auth+acct" as the configuration for dynamic home servers? On Mon, 15 Jul 2024 at 17:42, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 15, 2024, at 9:40 AM, James Wood via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
I upgraded from 3.2.3 to 3.2.5 and had the same problem. Is there a different way I should be checking for the existence of a dynamic home_server?
We've pushed a fix: https://github.com/FreeRADIUS/freeradius-server/commit/e4f090e692fe457eed01e...
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Unfortunately this breaks it... it now doesn't even find the dynamically added home server for authentication requests: Mon Jul 15 19:08:11 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) { Mon Jul 15 19:08:11 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) -> TRUE Mon Jul 15 19:08:11 2024 : Debug: (0) if (User-Name =~ /@(.*)$/) { Mon Jul 15 19:08:11 2024 : Debug: (0) switch %{home_server_dynamic:%{1}} { Mon Jul 15 19:08:11 2024 : Debug: (0) EXPAND %{home_server_dynamic:%{1}} Mon Jul 15 19:08:11 2024 : Debug: (0) --> Mon Jul 15 19:08:11 2024 : Debug: (0) case { Mon Jul 15 19:08:11 2024 : Debug: (0) update control { Mon Jul 15 19:08:11 2024 : Debug: (0) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: Mon Jul 15 19:08:11 2024 : Debug: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Mon Jul 15 19:08:11 2024 : Debug: Parsed xlat tree: Mon Jul 15 19:08:11 2024 : Debug: xlat --> config Mon Jul 15 19:08:11 2024 : Debug: { Mon Jul 15 19:08:11 2024 : Debug: literal --> confdir Mon Jul 15 19:08:11 2024 : Debug: } Mon Jul 15 19:08:11 2024 : Debug: literal --> /mods-config/realm/freeradius-naptr-to-home-server.sh Mon Jul 15 19:08:11 2024 : Debug: confdir Mon Jul 15 19:08:11 2024 : Debug: Parsed xlat tree: Mon Jul 15 19:08:11 2024 : Debug: literal --> confdir Mon Jul 15 19:08:11 2024 : Debug: (0) EXPAND confdir Mon Jul 15 19:08:11 2024 : Debug: (0) --> confdir Mon Jul 15 19:08:11 2024 : Debug: (0) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh Mon Jul 15 19:08:11 2024 : Debug: (0) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh Mon Jul 15 19:08:11 2024 : Debug: %{config:confdir} Mon Jul 15 19:08:11 2024 : Debug: Parsed xlat tree: Mon Jul 15 19:08:11 2024 : Debug: xlat --> config Mon Jul 15 19:08:11 2024 : Debug: { Mon Jul 15 19:08:11 2024 : Debug: literal --> confdir Mon Jul 15 19:08:11 2024 : Debug: } Mon Jul 15 19:08:11 2024 : Debug: confdir Mon Jul 15 19:08:11 2024 : Debug: Parsed xlat tree: Mon Jul 15 19:08:11 2024 : Debug: literal --> confdir Mon Jul 15 19:08:11 2024 : Debug: (0) EXPAND confdir Mon Jul 15 19:08:11 2024 : Debug: (0) --> confdir Mon Jul 15 19:08:11 2024 : Debug: (0) EXPAND %{config:confdir} Mon Jul 15 19:08:11 2024 : Debug: (0) --> /usr/local/etc/raddb Mon Jul 15 19:08:11 2024 : Debug: %{1} Mon Jul 15 19:08:11 2024 : Debug: Parsed xlat tree: Mon Jul 15 19:08:11 2024 : Debug: regex-var --> 1 Mon Jul 15 19:08:11 2024 : Debug: (0) EXPAND %{1} Mon Jul 15 19:08:11 2024 : Debug: (0) --> openroaming.goog Mon Jul 15 19:08:11 2024 : Debug: Waking up in 0.3 seconds. Mon Jul 15 19:08:11 2024 : Debug: ... new connection request on command socket Mon Jul 15 19:08:11 2024 : Debug: Listening on command file /usr/local/var/run/radiusd/radiusd.sock Mon Jul 15 19:08:11 2024 : Debug: Waking up in 0.1 seconds. Mon Jul 15 19:08:11 2024 : Debug: radmin> add home_server file /usr/local/etc/raddb/home_servers/openroaming.goog Mon Jul 15 19:08:11 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/openroaming.goog Mon Jul 15 19:08:11 2024 : Debug: including configuration file /usr/local/etc/raddb/home_servers/tls.conf Mon Jul 15 19:08:11 2024 : Debug: home_server openroaming.goog { Mon Jul 15 19:08:11 2024 : Debug: nonblock = no Mon Jul 15 19:08:11 2024 : Debug: ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] Mon Jul 15 19:08:11 2024 : Debug: port = 2083 Mon Jul 15 19:08:11 2024 : Debug: type = "auth+acct" Mon Jul 15 19:08:11 2024 : Debug: proto = "tcp" Mon Jul 15 19:08:11 2024 : Debug: secret = "radsec" Mon Jul 15 19:08:11 2024 : Debug: response_window = 30.000000 Mon Jul 15 19:08:11 2024 : Debug: response_timeouts = 1 Mon Jul 15 19:08:11 2024 : Debug: max_outstanding = 65536 Mon Jul 15 19:08:11 2024 : Debug: zombie_period = 40 Mon Jul 15 19:08:11 2024 : Debug: status_check = "none" Mon Jul 15 19:08:11 2024 : Debug: ping_interval = 30 Mon Jul 15 19:08:11 2024 : Debug: check_timeout = 4 Mon Jul 15 19:08:11 2024 : Debug: num_answers_to_alive = 3 Mon Jul 15 19:08:11 2024 : Debug: revive_interval = 300 Mon Jul 15 19:08:11 2024 : Debug: limit { Mon Jul 15 19:08:11 2024 : Debug: max_connections = 16 Mon Jul 15 19:08:11 2024 : Debug: max_requests = 0 Mon Jul 15 19:08:11 2024 : Debug: lifetime = 0 Mon Jul 15 19:08:11 2024 : Debug: idle_timeout = 0 Mon Jul 15 19:08:11 2024 : Debug: } Mon Jul 15 19:08:11 2024 : Debug: coa { Mon Jul 15 19:08:11 2024 : Debug: irt = 2 Mon Jul 15 19:08:11 2024 : Debug: mrt = 16 Mon Jul 15 19:08:11 2024 : Debug: mrc = 5 Mon Jul 15 19:08:11 2024 : Debug: mrd = 30 Mon Jul 15 19:08:11 2024 : Debug: } Mon Jul 15 19:08:11 2024 : Debug: recv_coa { Mon Jul 15 19:08:11 2024 : Debug: } Mon Jul 15 19:08:11 2024 : Debug: } Mon Jul 15 19:08:11 2024 : Debug: tls { Mon Jul 15 19:08:11 2024 : Debug: verify_depth = 0 Mon Jul 15 19:08:11 2024 : Debug: pem_file_type = yes Mon Jul 15 19:08:11 2024 : Debug: private_key_file = "/usr/local/etc/raddb/certs/new/wba/x.key" Mon Jul 15 19:08:11 2024 : Debug: certificate_file = "/usr/local/etc/raddb/certs/new/wba/x.crt" Mon Jul 15 19:08:11 2024 : Debug: ca_file = "/usr/local/etc/raddb/certs/new/wba/x.ca" Mon Jul 15 19:08:11 2024 : Debug: fragment_size = 8192 Mon Jul 15 19:08:11 2024 : Debug: include_length = yes Mon Jul 15 19:08:11 2024 : Debug: check_crl = no Mon Jul 15 19:08:11 2024 : Debug: cipher_list = "ALL" Mon Jul 15 19:08:11 2024 : Debug: ca_path_reload_interval = 0 Mon Jul 15 19:08:11 2024 : Debug: ecdh_curve = "prime256v1" Mon Jul 15 19:08:11 2024 : Debug: tls_max_version = "1.3" Mon Jul 15 19:08:11 2024 : Debug: tls_min_version = "1.2" Mon Jul 15 19:08:11 2024 : Debug: } Mon Jul 15 19:08:11 2024 : Debug: (0) Program returned code (0) and output 'openroaming.goog' Mon Jul 15 19:08:11 2024 : Debug: (0) &Temp-Home-Server-String := openroaming.goog Mon Jul 15 19:08:11 2024 : Debug: (0) } # update control = noop Mon Jul 15 19:08:11 2024 : Debug: (0) if (&control:Temp-Home-Server-String == "" ) { Mon Jul 15 19:08:11 2024 : Debug: (0) if (&control:Temp-Home-Server-String == "" ) -> FALSE Mon Jul 15 19:08:11 2024 : Debug: (0) else { Mon Jul 15 19:08:11 2024 : Debug: (0) update control { Mon Jul 15 19:08:11 2024 : Debug: (0) EXPAND %{1} Mon Jul 15 19:08:11 2024 : Debug: (0) --> openroaming.goog Mon Jul 15 19:08:11 2024 : Debug: (0) &Home-Server-Name := openroaming.goog Mon Jul 15 19:08:11 2024 : Debug: (0) } # update control = noop Mon Jul 15 19:08:11 2024 : Debug: (0) } # else = noop Mon Jul 15 19:08:11 2024 : Debug: (0) } # case = noop Mon Jul 15 19:08:11 2024 : Debug: (0) } # switch %{home_server_dynamic:%{1}} = noop Mon Jul 15 19:08:11 2024 : Debug: (0) } # if (User-Name =~ /@(.*)$/) = noop Mon Jul 15 19:08:11 2024 : Debug: (0) modsingle[authorize]: calling suffix (rlm_realm) Mon Jul 15 19:08:11 2024 : Debug: (0) suffix: Checking for suffix after "@" Mon Jul 15 19:08:11 2024 : Debug: (0) suffix: Looking up realm " openroaming.goog" for User-Name = "anonymous@openroaming.goog" Mon Jul 15 19:08:11 2024 : Debug: (0) suffix: No such realm " openroaming.goog" Mon Jul 15 19:08:11 2024 : Debug: (0) modsingle[authorize]: returned from suffix (rlm_realm) Mon Jul 15 19:08:11 2024 : Debug: (0) [suffix] = noop Mon Jul 15 19:08:11 2024 : Debug: (0) modsingle[authorize]: calling chap (rlm_chap) Mon Jul 15 19:08:11 2024 : Debug: (0) modsingle[authorize]: returned from chap (rlm_chap) Mon Jul 15 19:08:11 2024 : Debug: (0) [chap] = noop Mon Jul 15 19:08:11 2024 : Debug: (0) modsingle[authorize]: calling eap (rlm_eap) Mon Jul 15 19:08:11 2024 : Debug: (0) eap: Peer sent EAP Response (code 2) ID 171 length 31 Mon Jul 15 19:08:11 2024 : Debug: (0) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the rest of authorize Mon Jul 15 19:08:11 2024 : Debug: (0) modsingle[authorize]: returned from eap (rlm_eap) Mon Jul 15 19:08:11 2024 : Debug: (0) [eap] = ok Mon Jul 15 19:08:11 2024 : Debug: (0) } # authorize = ok Mon Jul 15 19:08:11 2024 : Debug: (0) Proxying due to Home-Server-Name Mon Jul 15 19:08:11 2024 : WARNING: (0) No such home server openroaming.goog Mon Jul 15 19:08:11 2024 : Debug: (0) There was no response configured: rejecting request Mon Jul 15 19:08:11 2024 : Debug: (0) Using Post-Auth-Type Reject The contents of home_servers/openroaming.goog: home_server openroaming.goog { ipaddr = radsec.openroaming.goog port = 2083 $INCLUDE tls.conf } and tls.conf: proto = tcp type = "auth+acct" secret = radsec tls { tls_min_version = "1.2" tls_max_version = "1.3" certificate_file = /usr/local/etc/raddb/certs/new/wba/x.crt private_key_file = /usr/local/etc/raddb/certs/new/wba/x.key ca_file = /usr/local/etc/raddb/certs/new/wba/x.ca fragment_size = 8192 cipher_list = "ALL" } Is it because of the new type = "auth+acct" being set? It's not finding a home server to use now? Thanks On Mon, 15 Jul 2024 at 17:42, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 15, 2024, at 9:40 AM, James Wood via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
I upgraded from 3.2.3 to 3.2.5 and had the same problem. Is there a different way I should be checking for the existence of a dynamic home_server?
We've pushed a fix: https://github.com/FreeRADIUS/freeradius-server/commit/e4f090e692fe457eed01e...
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 15, 2024, at 3:14 PM, James Wood via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Unfortunately this breaks it... it now doesn't even find the dynamically added home server for authentication requests:
Please use "radiusd -X". Adding more "-x" doesn't help. Please try the fix in https://github.com/FreeRADIUS/freeradius-server/commit/76e3504728eb6c986d8bc... Alan DeKok.
Thanks for the patch, but unfortunately it still doesn't detect the newly added home server: (0) Received Access-Request Id 23 (0) User-Name = "anonymous@openroaming.goog" (0) NAS-IP-Address = 192.168.1.116 (0) NAS-Identifier = "E0-CB-BC-8A-1A-6E:vap2" (0) Called-Station-Id = "EA-CB-BC-8A-1A-6E:OpenRoaming" (0) NAS-Port-Type = Wireless-802.11 (0) Service-Type = Framed-User (0) NAS-Port = 1 (0) Calling-Station-Id = "EA-67-EB-42-53-54" (0) Connect-Info = "CONNECT 54.00 Mbps / 802.11ac / RSSI: 24 / Channel: 11" (0) Acct-Session-Id = "F31127A5FD1096A9" (0) Acct-Multi-Session-Id = "DF5D82378001D0A8" (0) WLAN-Pairwise-Cipher = 1027076 (0) WLAN-Group-Cipher = 1027076 (0) WLAN-AKM-Suite = 1027073 (0) Meraki-Ap-Name = "meraki-mr42-test-ap" (0) Meraki-Ap-Tags = " recently-added " (0) Meraki-Device-Name = "meraki-mr42-test-ap" (0) Framed-MTU = 1400 (0) EAP-Message = 0x02d7001f01616e6f6e796d6f7573406f70656e726f616d696e672e676f6f67 (0) HS20-AP-Version = 1 (0) HS20-Mobile-Device-Version = 0x010000 (0) HS20-Roaming-Consortium = 0x5a03ba0000 (0) Message-Authenticator = 0xa19f2c8cbd0ed22319bc5601aea1e902 (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default (0) authorize { (0) [preprocess] = ok (0) policy openroaming_lookup { (0) if (User-Name =~ /@(.*)$/) { (0) if (User-Name =~ /@(.*)$/) -> TRUE (0) if (User-Name =~ /@(.*)$/) { (0) switch %{home_server_dynamic:%{1}} { (0) EXPAND %{home_server_dynamic:%{1}} (0) --> (0) case { (0) update control { (0) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: (0) EXPAND confdir (0) --> confdir (0) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh (0) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh (0) EXPAND confdir (0) --> confdir (0) EXPAND %{config:confdir} (0) --> /usr/local/etc/raddb (0) EXPAND %{1} (0) --> openroaming.goog Waking up in 0.3 seconds. ... new connection request on command socket Listening on command file /usr/local/var/run/radiusd/radiusd.sock Waking up in 0.1 seconds. radmin> add home_server file /usr/local/etc/raddb/home_servers/ openroaming.goog including configuration file /usr/local/etc/raddb/home_servers/ openroaming.goog including configuration file /usr/local/etc/raddb/home_servers/tls.conf home_server openroaming.goog { nonblock = no ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] port = 2083 type = "auth+acct" proto = "tcp" secret = <<< secret >>> response_window = 30.000000 response_timeouts = 1 max_outstanding = 65536 zombie_period = 40 status_check = "none" ping_interval = 30 check_timeout = 4 num_answers_to_alive = 3 revive_interval = 300 limit { max_connections = 16 max_requests = 0 lifetime = 0 idle_timeout = 0 } coa { irt = 2 mrt = 16 mrc = 5 mrd = 30 } recv_coa { } } tls { verify_depth = 0 pem_file_type = yes private_key_file = "/usr/local/etc/raddb/certs/new/wba/x.key" certificate_file = "/usr/local/etc/raddb/certs/new/wba/x.crt" ca_file = "/usr/local/etc/raddb/certs/new/wba/x.ca" private_key_password = <<< secret >>> fragment_size = 8192 include_length = yes check_crl = no cipher_list = "ALL" ca_path_reload_interval = 0 ecdh_curve = "prime256v1" tls_max_version = "1.3" tls_min_version = "1.2" } (0) Program returned code (0) and output 'openroaming.goog' (0) &Temp-Home-Server-String := openroaming.goog (0) } # update control = noop (0) if (&control:Temp-Home-Server-String == "" ) { (0) if (&control:Temp-Home-Server-String == "" ) -> FALSE (0) else { (0) update control { (0) EXPAND %{1} (0) --> openroaming.goog (0) &Home-Server-Name := openroaming.goog (0) } # update control = noop (0) } # else = noop (0) } # case = noop (0) } # switch %{home_server_dynamic:%{1}} = noop (0) } # if (User-Name =~ /@(.*)$/) = noop (0) } # policy openroaming_lookup = noop (0) suffix: Checking for suffix after "@" (0) suffix: Looking up realm "openroaming.goog" for User-Name = " anonymous@openroaming.goog" (0) suffix: No such realm "openroaming.goog" (0) [suffix] = noop (0) [chap] = noop (0) eap: Peer sent EAP Response (code 2) ID 215 length 31 (0) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the rest of authorize (0) [eap] = ok (0) } # authorize = ok (0) Proxying due to Home-Server-Name (0) WARNING: No such home server openroaming.goog (0) There was no response configured: rejecting request (0) Using Post-Auth-Type Reject (0) Login incorrect: [anonymous@openroaming.goog/<via Auth-Type = eap>] (0) Sent Access-Reject Id 23 If I restart the server with the dynamic home_server existing (added in previous request), it finds it but still fails to proxy with the same error "No such home server openroaming.goog": Ready to process requests Thread 4 got semaphore Thread 4 handling request 1, (1 handled so far) (1) Received Access-Request Id 47 (1) User-Name = "anonymous@openroaming.goog" (1) NAS-IP-Address = 192.168.1.116 (1) NAS-Identifier = "E0-CB-BC-8A-1A-6E:vap2" (1) Called-Station-Id = "EA-CB-AC-8A-1A-6E:OpenRoaming" (1) NAS-Port-Type = Wireless-802.11 (1) Service-Type = Framed-User (1) NAS-Port = 1 (1) Calling-Station-Id = "EA-67-EB-42-53-54" (1) Connect-Info = "CONNECT 54.00 Mbps / 802.11ac / RSSI: 24 / Channel: 40" (1) Acct-Session-Id = "6B0E19729A2182BD" (1) Acct-Multi-Session-Id = "50ADAEDCDD91F194" (1) WLAN-Pairwise-Cipher = 1027076 (1) WLAN-Group-Cipher = 1027076 (1) WLAN-AKM-Suite = 1027073 (1) Meraki-Ap-Name = "meraki-mr42-test-ap" (1) Meraki-Ap-Tags = " recently-added " (1) Meraki-Device-Name = "meraki-mr42-test-ap" (1) Framed-MTU = 1400 (1) EAP-Message = 0x028a001f01616e6f6e796d6f7573406f70656e726f616d696e672e676f6f67 (1) HS20-AP-Version = 1 (1) HS20-Mobile-Device-Version = 0x010000 (1) HS20-Roaming-Consortium = 0x5a03ba0000 (1) Message-Authenticator = 0x47f64e212bc52c41b171fcfa5b5879dc (1) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default (1) authorize { (1) [preprocess] = ok (1) policy openroaming_lookup { (1) if (User-Name =~ /@(.*)$/) { (1) if (User-Name =~ /@(.*)$/) -> TRUE (1) if (User-Name =~ /@(.*)$/) { (1) switch %{home_server_dynamic:%{1}} { (1) EXPAND %{home_server_dynamic:%{1}} (1) --> 1 (1) case 1 { (1) update control { (1) EXPAND %{1} (1) --> openroaming.goog (1) &Home-Server-Name := openroaming.goog (1) } # update control = noop (1) } # case 1 = noop (1) } # switch %{home_server_dynamic:%{1}} = noop (1) } # if (User-Name =~ /@(.*)$/) = noop (1) } # policy openroaming_lookup = noop (1) policy username_lookup { (1) suffix: Checking for suffix after "@" (1) suffix: Looking up realm "openroaming.goog" for User-Name = " anonymous@openroaming.goog" (1) suffix: No such realm "openroaming.goog" (1) [suffix] = noop (1) [chap] = noop (1) eap: Peer sent EAP Response (code 2) ID 138 length 31 (1) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the rest of authorize (1) [eap] = ok (1) } # authorize = ok (1) Proxying due to Home-Server-Name (1) WARNING: No such home server openroaming.goog (1) There was no response configured: rejecting request (1) Using Post-Auth-Type Reject (1) Login incorrect: [anonymous@openroaming.goog/<via Auth-Type = eap>] (1) Sent Access-Reject Id 47 On Mon, 15 Jul 2024 at 20:52, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 15, 2024, at 3:14 PM, James Wood via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
Unfortunately this breaks it... it now doesn't even find the dynamically added home server for authentication requests:
Please use "radiusd -X". Adding more "-x" doesn't help.
Please try the fix in https://github.com/FreeRADIUS/freeradius-server/commit/76e3504728eb6c986d8bc...
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
I re-patched and it now correctly finds the dynamic home server for both auth and acct packets - great! (Your two recent commits have worked nicely, thanks!) Next issue... despite "Home-Server-Name" being set it is NOT proxying these and just handles it locally. I don't see any "Proxying due to Home-Server-Name" in the log for accounting, where I do for authentication: (1) Received Accounting-Request Id 66 (1) Acct-Status-Type = Start (1) Acct-Authentic = RADIUS (1) User-Name = "anonymous@openroaming.goog" (1) NAS-IP-Address = 192.168.1.116 (1) NAS-Identifier = "E0-CB-BC-8A-1A-6E:vap2" (1) Called-Station-Id = "EA-CB-AC-8A-1A-6E:OpenRoaming" (1) NAS-Port-Type = Wireless-802.11 (1) Service-Type = Framed-User (1) NAS-Port = 1 (1) Calling-Station-Id = "EA-67-EB-42-53-54" (1) Connect-Info = "CONNECT 54.00 Mbps / 802.11ac / RSSI: 57 / Channel: 40" (1) Acct-Session-Id = "BDB585FC8CAC8F6C" (1) WLAN-Pairwise-Cipher = 1027076 (1) WLAN-Group-Cipher = 1027076 (1) WLAN-AKM-Suite = 1027073 (1) Meraki-Device-Name = "meraki-mr42-test-ap" (1) Framed-IP-Address = 10.94.136.91 (1) Event-Timestamp = "Jul 16 2024 12:41:35 UTC" (1) Acct-Delay-Time = 0 (1) # Executing section preacct from file /usr/local/etc/raddb/sites-enabled/default (1) preacct { (1) [preprocess] = ok (1) policy openroaming_lookup { (1) if (User-Name =~ /@(.*)$/) { (1) if (User-Name =~ /@(.*)$/) -> TRUE (1) if (User-Name =~ /@(.*)$/) { (1) switch %{home_server_dynamic:%{1}} { (1) EXPAND %{home_server_dynamic:%{1}} (1) --> 1 (1) case 1 { (1) update control { (1) EXPAND %{1} (1) --> openroaming.goog (1) &Home-Server-Name := openroaming.goog (1) } # update control = noop (1) } # case 1 = noop (1) } # switch %{home_server_dynamic:%{1}} = noop (1) } # if (User-Name =~ /@(.*)$/) = noop (1) } # policy openroaming_lookup = noop (1) suffix: Checking for suffix after "@" (1) suffix: Looking up realm "openroaming.goog" for User-Name = " anonymous@openroaming.goog" (1) suffix: No such realm "openroaming.goog" (1) [suffix] = noop (1) } # preacct = updated (1) # Executing section accounting from file /usr/local/etc/raddb/sites-enabled/default (1) accounting { (1) attr_filter.accounting_response: EXPAND %{User-Name} (1) attr_filter.accounting_response: --> anonymous@openroaming.goog (1) attr_filter.accounting_response: Matched entry DEFAULT at line 12 (1) [attr_filter.accounting_response] = updated (1) if (noop) { (1) if (noop) -> FALSE (1) } # accounting = updated (1) Sent Accounting-Response Id 66 (1) Finished request Thread 4 waiting to be assigned a request (1) Cleaning up request packet ID 66 with timestamp +19 due to timer Ready to process requests Is there something I need to set to also proxy accounting packets to dynamically added home servers? Thanks On Mon, 15 Jul 2024 at 21:52, James Wood <james.wood@purplewifi.com> wrote:
Thanks for the patch, but unfortunately it still doesn't detect the newly added home server:
(0) Received Access-Request Id 23 (0) User-Name = "anonymous@openroaming.goog" (0) NAS-IP-Address = 192.168.1.116 (0) NAS-Identifier = "E0-CB-BC-8A-1A-6E:vap2" (0) Called-Station-Id = "EA-CB-BC-8A-1A-6E:OpenRoaming" (0) NAS-Port-Type = Wireless-802.11 (0) Service-Type = Framed-User (0) NAS-Port = 1 (0) Calling-Station-Id = "EA-67-EB-42-53-54" (0) Connect-Info = "CONNECT 54.00 Mbps / 802.11ac / RSSI: 24 / Channel: 11" (0) Acct-Session-Id = "F31127A5FD1096A9" (0) Acct-Multi-Session-Id = "DF5D82378001D0A8" (0) WLAN-Pairwise-Cipher = 1027076 (0) WLAN-Group-Cipher = 1027076 (0) WLAN-AKM-Suite = 1027073 (0) Meraki-Ap-Name = "meraki-mr42-test-ap" (0) Meraki-Ap-Tags = " recently-added " (0) Meraki-Device-Name = "meraki-mr42-test-ap" (0) Framed-MTU = 1400 (0) EAP-Message = 0x02d7001f01616e6f6e796d6f7573406f70656e726f616d696e672e676f6f67 (0) HS20-AP-Version = 1 (0) HS20-Mobile-Device-Version = 0x010000 (0) HS20-Roaming-Consortium = 0x5a03ba0000 (0) Message-Authenticator = 0xa19f2c8cbd0ed22319bc5601aea1e902 (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default (0) authorize { (0) [preprocess] = ok (0) policy openroaming_lookup { (0) if (User-Name =~ /@(.*)$/) { (0) if (User-Name =~ /@(.*)$/) -> TRUE (0) if (User-Name =~ /@(.*)$/) { (0) switch %{home_server_dynamic:%{1}} { (0) EXPAND %{home_server_dynamic:%{1}} (0) --> (0) case { (0) update control { (0) Executing: %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh -d %{config:confdir} %{1} aaa+auth:radius.tls.tcp: (0) EXPAND confdir (0) --> confdir (0) EXPAND %{config:confdir}/mods-config/realm/freeradius-naptr-to-home-server.sh (0) --> /usr/local/etc/raddb/mods-config/realm/freeradius-naptr-to-home-server.sh (0) EXPAND confdir (0) --> confdir (0) EXPAND %{config:confdir} (0) --> /usr/local/etc/raddb (0) EXPAND %{1} (0) --> openroaming.goog Waking up in 0.3 seconds. ... new connection request on command socket Listening on command file /usr/local/var/run/radiusd/radiusd.sock Waking up in 0.1 seconds. radmin> add home_server file /usr/local/etc/raddb/home_servers/ openroaming.goog including configuration file /usr/local/etc/raddb/home_servers/ openroaming.goog including configuration file /usr/local/etc/raddb/home_servers/tls.conf home_server openroaming.goog { nonblock = no ipaddr = radsec.openroaming.goog IPv4 address [146.148.44.172] port = 2083 type = "auth+acct" proto = "tcp" secret = <<< secret >>> response_window = 30.000000 response_timeouts = 1 max_outstanding = 65536 zombie_period = 40 status_check = "none" ping_interval = 30 check_timeout = 4 num_answers_to_alive = 3 revive_interval = 300 limit { max_connections = 16 max_requests = 0 lifetime = 0 idle_timeout = 0 } coa { irt = 2 mrt = 16 mrc = 5 mrd = 30 } recv_coa { } } tls { verify_depth = 0 pem_file_type = yes private_key_file = "/usr/local/etc/raddb/certs/new/wba/x.key" certificate_file = "/usr/local/etc/raddb/certs/new/wba/x.crt" ca_file = "/usr/local/etc/raddb/certs/new/wba/x.ca" private_key_password = <<< secret >>> fragment_size = 8192 include_length = yes check_crl = no cipher_list = "ALL" ca_path_reload_interval = 0 ecdh_curve = "prime256v1" tls_max_version = "1.3" tls_min_version = "1.2" } (0) Program returned code (0) and output 'openroaming.goog' (0) &Temp-Home-Server-String := openroaming.goog (0) } # update control = noop (0) if (&control:Temp-Home-Server-String == "" ) { (0) if (&control:Temp-Home-Server-String == "" ) -> FALSE (0) else { (0) update control { (0) EXPAND %{1} (0) --> openroaming.goog (0) &Home-Server-Name := openroaming.goog (0) } # update control = noop (0) } # else = noop (0) } # case = noop (0) } # switch %{home_server_dynamic:%{1}} = noop (0) } # if (User-Name =~ /@(.*)$/) = noop (0) } # policy openroaming_lookup = noop (0) suffix: Checking for suffix after "@" (0) suffix: Looking up realm "openroaming.goog" for User-Name = " anonymous@openroaming.goog" (0) suffix: No such realm "openroaming.goog" (0) [suffix] = noop (0) [chap] = noop (0) eap: Peer sent EAP Response (code 2) ID 215 length 31 (0) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the rest of authorize (0) [eap] = ok (0) } # authorize = ok (0) Proxying due to Home-Server-Name (0) WARNING: No such home server openroaming.goog (0) There was no response configured: rejecting request (0) Using Post-Auth-Type Reject (0) Login incorrect: [anonymous@openroaming.goog/<via Auth-Type = eap>] (0) Sent Access-Reject Id 23
If I restart the server with the dynamic home_server existing (added in previous request), it finds it but still fails to proxy with the same error "No such home server openroaming.goog":
Ready to process requests Thread 4 got semaphore Thread 4 handling request 1, (1 handled so far) (1) Received Access-Request Id 47 (1) User-Name = "anonymous@openroaming.goog" (1) NAS-IP-Address = 192.168.1.116 (1) NAS-Identifier = "E0-CB-BC-8A-1A-6E:vap2" (1) Called-Station-Id = "EA-CB-AC-8A-1A-6E:OpenRoaming" (1) NAS-Port-Type = Wireless-802.11 (1) Service-Type = Framed-User (1) NAS-Port = 1 (1) Calling-Station-Id = "EA-67-EB-42-53-54" (1) Connect-Info = "CONNECT 54.00 Mbps / 802.11ac / RSSI: 24 / Channel: 40" (1) Acct-Session-Id = "6B0E19729A2182BD" (1) Acct-Multi-Session-Id = "50ADAEDCDD91F194" (1) WLAN-Pairwise-Cipher = 1027076 (1) WLAN-Group-Cipher = 1027076 (1) WLAN-AKM-Suite = 1027073 (1) Meraki-Ap-Name = "meraki-mr42-test-ap" (1) Meraki-Ap-Tags = " recently-added " (1) Meraki-Device-Name = "meraki-mr42-test-ap" (1) Framed-MTU = 1400 (1) EAP-Message = 0x028a001f01616e6f6e796d6f7573406f70656e726f616d696e672e676f6f67 (1) HS20-AP-Version = 1 (1) HS20-Mobile-Device-Version = 0x010000 (1) HS20-Roaming-Consortium = 0x5a03ba0000 (1) Message-Authenticator = 0x47f64e212bc52c41b171fcfa5b5879dc (1) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default (1) authorize { (1) [preprocess] = ok (1) policy openroaming_lookup { (1) if (User-Name =~ /@(.*)$/) { (1) if (User-Name =~ /@(.*)$/) -> TRUE (1) if (User-Name =~ /@(.*)$/) { (1) switch %{home_server_dynamic:%{1}} { (1) EXPAND %{home_server_dynamic:%{1}} (1) --> 1 (1) case 1 { (1) update control { (1) EXPAND %{1} (1) --> openroaming.goog (1) &Home-Server-Name := openroaming.goog (1) } # update control = noop (1) } # case 1 = noop (1) } # switch %{home_server_dynamic:%{1}} = noop (1) } # if (User-Name =~ /@(.*)$/) = noop (1) } # policy openroaming_lookup = noop (1) policy username_lookup { (1) suffix: Checking for suffix after "@" (1) suffix: Looking up realm "openroaming.goog" for User-Name = " anonymous@openroaming.goog" (1) suffix: No such realm "openroaming.goog" (1) [suffix] = noop (1) [chap] = noop (1) eap: Peer sent EAP Response (code 2) ID 138 length 31 (1) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the rest of authorize (1) [eap] = ok (1) } # authorize = ok (1) Proxying due to Home-Server-Name (1) WARNING: No such home server openroaming.goog (1) There was no response configured: rejecting request (1) Using Post-Auth-Type Reject (1) Login incorrect: [anonymous@openroaming.goog/<via Auth-Type = eap>] (1) Sent Access-Reject Id 47
On Mon, 15 Jul 2024 at 20:52, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 15, 2024, at 3:14 PM, James Wood via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
Unfortunately this breaks it... it now doesn't even find the dynamically added home server for authentication requests:
Please use "radiusd -X". Adding more "-x" doesn't help.
Please try the fix in https://github.com/FreeRADIUS/freeradius-server/commit/76e3504728eb6c986d8bc...
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 16, 2024, at 9:00 AM, James Wood via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I re-patched and it now correctly finds the dynamic home server for both auth and acct packets - great! (Your two recent commits have worked nicely, thanks!)
Good to hear.
Next issue... despite "Home-Server-Name" being set it is NOT proxying these and just handles it locally. I don't see any "Proxying due to Home-Server-Name" in the log for accounting, where I do for authentication:
Hm... the code for accounting doesn't look for Home-Server-Name. I'll see if we can push a fix. Alan DeKok.
Thanks, let me know if / when you push a fix and I'll re-test. On Tue, 16 Jul 2024 at 14:36, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 16, 2024, at 9:00 AM, James Wood via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
I re-patched and it now correctly finds the dynamic home server for both auth and acct packets - great! (Your two recent commits have worked nicely, thanks!)
Good to hear.
Next issue... despite "Home-Server-Name" being set it is NOT proxying these and just handles it locally. I don't see any "Proxying due to Home-Server-Name" in the log for accounting, where I do for authentication:
Hm... the code for accounting doesn't look for Home-Server-Name. I'll see if we can push a fix.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 17, 2024, at 11:35 AM, James Wood via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Thanks, let me know if / when you push a fix and I'll re-test.
The home server issues should be fixed. Accounting packets should now respect "Home-Server-Name", just like authentication packets. Alan DeKok.
Tested and working. Thanks! On Wed, 17 Jul 2024 at 20:26, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 17, 2024, at 11:35 AM, James Wood via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
Thanks, let me know if / when you push a fix and I'll re-test.
The home server issues should be fixed. Accounting packets should now respect "Home-Server-Name", just like authentication packets.
Alan DeKok.
participants (2)
-
Alan DeKok -
James Wood