copy accounting packet to multiple servers

gaurav p gauravkrishna.bncet at gmail.com
Mon Mar 7 08:17:41 UTC 2022


Hi Everyone

Hope all is well!


I am trying to copy the accounting packet to multiple servers. I am able to
copy on two servers but when I use the 3rd server then it is inconsistent.
time sends packets on two servers some time only on one server.

i am

Configuration

Listening on detail file /opt/aaa3/var/log/radius/radacct/detail* as server
copy-acct-to-home-server
Listening on detail file /opt/aaa3/var/log/radius/radacct/detail* as server
copy-acct-to-home-server3
Listening on detail file /opt/aaa3/var/log/radius/radacct/detail* as server
copy-acct-to-home-server2

 update control {
                       #Home-Server-Name := "radius2"  (It is also not
working)
                        Proxy-To-Realm := example.com
 }

i have added above config in all copy-acct-to-home-server with
different realm name


radiusd: #### Loading Realms and Home Servers ####
 proxy server {
  retry_delay = 5
  retry_count = 3
  default_fallback = no
  dead_time = 120
  wake_all_if_all_dead = no
 }
 home_server localhost {
  ipaddr = 172.16.1.121
  port = 1813
  type = "acct"
  secret = <<< secret >>>
  response_window = 20.000000
  response_timeouts = 1
  max_outstanding = 65536
  zombie_period = 40
  status_check = "status-server"
  ping_interval = 30
  check_interval = 30
  check_timeout = 4
  num_answers_to_alive = 3
  revive_interval = 120
  username = "bob"
  password = "bob"
  limit {
  max_connections = 16
  max_requests = 0
  lifetime = 0
  idle_timeout = 0
  }
  coa {
  irt = 2
  mrt = 16
  mrc = 5
  mrd = 30
  }
 }
 home_server secondserver {
  ipaddr = 172.16.1.121
  port = 1818
  type = "acct"
  secret = <<< secret >>>
  response_window = 20.000000
  response_timeouts = 1
  max_outstanding = 65536
  zombie_period = 40
  status_check = "status-server"
  ping_interval = 30
  check_interval = 30
  check_timeout = 4
  num_answers_to_alive = 3
  revive_interval = 120
  limit {
  max_connections = 16
  max_requests = 0
  lifetime = 0
  idle_timeout = 0
  }
  coa {
  irt = 2
  mrt = 16
  mrc = 5
  mrd = 30
  }
 }
 home_server thirdserver {
  ipaddr = 172.16.1.121
  port = 1815
  type = "acct"
  secret = <<< secret >>>
  response_window = 20.000000
  response_timeouts = 1
  max_outstanding = 65536
  zombie_period = 40
  status_check = "status-server"
  ping_interval = 30
  check_interval = 30
  check_timeout = 4
  num_answers_to_alive = 3
  revive_interval = 120
  limit {
  max_connections = 16
  max_requests = 0
  lifetime = 0
  idle_timeout = 0
  }
  coa {
  irt = 2
  mrt = 16
  mrc = 5
  mrd = 30
  }
 }
 home_server_pool secondserver_pool {
type = fail-over
home_server = secondserver
 }
 realm second.com {
acct_pool = secondserver_pool
 }
 home_server_pool thirdserver_pool {
type = fail-over
home_server = thirdserver
 }
 realm third.com {
acct_pool = thirdserver_pool
 }
 home_server_pool my_auth_failover {
type = fail-over
home_server = localhost
 }
 realm example.com {
acct_pool = my_auth_failover
 }









Output logs


detail (/opt/aaa3/var/log/radius/radacct/detail): Detail listener state
unopened waiting 1.028538 sec
(12) Received Accounting-Request Id 23 from 127.0.0.1:60425 to
127.0.0.1:1816 length 191
(12)   Filter-Id = "plan"
(12)   User-Name = "testing"
(12)   Acct-Session-Id = "259"
(12)   Service-Type = Login-User
(12)   Calling-Station-Id = "00:0c:29:e0:85:43"
(12)   Acct-Input-Gigawords = 0
(12)   Acct-Output-Gigawords = 0
(12)   Acct-Input-Octets = 0
(12)   Acct-Output-Octets = 0
(12)   Acct-Session-Time = 19
(12)   NAS-Port-Id = "cpeth1"
(12)   NAS-Port = 1
(12)   Acct-Authentic = RADIUS
(12)   NAS-Port-Type = 50
(12)   Called-Station-Id = "00:0c:29:53:fb:2c"
(12)   Acct-Terminate-Cause = User-Request
(12)   Event-Timestamp = "Mar  6 2022 11:46:51 IST"
(12)   NAS-Identifier = "radiustest"
(12)   NAS-IP-Address = 172.16.1.87
(12)   Calling-Station-Id = "testing"
(12)   Framed-IP-Address = 10.100.100.2
(12)   Acct-Status-Type = Stop
(12) # Executing section preacct from file
/opt/aaa3/etc/raddb/sites-enabled/default
(12)   preacct {
(12)     [preprocess] = ok
(12)     policy acct_unique {
(12)       update request {
(12)         &Tmp-String-9 := "ai:"
(12)       } # update request = noop
(12)       if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) &&
 ("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i)) {
(12)       EXPAND %{hex:&Class}
(12)          -->
(12)       EXPAND ^%{hex:&Tmp-String-9}
(12)          --> ^61693a
(12)       if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) &&
 ("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i))  -> FALSE
(12)       else {
(12)         update request {
(12)           EXPAND
%{md5:%{User-Name},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}}
(12)              --> 5bd47cbf1411cd31bd1e801d746e319e
(12)           &Acct-Unique-Session-Id := 5bd47cbf1411cd31bd1e801d746e319e
(12)         } # update request = noop
(12)       } # else = noop
(12)     } # policy acct_unique = noop
(12) suffix: Checking for suffix after "@"
(12) suffix: No '@' in User-Name = "testing", looking up realm NULL
(12) suffix: No such realm "NULL"
(12)     [suffix] = noop
(12)     [files] = noop
(12)   } # preacct = ok
(12) # Executing section accounting from file
/opt/aaa3/etc/raddb/sites-enabled/default
(12)   accounting {
(12) detail: EXPAND /opt/aaa3/var/log/radius/radacct/detail
(12) detail:    --> /opt/aaa3/var/log/radius/radacct/detail
(12) detail: /opt/aaa3/var/log/radius/radacct/detail expands to
/opt/aaa3/var/log/radius/radacct/detail
(12) detail: EXPAND %t
(12) detail:    --> Sun Mar  6 11:46:55 2022
(12)     [detail] = ok
(12)     [unix] = ok
(12)     [exec] = noop
(12) attr_filter.accounting_response: EXPAND %{User-Name}
(12) attr_filter.accounting_response:    --> testing
(12) attr_filter.accounting_response: Matched entry DEFAULT at line 12
(12)     [attr_filter.accounting_response] = updated
(12)   } # accounting = updated
(12) Sent Accounting-Response Id 23 from 127.0.0.1:1816 to
127.0.0.1:60425 length
0
(12) Finished request
(12) Cleaning up request packet ID 23 with timestamp +490
Ready to process requests
detail (/opt/aaa3/var/log/radius/radacct/detail): Polling for detail file
detail (/opt/aaa3/var/log/radius/radacct/detail): Renaming
/opt/aaa3/var/log/radius/radacct/detail -> /opt/aaa3/var/log/radius/radacct/
detail.work
detail (/opt/aaa3/var/log/radius/radacct/detail): Read packet from
/opt/aaa3/var/log/radius/radacct/detail.work
Filter-Id = "plan"
User-Name = "testing"
Acct-Session-Id = "259"
Service-Type = Login-User
Calling-Station-Id = "00:0c:29:e0:85:43"
Acct-Input-Gigawords = 0
Acct-Output-Gigawords = 0
Acct-Input-Octets = 0
Acct-Output-Octets = 0
Acct-Session-Time = 19
NAS-Port-Id = "cpeth1"
NAS-Port = 1
Acct-Authentic = RADIUS
NAS-Port-Type = 50
Called-Station-Id = "00:0c:29:53:fb:2c"
Acct-Terminate-Cause = User-Request
Event-Timestamp = "Mar  6 2022 11:46:51 IST"
NAS-Identifier = "radiustest"
NAS-IP-Address = 172.16.1.87
Calling-Station-Id = "testing"
Framed-IP-Address = 10.100.100.2
Acct-Status-Type = Stop
Tmp-String-9 = "ai:"
Acct-Unique-Session-Id = "5bd47cbf1411cd31bd1e801d746e319e"
Packet-Original-Timestamp = "Mar  6 2022 11:46:55 IST"
Acct-Delay-Time = 5
Packet-Transmit-Counter = 1
(13) # Executing section preacct from file
/opt/aaa3/etc/raddb/sites-enabled/copy-acct-to-home-server3
(13)   preacct {
(13)     [preprocess] = ok
(13)     update control {
(13)       Proxy-To-Realm := third.com
(13)     } # update control = noop
(13)     [files] = noop
(13)   } # preacct = ok
(13) # Executing section accounting from file
/opt/aaa3/etc/raddb/sites-enabled/copy-acct-to-home-server3
(13)   accounting {
(13)     [ok] = ok
(13)   } # accounting = ok
(13) Starting proxy to home server 172.16.1.121 port 1815
(13) server copy-acct-to-home-server3 {
(13) }
(13) Proxying request to home server 172.16.1.121 port 1815 timeout
20.000000
Waking up in 0.3 seconds.
(13) Clearing existing &reply: attributes
(13) server copy-acct-to-home-server3 {
(13) }
(13) detail (/opt/aaa3/var/log/radius/radacct/detail): Done
Accounting-Request packet.
(13) Finished request
(13) Cleaning up request packet ID 2 with timestamp +491
Ready to process requests
detail (/opt/aaa3/var/log/radius/radacct/detail): Read packet from
/opt/aaa3/var/log/radius/radacct/detail.work
Filter-Id = "PlanAg"
User-Name = "testing"
Acct-Session-Id = "259"
Service-Type = Login-User
Calling-Station-Id = "00:0c:29:e0:85:43"
Acct-Input-Gigawords = 0
Acct-Output-Gigawords = 0
Acct-Input-Octets = 0
Acct-Output-Octets = 0
Acct-Session-Time = 19
NAS-Port-Id = "cpeth1"
NAS-Port = 1
Acct-Authentic = RADIUS
NAS-Port-Type = 50
Called-Station-Id = "00:0c:29:53:fb:2c"
Acct-Terminate-Cause = User-Request
Event-Timestamp = "Mar  6 2022 11:46:51 IST"
NAS-Identifier = "radiustest"
NAS-IP-Address = 172.16.1.87
Calling-Station-Id = "testing"
Framed-IP-Address = 10.100.100.2
Acct-Status-Type = Stop
Tmp-String-9 = "ai:"
Acct-Unique-Session-Id = "5bd47cbf1411cd31bd1e801d746e319e"
Packet-Original-Timestamp = "Mar  6 2022 11:46:55 IST"
Acct-Delay-Time = 5
Packet-Transmit-Counter = 1
(14) # Executing section preacct from file
/opt/aaa3/etc/raddb/sites-enabled/copy-acct-to-home-server
(14)   preacct {
(14)     [preprocess] = ok
(14)     update control {
(14)       Proxy-To-Realm := example.com
(14)     } # update control = noop
(14)     [files] = noop
(14)   } # preacct = ok
(14) # Executing section accounting from file
/opt/aaa3/etc/raddb/sites-enabled/copy-acct-to-home-server
(14)   accounting {
(14)     [ok] = ok
(14)   } # accounting = ok
(14) Starting proxy to home server 172.16.1.121 port 1813
(14) server copy-acct-to-home-server {
(14) }
(14) Proxying request to home server 172.16.1.121 port 1813 timeout
20.000000
Waking up in 0.3 seconds.
(14) Clearing existing &reply: attributes
(14) server copy-acct-to-home-server {
(14) }
(14) detail (/opt/aaa3/var/log/radius/radacct/detail): Done
Accounting-Request packet.
(14) Finished request
(14) Cleaning up request packet ID 3 with timestamp +491
Ready to process requests




Can anyone please help





thanks & regards
gaurav


More information about the Freeradius-Users mailing list