I'd like to proxy user's off to a different RADIUS server based on they're MAC address. Currently, my NAS reports MAC address as Calling-Station-Id = "00-0D-93-EA-89-06" I'd like any user that has a MAC starting with 00-0D-93 (and about 8 more MAC's) to be proxied off to another Radius server. I've come up with a RegEX that matches Mac addresses. (Least I think it's close) Correct me, cause I know I'm gonna get this wrong. (First real try with Regex) (I'm using 3 separart MAC's here) DEFAULT Calling-Station-Id =~ "(00-0D-93-([0-9a-fA-F][0-9a-fA-F]-){1}([0-9a-fA-F][0-9a-fA-F]))|(00-03- 93-([0-9a-fA-F][0-9a-fA-F]-){1}([0-9a-fA-F][0-9a-fA-F]))|(00-05-02-([0-9 a-fA-F][0-9a-fA-F]-){1}([0-9a-fA-F][0-9a-fA-F]))" But where does this go, and what else do I have to configure?
You don't *really* need to match the whole string. The following would work just as well and be much more readable: Calling-Station-Id =~ "^(00-0D-93-|00-03-93-|00-05-02-)" And as to where it goes, anywhere a check expression goes: users file, SQL radcheck table, etc. As long as the server is compiled with regular expressions and they're left enabled (which in the default configs, they are), you should be golden. --Mike On Feb 2, 2007, at 5:11 PM, King, Michael wrote:
I'd like to proxy user's off to a different RADIUS server based on they're MAC address.
Currently, my NAS reports MAC address as Calling-Station-Id = "00-0D-93-EA-89-06"
I'd like any user that has a MAC starting with 00-0D-93 (and about 8 more MAC's) to be proxied off to another Radius server.
I've come up with a RegEX that matches Mac addresses. (Least I think it's close)
Correct me, cause I know I'm gonna get this wrong. (First real try with Regex) (I'm using 3 separart MAC's here)
DEFAULT Calling-Station-Id =~ "(00-0D-93-([0-9a-fA-F][0-9a-fA-F]-){1}([0-9a-fA-F][0-9a-fA-F]))| (00-03- 93-([0-9a-fA-F][0-9a-fA-F]-){1}([0-9a-fA-F][0-9a-fA-F]))|(00-05-02- ([0-9 a-fA-F][0-9a-fA-F]-){1}([0-9a-fA-F][0-9a-fA-F]))"
But where does this go, and what else do I have to configure?
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/ users.html
-----Original Message-----
following would work just as well and be much more readable:
Calling-Station-Id =~ "^(00-0D-93-|00-03-93-|00-05-02-)"
I was just concerned with a partial match I wasn't expecting. E.g. XX-XX-00-0D-93-XX
And as to where it goes, anywhere a check expression goes: users file, SQL radcheck table, etc. As long as the server is compiled with regular expressions and they're left enabled (which in the default configs, they are), you should be golden.
Ok... Any hints on where a proxy should go? :-)
Where you put it all depends on your local configuration. If you put it in the users file, it might look something like this: DEFAULT Calling-Station-Id =~ "^(00-0D-93-|00-03-93-|00-05-02-)", Proxy-To-Realm := "ReamToProxyTo" --Mike On Feb 2, 2007, at 7:47 PM, King, Michael wrote:
-----Original Message-----
following would work just as well and be much more readable:
Calling-Station-Id =~ "^(00-0D-93-|00-03-93-|00-05-02-)"
I was just concerned with a partial match I wasn't expecting. E.g. XX-XX-00-0D-93-XX
And as to where it goes, anywhere a check expression goes: users file, SQL radcheck table, etc. As long as the server is compiled with regular expressions and they're left enabled (which in the default configs, they are), you should be golden.
Ok... Any hints on where a proxy should go? :-)
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/ users.html
Hi Michael and everyone, In message <6641F169E241EA40B29DE7BFAD24674D944E7B@EXCH2.campus.bridgew.edu>, "King, Michael" <MKing@bridgew.edu> writes
Calling-Station-Id =~ "^(00-0D-93-|00-03-93-|00-05-02-)"
I was just concerned with a partial match I wasn't expecting. E.g. XX-XX-00-0D-93-XX
That's not an issue - the other Michael began the regex with a ^, which means "beginning of line". XX-XX-00-0D-93-XX will not match this regex. If you're worried about unexpected matches, specify the MAC addresses in full. David -- David Wood david@wood2.org.uk
participants (3)
-
David Wood -
King, Michael -
Michael Griego