Clients not tied to a virtual server when loaded from a MySQL database
Hi all, I'm trying to load my clients from a MySQL database and wish to 'tie' them to specific virtual servers. Using the default SQL nas table query, I get the following: rlm_sql (sql): Processing generate_sql_clients rlm_sql (sql) in generate_sql_clients: query is SELECT id, nasname, shortname, type, secret, server FROM nas rlm_sql (sql): Reserving sql socket id: 4 rlm_sql_mysql: query: SELECT id, nasname, shortname, type, secret, server FROM nas rlm_sql (sql): Read entry nasname=1.1.1.1,shortname=1.1.1.1,secret=testing111 rlm_sql (sql): Adding client 1.1.1.1 (1.1.1.1, server=vs1) to clients list rlm_sql (sql): Read entry nasname=1.1.1.1,shortname=1.1.1.1,secret=testing222 rlm_sql (sql): Adding client 1.1.1.1 (1.1.1.1, server=vs2) to clients list Failed to add duplicate client 1.1.1.1 rlm_sql (sql): Released sql socket id: 4 rlm_sql (sql): Failed to add client 1.1.1.1 (1.1.1.1) to clients list. Maybe there's a duplicate? Failed to load clients from SQL. FR is clearly seeing the separate virtual server names (vs1 and ns2) but it says there's a duplicate. Now yes they do have the same IP address but they are tied to different virtual servers, making them different client definitions. If I manually place a 1.1.1.1 client inside my server vs1 block and the same in my server vs2 block, it loads them separately just fine, which is great and exactly what I'm after but I wish to load them from sql. Is it possible to have clients 'tied' into separate virtual servers like this from sql on start up? I'm also using a dynamic_clients definition inside the virtual server and this is loading 'duplicate' entries into separate virtual servers perfectly, but I guess that's because the dynamic_clients client definition is actually already inside the virtual server block. This works great but I can't get the loading on start up working from the nas table query as well. (I did notice the dynamic _clients sql query for the server is not even called, I'm presuming because it is already inside a virtual server block, it doesn't need to fire at all.) I'm running FR v2.2.5. Cheers very much all, Kev/.
Kev Pearce wrote:
I’m trying to load my clients from a MySQL database and wish to ‘tie’ them to specific virtual servers.
That should work.
FR is clearly seeing the separate virtual server names (vs1 and ns2) but it says there’s a duplicate…
Hmm... OK.
Now yes they do have the same IP address but they are tied to different virtual servers, making them different client definitions.
Yes.
Is it possible to have clients ‘tied’ into separate virtual servers like this from sql on start up?
Right now, no. The code in v2.2.5 doesn't tie clients to virtual servers like that. I'll have to go fix it... Alan DeKok.
Kev Pearce wrote:
Is it possible to have clients ‘tied’ into separate virtual servers like this from sql on start up?
Please try the v2.x.x branch from github. I've put in a patch which should work. Alan DeKok.
Brilliant Alan, thank you, I'll give it a try. Cheers Kev/. -----Original Message----- From: freeradius-users-bounces+email.me=kevp.com@lists.freeradius.org [mailto:freeradius-users-bounces+email.me=kevp.com@lists.freeradius.org] On Behalf Of Alan DeKok Sent: 02 September 2014 22:14 To: FreeRadius users mailing list Subject: Re: Clients not tied to a virtual server when loaded from a MySQL database Kev Pearce wrote:
Is it possible to have clients ‘tied’ into separate virtual servers like this from sql on start up?
Please try the v2.x.x branch from github. I've put in a patch which should work. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Alan DeKok -
Kev Pearce