Thank you for responding but, FR is acting the same and I always get a reject from the checkval module because the Calling-Station-Id is still the same : rlm_checkval: Item Name: Calling-Station-Id, Value: lag-50:1201.0#BNG Kasbah###pppoe 94:a7:b7:3e:93:5b# rlm_checkval: Value Name: Calling-Station-Id, Value: 94:a7:b7:3e:93:5b ++[checkval] returns reject I know it's the problem of the NAS but I can't change that infortunately so I have to adjust my server to that form. So could you please give me a detailed solution for this 2018-06-22 12:32 GMT+01:00 Alan DeKok <aland@deployingradius.com>:
On Jun 22, 2018, at 7:27 AM, Kefi Ammar . <kefiammar@gmail.com> wrote:
Could someone help me to strip the calling station id recieved in the request to use it later for the checkval module.
I am applying the mac authentication using checkval but the problem is
that
I am recieving a long calling station id containing the mac address.
this is an exemple of the calling station id recieved : lag-50:1201.0#BNG Kasbah###pppoe 94:a7:b7:3e:93:5b#
That's not normally the recommended form. But NAS vendors are inventive. <sigh>
The NAS-Port-ID attribute should really be used for that kind of information.
its always in this format and I only want to extract the mac address from it. I dont know if it can be achieved using unlang or anything else.
Use a regular expression:
update request { NAS-Port-Id += &Calling-Station-ID }
if (Calling-Station-Id =~ /pppoe ([^#]+#/) { update request { Calling-Station-ID := "${1}" } }
You'll have to modify it for your needs, but that's the basic idea.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html