Centralized accounting and coa/disconnect
BuzzSaw Code
buzzsaw.code at gmail.com
Wed Dec 28 20:43:44 UTC 2022
>"X" isn't an IPv4 address. Or, "X" is a host name which has no IPv4
address associated with it.
It sure isn't an IPv4 address, what we have is an IPv6 address which
is why I originally asked if an IPv6 specific dictionary item needed
to be added to make this work.
As for "saying what I did" I've been trying to - without making any
other changes to the default configuration and simply testing this on
a development host, we did this:
In "coa-relay":
..
foreach &control:Tmp-String-0 {
if ("%{Foreach-Variable-0}" =~ /([^#]*)#(.*)/) {
update request {
COA-Packet-Type :=
"%{Packet-Type}"
#COA-Packet-DST-IP-Address := "%{1}"
COA-Packet-DST-IP-Address := "fd01::2"
COA-Acct-Session-Id := "%{2}"
#
# Add any other
attributes here.
#
# Set the CoA/Disconnect port
COA-Packet-DST-Port := 1700
Debug run:
Wed Dec 28 20:40:53 2022 : Debug: server coa { # from file
/etc/raddb/sites-local/coa-relay
Wed Dec 28 20:40:53 2022 : Debug: recv-coa {
Wed Dec 28 20:40:53 2022 : Warning:
/etc/raddb/sites-local/coa-relay[120]: Please change attribute
reference to '&Tmp-String-0 := ...'
Wed Dec 28 20:40:53 2022 : Debug: update {
Wed Dec 28 20:40:53 2022 : Debug: &control:Tmp-String-0 :=
"%{sql:SELECT IFNULL(GROUP_CONCAT(CONCAT(nasipaddress,'#',acctsessionid)
separator '|'),'') FROM (SELECT * FROM radacct WHERE
('%{User-Name}'='' OR UserName='%{User-Name}') AND
('%{Acct-Session-Id}'='' OR acctsessionid = '%{Acct-Session-Id}') AND
AcctStopTime IS NULL) a}"
Wed Dec 28 20:40:53 2022 : Debug: }
Wed Dec 28 20:40:53 2022 : Warning:
/etc/raddb/sites-local/coa-relay[136]: Please change attribute
reference to '&COA-Packet-Type := ...'
Wed Dec 28 20:40:53 2022 : Warning:
/etc/raddb/sites-local/coa-relay[139]: Please change attribute
reference to '&COA-Packet-DST-IP-Address := ...'
Wed Dec 28 20:40:53 2022 : Error:
/etc/raddb/sites-local/coa-relay[139]: Failed resolving "fd01::2" to
IPv4 address: Address family for hostname not supported
On Wed, Dec 28, 2022 at 3:03 PM Alan DeKok <aland at deployingradius.com> wrote:
>
> On Dec 28, 2022, at 2:36 PM, BuzzSaw Code <buzzsaw.code at gmail.com> wrote:
> >
> > On Wed, Dec 28, 2022 at 8:30 AM Alan DeKok <aland at deployingradius.com> wrote:
> >>
> >> No. Just use &coa:Packet-DST-IP-Address,
> >
> > When I tried that in an update request stanza, just after the database
> > query in coa-relay I got an update failed error - "Failed resolving
> > "X" to IPv4 address: Address family for hostname not supported."
>
> "X" isn't an IPv4 address. Or, "X" is a host name which has no IPv4 address associated with it.
>
> I would suggest posting *actual examples*, and not tiny bits which are edited so much that they make no sense.
>
> The server works when you assign IPv4 addresses to the Packet-DST-IP-Address. Always.
>
> If it doesn't work, it's because you did something wrong. But you're not saying what you did, so it's a mystery.
>
> Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list