Issue #1551
radius accounting with multiple IPs
Description
Strongswan always listens to all IPs, and the radius server frequently receives different accounting messages packeted with different IPs belonging to one NAS. Once the new message(e.g. 10.0.0.2) is sent, the old one(e.g. 10.0.0.1) becomes stale. All messages generate with its own AcctUniqueId. Such a problem makes the radius fail to caculate clients' traffic accurately, because the radius server treats them as new sessions with new AcctUniqueIds. This issue is quite commonly seen when the client roams between WIFI and 3G/4G. Is there any way to enforce the strongswan to only packet one IP as dialed up in radius messages ?
History
#1 Updated by Tobias Brunner about 9 years ago
- Category changed from charon to configuration
- Status changed from New to Feedback
Why don't you redefine how FreeRADIUS generates the unique ID so that it doesn't include the changing IP address?
#2 Updated by Yick Xie about 9 years ago
Tobias Brunner wrote:
Why don't you redefine how FreeRADIUS generates the unique ID so that it doesn't include the changing IP address?
Well, this way can work around the issue a little tricky, though with potential risks of duplicate acct-session-ids. Morever even if the accounting is properly handled, nas-ip-address related policies such as huntgroup may still have to face up such cases. Technically other service hooked up to this freeradius server would also be impacted more or less. The client just dials up a specific IP, and we can deliver all traffic via a specific IP by "SNAT --to", hence it should be fairly reasonable to bring in an explict parameter in eap-radius to specify the IP packeted. Anyway thanks for your help, it still solves my current problem temporarily.
#3 Updated by Tobias Brunner about 9 years ago
though with potential risks of duplicate acct-session-ids
You mean if the same client accesses different NAS?
Morever even if the accounting is properly handled, nas-ip-address related policies such as huntgroup may still have to face up such cases.
So you might want to investigate why the IP changes in the first place. Or why you have multiple IPs assigned to that host when you don't actually want to use them.
The client just dials up a specific IP, and we can deliver all traffic via a specific IP by "SNAT --to", hence it should be fairly reasonable to bring in an explict parameter in eap-radius to specify the IP packeted.
What do you mean? SNAT? "IP packeted"?
#4 Updated by Yick Xie about 9 years ago
Tobias Brunner wrote:
though with potential risks of duplicate acct-session-ids
You mean if the same client accesses different NAS?
As the reason why freeradius introduce the unique-id, some device/NAS perhaps would reuse the acct-session-id after reboot. Then I just doubt some other freeradius-backended services may come into such cases one day. It is pretty possbile that they might share a same database.
Morever even if the accounting is properly handled, nas-ip-address related policies such as huntgroup may still have to face up such cases.
So you might want to investigate why the IP changes in the first place. Or why you have multiple IPs assigned to that host when you don't actually want to use them.
Sure thing. It would be definitly a better way to tackle this issue within strongswan internally.
The client just dials up a specific IP, and we can deliver all traffic via a specific IP by "SNAT --to", hence it should be fairly reasonable to bring in an explict parameter in eap-radius to specify the IP packeted.
What do you mean? SNAT? "IP packeted"?
Oh, I mean iptables can specify the output IP in forward chain. And I thought the strongswan could change the NAS-IP-ADDRESS field explicitly in radius messages. Is it feasible?
#5 Updated by Tobias Brunner about 9 years ago
The client just dials up a specific IP, and we can deliver all traffic via a specific IP by "SNAT --to", hence it should be fairly reasonable to bring in an explict parameter in eap-radius to specify the IP packeted.
What do you mean? SNAT? "IP packeted"?
Oh, I mean iptables can specify the output IP in forward chain. And I thought the strongswan could change the NAS-IP-ADDRESS field explicitly in radius messages. Is it feasible?
You mean you want to map all IP addresses of the server to a single IP? Or what IP do you want to change? And the NAS-IP-ADDRESS sent by the eap-radius plugin is simply the address the daemon uses to communicate with a particular client. If that address is not to your liking, again, make sure your clients don't use a different address.
#6 Updated by Yick Xie about 9 years ago
Tobias Brunner wrote:
The client just dials up a specific IP, and we can deliver all traffic via a specific IP by "SNAT --to", hence it should be fairly reasonable to bring in an explict parameter in eap-radius to specify the IP packeted.
What do you mean? SNAT? "IP packeted"?
Oh, I mean iptables can specify the output IP in forward chain. And I thought the strongswan could change the NAS-IP-ADDRESS field explicitly in radius messages. Is it feasible?
You mean you want to map all IP addresses of the server to a single IP? Or what IP do you want to change? And the NAS-IP-ADDRESS sent by the eap-radius plugin is simply the address the daemon uses to communicate with a particular client. If that address is not to your liking, again, make sure your clients don't use a different address.
I mapped all traffic from "right=xxx" to a single IP, simply because clients only dialled up this IP. And yes, to disable other IPs is supposed to be what I mostly need at present. Regarding to your description, may I just block udp 500 and 4500 of other IPs to ensure the only one IP sent by eap-radius?
#7 Updated by Tobias Brunner about 9 years ago
Regarding to your description, may I just block udp 500 and 4500 of other IPs to ensure the only one IP sent by eap-radius?
Sure, if the clients can't connect to a specific IP they won't use it (unless it's the only IP of the server they know - but since they can't connect you won't see that IP in RADIUS messages).
#8 Updated by Noel Kuntze over 8 years ago
- Status changed from Feedback to Closed
- Resolution set to No change required