Hello, I'm using Debian and Freeradius 2.0.4-3.<br><br>I want to use a regular expression in proxy.conf file to match any request that contain the word "domain" in the realm (suffix mode).<br><br><br>### /etc/freeradius/proxy.conf<br>
realm "~(domain)+" {<br># authhost = LOCAL # not strictly necessary<br># accthost = LOCAL # not strictly necessary<br>}<br><br>Then, in authorize section I have:<br><br>### /etc/freeradius/sites-available/default<br>
authorize {<br> preprocess <br> mschap<br> suffix<br> eap {<br> ok = return<br> }<br> if ("%{Realm}" =~ /(temp\.)?domain\.es$/){<br> update control {<br> Intentos-Reject = ...<br>
}<br> }<br> files<br><br> switch "%{Realm}" {<br> case "<a href="http://temp.domain.es">temp.domain.es</a>" {<br> sql<br> }<br> case "<a href="http://domain.es">domain.es</a>" {<br>
redundant {<br> ldap2<br> ldap1<br> ldap3<br> }<br> }<br> case {<br> update control {<br> Auth-Type := Reject<br>
}<br> }<br> } <br><br> expiration<br> pap<br>}<br><br>And, in users file:<br><br>### /etc/freeradius/proxy.conf<br>DEFAULT Intentos-Reject > 10, Auth-Type := Reject<br> Reply-Message = "NUMERO DE INTENTOS FALLIDOS(%{Intentos-Reject}) EXCEDIDO PARA %{%{Stripped-User-Name}:-%{User-Name}}"<br>
<br>My problem is: the Realm that Freeradius add to the request is the regular expression... Here is my debug information:<br><br>rad_recv: Access-Request packet from host 127.0.0.1 port 60112, id=208, length=68<br> User-Name = "<a href="mailto:XXX@domain.es">XXX@domain.es</a>"<br>
User-Password = "YYY"<br> NAS-IP-Address = 127.0.1.1<br> NAS-Port = 0<br>+- entering group authorize<br>++[preprocess] returns ok<br>++[mschap] returns noop<br> rlm_realm: Looking up realm "<a href="http://domain.es">domain.es</a>" for User-Name = "<a href="mailto:XXX@domain.es">XXX@domain.es</a>"<br>
rlm_realm: Found realm "~(domain)+"<br> rlm_realm: Adding Stripped-User-Name = "XXX"<br> rlm_realm: Adding Realm = "~(domain)+"<br> rlm_realm: Authentication realm is LOCAL.<br>++[suffix] returns noop<br>
rlm_eap: No EAP-Message, not doing EAP<br>++[eap] returns noop<br>++? if ("%{Realm}" =~ /(temp\.)?domain\.es$/)<br> expand: %{Realm} -> ~(domain)+<br>? Evaluating ("%{Realm}" =~ /(temp\.)?domain\.es$/) -> FALSE<br>
++? if ("%{Realm}" =~ /(temp\.)?domain\.es$/) -> FALSE<br>++[files] returns noop<br> expand: %{Realm} -> ~(domain)+<br>++- entering switch %{Realm}<br>+++- entering case <br>++++[control] returns noop<br>
+++- case returns noop<br>++- switch %{Realm} returns noop<br><br>I can resolve this adding this to proxy.conf:<br><br>### /etc/freeradius/proxy.conf<br><br>realm "<a href="http://domain.es">domain.es</a>" {<br>
authhost = LOCAL # not strictly necessary<br> accthost = LOCAL # not strictly necessary<br>}<br><br>realm "<a href="http://temp.domain.es">temp.domain.es</a>" {<br> authhost = LOCAL # not strictly necessary<br>
accthost = LOCAL # not strictly necessary<br>}<br><br>realm "~(domain)+" {<br> authhost = LOCAL # not strictly necessary<br> accthost = LOCAL # not strictly necessary<br>}<br><br><br>
But I don't know if that is the best way to resolve my problem, so I would like to reinforce my decision.<br><br>Thanks in advance and sorry for my english.<br><br clear="all"><br>-- <br>____________________<br><br> Ana Gallardo Gómez<br>
____________________<br>