How to proxy according to attribute value?
Hello, I want to proxy accounting packets according to Calling-Station-Id attribute. I first think that I must use keyed-balance method for this. I set realm as below: home_server_pool vas1 { type = keyed-balance home_server = vas1 ---> I want to send acct pkgs with calling-st-id like 1234% home_server = vas2 ----> I want to send acct pkgs with calling-st-id like 0000% } I added Load-Balance key definition in control statement. preacct { preprocess update control { Load-Balance-Key = "%{Calling-Station-Id}" Proxy-To-Realm := VAS1 } ..... but, I could not find how to differentiate the key, and select the home_server. can you please help on this issue? I am on a wrong way ? Thanks. -- View this message in context: http://freeradius.1045715.n5.nabble.com/How-to-proxy-according-to-attribute-... Sent from the FreeRadius - User mailing list archive at Nabble.com.
realm VAS1 { acct_pool = vas1 } I added realm definition. -- View this message in context: http://freeradius.1045715.n5.nabble.com/How-to-proxy-according-to-attribute-... Sent from the FreeRadius - User mailing list archive at Nabble.com.
mimir wrote:
Hello,
I want to proxy accounting packets according to Calling-Station-Id attribute. I first think that I must use keyed-balance method for this.
No. You need to set Proxy-To-Realm. That tells the server to proxy. The keyed-balance configuration is a method of proxying.
I set realm as below: home_server_pool vas1 { type = keyed-balance home_server = vas1 ---> I want to send acct pkgs with calling-st-id like 1234% home_server = vas2 ----> I want to send acct pkgs with calling-st-id like 0000% }
That's not how keyed-balance works. Read the documentation. If you want 50% of the packets to go to destination A, then list "home_server = a" as 50% of the servers in the home_server_pool.
but, I could not find how to differentiate the key, and select the home_server.
You don't. They keyed-balance method hashes the data, and selects a home server based on the hash.
can you please help on this issue? I am on a wrong way ?
The approach is right. I'm not sure you really understand the comments in proxy.conf. That would help. Alan DeKok.
Thanks Alan for reply. Is there any other way to run my scenario? like attribute filtering sth else? I also created multiple realms with one home_servers and tried to Proxy to them according to Calling-Station-Id value by adding if else structrues to the update control section in preacct. But I see that, update control does not support sub-sections. -- View this message in context: http://freeradius.1045715.n5.nabble.com/How-to-proxy-according-to-attribute-... Sent from the FreeRadius - User mailing list archive at Nabble.com.
mimir wrote:
Thanks Alan for reply. Is there any other way to run my scenario? like attribute filtering sth else?
I explained the solution which works. Attribute filtering has nothing to do with proxying.
I also created multiple realms with one home_servers and tried to Proxy to them according to Calling-Station-Id value by adding if else structrues to the update control section in preacct.
The documentation says that this DOES NOT work. See "man unlang"
But I see that, update control does not support sub-sections.
So... switch the "if" and "update" Alan DeKok.
participants (2)
-
Alan DeKok -
mimir