fix(radius): prevent devices from using sqlippool during accounting

This commit is contained in:
2026-09-16 17:04:06 +02:00
parent 8434a13338
commit 728b99e138
+14 -3
View File
@@ -648,13 +648,24 @@ accounting {
# Ensure that &control:Pool-Name is set to determine which pool of IPs are used.
# sqlippool
### rebuild Pool-Name
#
# Determine the client type.
# Devices use a fixed IP from radreply.
# Engineers use an IP from sqlippool/radippool.
#
update control {
Tmp-String-1 := "%{sql:SELECT client_type FROM node_assignments WHERE username='%{User-Name}'}"
}
#
# Return the IP to the pool only for engineers.
#
if (&control:Tmp-String-1 == "engineer") {
update control {
Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}"
}
### apply only for engineers
if (&control:Pool-Name =~ /^engineers-/) {
sqlippool
}
# Log traffic to an SQL database.