Multiple sqlippool with different Module-Success-Message values

Zoltán Kristofóri kristoforizoltan at gmail.com
Tue Feb 16 14:02:38 CET 2021


Hello Everyone!

First of all I am glad to be here!
But i got stuck on a problem. I am calling two different sqlippool module
for IP address allocation (IPv4 and IPv6). My problem is that I need send
both module result message to the linelog module. It should be easy because
the sqlippool module writes the control:Module-Success-Message.
But as far as I can see the Module-Success-Message field is not updated the
second time.

site configuration:
post-auth {
  ...
  sqlippool_v4
  log_sqlippool
  ..
  sqlippool_v6
  log_sqlippool
}

sqlippool module configuration:
sqlippool sqlippool_v4 {
...
        messages {
                exists = "Existing IPv4: %{reply:${..attribute_name}} (did
%{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user
%{User-Name})"
                success = "Allocated IPv4: %{reply:${..attribute_name}}
from %{control:Pool-Name} (did %{Called-Station-Id} cli
%{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
...

sqlippool sqlippool_v6 {
...
        messages {
                exists = "Existing IPv6: %{reply:${..attribute_name}} (did
%{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user
%{User-Name})"
                success = "Allocated IPv6: %{reply:${..attribute_name}}
from %{control:Pool-Name} (did %{Called-Station-Id} cli
%{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
...

linelog module configuration:
...
linelog log_sqlippoolv4 {
        format = "%{control:Module-Success-Message}"
        filename = syslog
        permissions = 0600
}

Also i can see the problem in debug mode:
(1) sqlippool_v4: EXPAND Allocated IPv4: %{reply:Framed-IP-Address} from
%{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id}
port %{NAS-Port} user %{User-Name})
(1) sqlippool_v4:    --> Allocated IPv4: 10.1.1.1 from xpool (did  cli xxx
port 134219438 user x)
(1)     [sqlippool_v4] = ok
(1) log_sqlippool: EXPAND %{control:Module-Success-Message}
(1) log_sqlippool:    --> Allocated IPv4: 10.1.1.1 from xpool (did  cli xxx
port 134219438 user x)
(1)     [log_sqlippool] = ok
...
(1) sqlippool_v6: EXPAND Allocated IPv6: %{reply:Framed-IPv6-Prefix} from
%{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id}
port %{NAS-Port} user %{User-Name})
(1) sqlippool_v6:    --> Allocated IPv6: 2000:::/64 from xpool (did  cli
xxx port 134219438 user x)
(1)       [sqlippool_v6] = ok
(1) log_sqlippool: EXPAND %{control:Module-Success-Message}
(1) log_sqlippool:    --> Allocated IPv4: 10.1.1.1 from xpool (did  cli xxx
port 134219438 user x)
(1)       [log_sqlippool] = ok

Can someone please clarify what am i doing wrong here?

Regards!


More information about the Freeradius-Users mailing list