Hi, I am running this query: if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0){ redundant { sql1 sql2 } } But the if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0) section always returns false even though the database has the 'nas_ip' table containing 127.0.0.1 as the data Any ideas? Thanks Adam King Network Engineer adam.king@intechnology.com InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com * Harrogate, Reading, London * 200 people, ?50m p.a. turnover * Over 500 corporate clients * Specialist Business Solutions & Services Provider This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586. The contents of this message may be privileged and confidential. If you have received this message in error, you may not use, disclose, copy or distribute its content in anyway. Please notify the sender immediately. All messages are scanned for all viruses.
Is that table in the database sql instance is connecting to? Ivan Kalik Kalik Informatika ISP Dana 17/6/2008, "King, Adam" <adam.king@intechnology.com> piše:
Hi, I am running this query: if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0){ redundant { sql1 sql2 } }
But the if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0) section always returns false even though the database has the 'nas_ip' table containing 127.0.0.1 as the data Any ideas? Thanks
Adam King Network Engineer adam.king@intechnology.com
InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com * Harrogate, Reading, London * 200 people, ?50m p.a. turnover * Over 500 corporate clients * Specialist Business Solutions & Services Provider
This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586.
The contents of this message may be privileged and confidential. If you have received this message in error, you may not use,
disclose, copy or distribute its content in anyway. Please notify the sender immediately.
All messages are scanned for all viruses.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Yes, the database name is 'radius' and the table name is 'nas_ip'. Confusingly at this testing stage the field in the table is also called 'nas_ip' Thanks Adam King Network Engineer adam.king@intechnology.com InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com -----Original Message----- From: freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.org] On Behalf Of Ivan Kalik Sent: 17 June 2008 11:50 To: FreeRadius users mailing list Subject: Re: matching on IP Address Is that table in the database sql instance is connecting to? Ivan Kalik Kalik Informatika ISP Dana 17/6/2008, "King, Adam" <adam.king@intechnology.com> piše:
Hi, I am running this query: if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0){ redundant { sql1 sql2 } }
But the if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0) section always returns false even though the database has the 'nas_ip' table containing 127.0.0.1 as the data Any ideas? Thanks
This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586. The contents of this message may be privileged and confidential. If you have received this message in error, you may not use, disclose, copy or distribute its content in anyway. Please notify the sender immediately. All messages are scanned for all viruses.
You have multiple sql instances. Are you sure that instance called "sql" is connecting to that database? Or should it be sql1: or sql2:? Ivan Kalik Kalik Informatika ISP Dana 17/6/2008, "King, Adam" <adam.king@intechnology.com> piše:
Yes, the database name is 'radius' and the table name is 'nas_ip'. Confusingly at this testing stage the field in the table is also called 'nas_ip' Thanks
Adam King Network Engineer adam.king@intechnology.com
InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com
-----Original Message-----
From: freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.org] On Behalf Of Ivan Kalik Sent: 17 June 2008 11:50 To: FreeRadius users mailing list Subject: Re: matching on IP Address
Is that table in the database sql instance is connecting to?
Ivan Kalik Kalik Informatika ISP
Dana 17/6/2008, "King, Adam" <adam.king@intechnology.com> piše:
Hi, I am running this query: if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0){ redundant { sql1 sql2 } }
But the if ("%{sql: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='127.0.0.1'}">0) section always returns false even though the database has the 'nas_ip' table containing 127.0.0.1 as the data Any ideas? Thanks
This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586.
The contents of this message may be privileged and confidential. If you have received this message in error, you may not use,
disclose, copy or distribute its content in anyway. Please notify the sender immediately.
All messages are scanned for all viruses.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
I have switched it to sql1: so the statement now reads if("%{sql1: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='%{Packet-Src-IP-Address}' AND realm='adam'}" >0 ) { redundant { sql1 sql2 } } Obviously the redundant section isn't being picked up at the moment which is why it needed to be sql1: or sql2: thanks for that (I will come back to the redundant section at the moment What I need to work out now is how to have the realm working as a variable eg ... AND realm='%{realm}'}"... I am reading the freeradius wiki, specifically http://wiki.freeradius.org/Adding%2C_Removing%2C_Modifying_Attributes_fo r_further_processing Is this the best way to go about this? Assuming the way I am approaching this is possible?! Thanks again Adam King Network Engineer adam.king@intechnology.com InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com -----Original Message----- From: freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.o rg [mailto:freeradius-users-bounces+adam.king=intechnology.co.uk@lists.free radius.org] On Behalf Of Ivan Kalik Sent: 17 June 2008 12:26 To: FreeRadius users mailing list Subject: RE: matching on IP Address You have multiple sql instances. Are you sure that instance called "sql" is connecting to that database? Or should it be sql1: or sql2:? Ivan Kalik Kalik Informatika ISP This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586. The contents of this message may be privileged and confidential. If you have received this message in error, you may not use, disclose, copy or distribute its content in anyway. Please notify the sender immediately. All messages are scanned for all viruses.
In 2.0 you can also use unlang to update the request: http://freeradius.org/radiusd/man/unlang.html Ivan Kalik Kalik Informatika ISP Dana 17/6/2008, "King, Adam" <adam.king@intechnology.com> piše:
I have switched it to sql1: so the statement now reads if("%{sql1: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='%{Packet-Src-IP-Address}' AND realm='adam'}" >0 ) { redundant { sql1 sql2 } } Obviously the redundant section isn't being picked up at the moment which is why it needed to be sql1: or sql2: thanks for that (I will come back to the redundant section at the moment What I need to work out now is how to have the realm working as a variable eg ... AND realm='%{realm}'}"... I am reading the freeradius wiki, specifically http://wiki.freeradius.org/Adding%2C_Removing%2C_Modifying_Attributes_fo r_further_processing Is this the best way to go about this? Assuming the way I am approaching this is possible?! Thanks again
Adam King Network Engineer adam.king@intechnology.com
InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com
-----Original Message-----
From: freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.o rg [mailto:freeradius-users-bounces+adam.king=intechnology.co.uk@lists.free radius.org] On Behalf Of Ivan Kalik Sent: 17 June 2008 12:26 To: FreeRadius users mailing list Subject: RE: matching on IP Address
You have multiple sql instances. Are you sure that instance called "sql" is connecting to that database? Or should it be sql1: or sql2:?
Ivan Kalik Kalik Informatika ISP This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586.
The contents of this message may be privileged and confidential. If you have received this message in error, you may not use,
disclose, copy or distribute its content in anyway. Please notify the sender immediately.
All messages are scanned for all viruses.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi, thanks for the help so far, the match based on the ip and the realm now works! As mentioned below the redundant section from the sites-enabled/default file does not process so the if statement needs sql1: or sql2: in there instead of sql: and the redundant section picking up on the live server. In radiusd.conf there are 2 lines saying $INCLUDE sql1.conf and $INCLUDE sql2.conf. How can I get this working? Thanks again Adam King Network Engineer adam.king@intechnology.com InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com -----Original Message----- From: freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.org] On Behalf Of Ivan Kalik Sent: 17 June 2008 13:50 To: FreeRadius users mailing list Subject: RE: matching on IP Address In 2.0 you can also use unlang to update the request: http://freeradius.org/radiusd/man/unlang.html Ivan Kalik Kalik Informatika ISP Dana 17/6/2008, "King, Adam" <adam.king@intechnology.com> piše:
I have switched it to sql1: so the statement now reads if("%{sql1: SELECT COUNT(nas_ip) FROM `nas_ip` WHERE nas_ip='%{Packet-Src-IP-Address}' AND realm='adam'}" >0 ) { redundant { sql1 sql2 } } Obviously the redundant section isn't being picked up at the moment which is why it needed to be sql1: or sql2: thanks for that (I will come back to the redundant section at the moment What I need to work out now is how to have the realm working as a variable eg ... AND realm='%{realm}'}"... I am reading the freeradius wiki, specifically http://wiki.freeradius.org/Adding%2C_Removing%2C_Modifying_Attributes_fo r_further_processing Is this the best way to go about this? Assuming the way I am approaching this is possible?! Thanks again
Adam King Network Engineer adam.king@intechnology.com
This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586. The contents of this message may be privileged and confidential. If you have received this message in error, you may not use, disclose, copy or distribute its content in anyway. Please notify the sender immediately. All messages are scanned for all viruses.
Hi, thanks for the help so far, the match based on the ip and the realm now works! As mentioned below the redundant section from the sites-enabled/default file does not process so the if statement needs sql1: or sql2: in there instead of sql:
Wrong. The statement needs hose prefixes because those are the names of defined sql instances.
In radiusd.conf there are 2 lines saying $INCLUDE sql1.conf and $INCLUDE sql2.conf. How can I get this working?
Let me guess: instances start with sql1 {... and not sql sql1 {... Ivan Kalik Kalik Informatika ISP
Wrong. The statement needs hose prefixes because those are the names of defined sql instances. In the default file the if statement has the sql1: or sql2: prefix as if it is left as the sql: prefix it doesn't seem to read the redundant section to connect to the 2nd database.
Let me guess: instances start with sql1 {... and not sql sql1 {...
Actually no, in the sql1.conf file I have sql sql1 { and in the sql2.conf file I have sql sql2 { Adam King Network Engineer adam.king@intechnology.com InTechnology plc Support 0845 120 7070 Telephone 01423 850000 Facsimile 01423 858866 www.intechnology.com -----Original Message----- From: freeradius-users-bounces+adam.king=intechnology.co.uk@lists.freeradius.o rg [mailto:freeradius-users-bounces+adam.king=intechnology.co.uk@lists.free radius.org] On Behalf Of Ivan Kalik Sent: 17 June 2008 17:46 To: FreeRadius users mailing list Subject: RE: matching on IP Address
Hi, thanks for the help so far, the match based on the ip and the realm now works! As mentioned below the redundant section from the sites-enabled/default file does not process so the if statement needs sql1: or sql2: in there instead of sql:
Wrong. The statement needs hose prefixes because those are the names of defined sql instances.
In radiusd.conf there are 2 lines saying $INCLUDE sql1.conf and $INCLUDE sql2.conf. How can I get this working?
Let me guess: instances start with sql1 {... and not sql sql1 {... Ivan Kalik Kalik Informatika ISP - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html This is an email from InTechnology plc, Central House, Beckwith Knowle, Harrogate, UK, HG3 1UG. Registered in England 3916586. The contents of this message may be privileged and confidential. If you have received this message in error, you may not use, disclose, copy or distribute its content in anyway. Please notify the sender immediately. All messages are scanned for all viruses.
In the default file the if statement has the sql1: or sql2: prefix as if it is left as the sql: prefix it doesn't seem to read the redundant section to connect to the 2nd database.
That's how it should be. You don't have an sql instance named "sql", just "sql1" and "sql2". Ivan Kalik Kalik Informatika ISP
participants (2)
-
Ivan Kalik -
King, Adam