Proxy + copy accounting to passive home server

mimir erdem.mimiroglu at alcatel-lucent.com
Mon Apr 2 14:24:44 CEST 2012


Hi Alan,

I got your point. I need a reply.

I can use proxying but I also need to send same accounting to all servers at
the same time.

I tried to build virtual servers to proxy accounting packets to other
servers.

For example: I am going to send accounting packets to 20 servers.

First I create 20 virtual servers, and then point them to 20 remote servers
one by one. ( Because proxy only supports failover and loadbalance)

My configs:

/sites-available/default
preacct {
     preprocess
    update control {
          Proxy-To-Realm := TEST0  --> virtual server realm
          }
}
/sites-available/default2

preacct {
        preprocess
          update control {
          Proxy-To-Realm += TEST1 --> remote radius
          #Replicate-To-Realm += TEST2
          #Replicate-To-Realm += TEST3
          }
        #  Session sta


But when I tried it I got segmentation fault.

rad_recv: Accounting-Request packet from host 135.243.68.36 port 55675, i                                                                                   
d=112, length=94
        User-Name = "test2"
        Acct-Status-Type = Start
        Acct-Session-Id = "4680"
        Framed-Protocol = PPP
        Acct-Delay-Time = 5
        Calling-Station-Id = "905436755108"
        NAS-Port = 1
        Framed-IP-Address = 2.2.2.17
        NAS-IP-Address = 135.243.90.68
        Called-Station-Id = "internet1"
# Executing section preacct from file /usr/local/etc/raddb/sites-enabled/                                                                                   
default
+- entering group preacct {...}
[preprocess]   hints: Matched DEFAULT at 85
[preprocess] sql_xlat
[preprocess]    expand: %{User-Name} -> test2
[preprocess] sql_set_user escaped user --> 'test2'
[preprocess]    expand: SELECT id from deneme limit 1 -> SELECT id from d                                                                                   
eneme limit 1
rlm_sql (sql): Reserving sql socket id: 4
[preprocess] sql_xlat finished
rlm_sql (sql): Released sql socket id: 4
[preprocess]    expand: %{sql:SELECT id from deneme limit 1} -> 5
[preprocess] sql_xlat
[preprocess]    expand: %{User-Name} -> test2
[preprocess] sql_set_user escaped user --> 'test2'
[preprocess]    expand: SELECT id from deneme limit 1 -> SELECT id from d                                                                                   
eneme limit 1
rlm_sql (sql): Reserving sql socket id: 3
[preprocess] sql_xlat finished
rlm_sql (sql): Released sql socket id: 3
[preprocess]    expand: %{sql:SELECT id from deneme limit 1} -> 5
++[preprocess] returns ok
++[control] returns ok
[acct_unique] Hashing 'NAS-Port = 1,Client-IP-Address = 135.243.68.36,NAS                                                                                   
-IP-Address = 135.243.90.68,Acct-Session-Id = "4680",User-Name = "test2"'
[acct_unique] Acct-Unique-Session-ID = "8106182d5455e91b".
++[acct_unique] returns ok
[suffix] No '@' in User-Name = "test2", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
# Executing section accounting from file /usr/local/etc/raddb/sites-enabl                                                                                   
ed/default
+- entering group accounting {...}
[detail]        expand: %{Packet-Src-IP-Address} -> 135.243.68.36
[detail]        expand: /var/log/radius/radacct/%{%{Packet-Src-IP-Address                                                                                   
}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d -> /var/log/radius/radacct/1                                                                                   
35.243.68.36/detail-20120402
[detail] /var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src                                                                                   
-IPv6-Address}}/detail-%Y%m%d expands to /var/log/radius/radacct/135.243.                                                                                   
68.36/detail-20120402
[detail]        expand: %t -> Mon Apr  2 08:21:05 2012
++[detail] returns ok
++[unix] returns ok
[radutmp]       expand: /var/log/radius/radutmp -> /var/log/radius/radutm                                                                                   
p
[radutmp]       expand: %{User-Name} -> test2
++[radutmp] returns ok
[sql]   expand: %{User-Name} -> test2
[sql] sql_set_user escaped user --> 'test2'
[sql]   expand: %{Acct-Delay-Time} -> 5
[sql]   expand:            INSERT INTO radacct             (acctsessionid                                                                                   
,    acctuniqueid,     username,              realm,            nasipaddr                                                                                   
ess,     nasportid,              nasporttype,      acctstarttime,    acct                                                                                   
stoptime,              acctsessiontime,  acctauthentic,    connectinfo_st                                                                                   
art,              connectinfo_stop, acctinputoctets,  acctoutputoctets,                                                                                                 
calledstationid,  callingstationid, acctterminatecause,                                                                                                 
servicetype,      framedprotocol,   framedipaddress,                                                                                                 
acctstartdelay,   acctstopdelay,    xascendsessionsvrkey)           VALU                                                                                   
ES             ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',                                                                                                 
'%{SQL-User-Name}',              '%{Realm}', '%{NAS-IP-Address}',                                                                                    
'%{NAS-Port}',              '%{NAS-Port-Type}', '%S', NULL,                                                                                                 
'0', '%{Acct-Authentic}', '%{Connect-Info}',              '', '0', '0',                                                                                                 
'%{Called-Station-Id}', '%{Calling-Station-Id}', '',                                                                                                 
'%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}',                                                                                        
rlm_sql (sql): Reserving sql socket id: 2
rlm_sql (sql): Released sql socket id: 2
++[sql] returns ok
++[exec] returns noop
++[replicate] returns noop
[attr_filter.accounting_response]       expand: %{User-Name} -> test2
attr_filter: Matched entry DEFAULT at line 12
++[attr_filter.accounting_response] returns updated
# Executing section pre-proxy from file /usr/local/etc/raddb/sites-enable                                                                                   
d/default
+- entering group pre-proxy {...}
++[files] returns noop
[pre_proxy_log]         expand: /var/log/radius/radacct/%{Client-IP-Addre                                                                                   
ss}/pre-proxy-detail-%Y%m%d -> /var/log/radius/radacct/135.243.68.36/pre-                                                                                   
proxy-detail-20120402
[pre_proxy_log] /var/log/radius/radacct/%{Client-IP-Address}/pre-proxy-de                                                                                   
tail-%Y%m%d expands to /var/log/radius/radacct/135.243.68.36/pre-proxy-de                                                                                   
tail-20120402
[pre_proxy_log]         expand: %t -> Mon Apr  2 08:21:05 2012
++[pre_proxy_log] returns ok
>>> Sending proxied request internally to virtual server.
server virtualserver {
# Executing section preacct from file /usr/local/etc/raddb/sites-availabl                                                                                   
e/default2
+- entering group preacct {...}
[preprocess]   hints: Matched DEFAULT at 85
[preprocess] sql_xlat
[preprocess]    expand: %{User-Name} -> test2
[preprocess] sql_set_user escaped user --> 'test2'
[preprocess]    expand: SELECT id from deneme limit 1 -> SELECT id from d                                                                                   
eneme limit 1
rlm_sql (sql): Reserving sql socket id: 1
[preprocess] sql_xlat finished
rlm_sql (sql): Released sql socket id: 1
[preprocess]    expand: %{sql:SELECT id from deneme limit 1} -> 5
[preprocess] sql_xlat
[preprocess]    expand: %{User-Name} -> test2
[preprocess] sql_set_user escaped user --> 'test2'
[preprocess]    expand: SELECT id from deneme limit 1 -> SELECT id from d                                                                                   
eneme limit 1
rlm_sql (sql): Reserving sql socket id: 0
[preprocess] sql_xlat finished
rlm_sql (sql): Released sql socket id: 0
[preprocess]    expand: %{sql:SELECT id from deneme limit 1} -> 5
++[preprocess] returns ok
++[control] returns ok
++[acct_unique] returns noop
[suffix] No '@' in User-Name = "test2", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
# Executing section accounting from file /usr/local/etc/raddb/sites-avail                                                                                   
able/default2
+- entering group accounting {...}
[detail]        expand: %{Packet-Src-IP-Address} -> 135.243.68.36
[detail]        expand: /var/log/radius/radacct/%{%{Packet-Src-IP-Address                                                                                   
}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d -> /var/log/radius/radacct/1                                                                                   
35.243.68.36/detail-20120402
[detail] /var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src                                                                                   
-IPv6-Address}}/detail-%Y%m%d expands to /var/log/radius/radacct/135.243.                                                                                   
68.36/detail-20120402
[detail]        expand: %t -> Mon Apr  2 08:21:05 2012
++[detail] returns ok
++[unix] returns ok
[radutmp]       expand: /var/log/radius/radutmp -> /var/log/radius/radutm                                                                                   
p
[radutmp]       expand: %{User-Name} -> test2
rlm_radutmp: Login entry for NAS 135.243.90.68 port 1 duplicate
++[radutmp] returns ok
[sql]   expand: %{User-Name} -> test2
[sql] sql_set_user escaped user --> 'test2'
[sql]   expand: %{Acct-Delay-Time} -> 5
[sql]   expand:            INSERT INTO radacct             (acctsessionid                                                                                   
,    acctuniqueid,     username,              realm,            nasipaddr                                                                                   
ess,     nasportid,              nasporttype,      acctstarttime,    acct                                                                                   
stoptime,              acctsessiontime,  acctauthentic,    connectinfo_st                                                                                   
art,              connectinfo_stop, acctinputoctets,  acctoutputoctets,                                                                                                 
calledstationid,  callingstationid, acctterminatecause,                                                                                                 
servicetype,      framedprotocol,   framedipaddress,                                                                                                 
acctstartdelay,   acctstopdelay,    xascendsessionsvrkey)           VALU                                                                                   
ES             ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',                                                                                                 
'%{SQL-User-Name}',              '%{Realm}', '%{NAS-IP-Address}',                                                                                    
'%{NAS-Port}',              '%{NAS-Port-Type}', '%S', NULL,                                                                                                 
'0', '%{Acct-Authentic}', '%{Connect-Info}',              '', '0', '0',                                                                                                 
'%{Called-Station-Id}', '%{Calling-Station-Id}', '',                                                                                                 
'%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}',                                                                                        
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql (sql): Released sql socket id: 4
++[sql] returns ok
++[exec] returns noop
++[replicate] returns noop
[attr_filter.accounting_response]       expand: %{User-Name} -> test2
attr_filter: Matched entry DEFAULT at line 12
++[attr_filter.accounting_response] returns updated
} # server virtualserver
Going to the next request
<<< Received proxied response code 0 from internal virtual server.
# Executing section post-proxy from file /usr/local/etc/raddb/sites-enabl                                                                                   
ed/default
+- entering group post-proxy {...}
[post_proxy_log]        expand: /var/log/radius/radacct/%{Client-IP-Addre                                                                                   
ss}/post-proxy-detail-%Y%m%d -> /var/log/radius/radacct/135.243.68.36/pos                                                                                   
t-proxy-detail-20120402
[post_proxy_log] /var/log/radius/radacct/%{Client-IP-Address}/post-proxy-                                                                                   
detail-%Y%m%d expands to /var/log/radius/radacct/135.243.68.36/post-proxy                                                                                   
-detail-20120402
[post_proxy_log]        expand: %t -> Mon Apr  2 08:21:05 2012
[post_proxy_log] Freeradius-Proxied-To = ??
++[post_proxy_log] returns ok
[eap] No pre-existing handler found
Segmentation fault



--
View this message in context: http://freeradius.1045715.n5.nabble.com/Proxy-copy-accounting-to-passive-home-server-tp5598491p5612316.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.


More information about the Freeradius-Users mailing list