sqlippool - duplicated ip address after freeradius restart
Hi, I use radius sqlippool to assign IP address to my users, yesterday, after a restart on radius service, it started to assign IP address that were already in use to the users. I'm almost crazy here, I don't know what can be causing this, we have been using this scheme for at least three months and this problem never happened. freeradius-2.1.12_1 I have this configuration in sites-enabled/default, post-auth block: if (Framed-Protocol == PPP) { sqlippool } and this in the accounting block: sqlippool this in the authorize block: update control { Pool-Name := "%{sql: SELECT nas_pool_name FROM naspool WHERE nas_ip=INET_ATON('%{NAS-IP-Address}')}" } mysql> desc naspool; +---------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------------+------+-----+---------+-------+ | nas_ip | int(10) unsigned | NO | PRI | 0 | | | nas_pool_name | varchar(30) | YES | | NULL | | +---------------+------------------+------+-----+---------+-------+ The strange is that most, if not all of the duplicated address, are between a specific NAS and a random one. Obs. The expiry-time is set on 1h, and the interim update is set on 10m. Any suggestions?
On 23/10/12 11:52, Antonio Modesto wrote:
Hi,
I use radius sqlippool to assign IP address to my users, yesterday, after a restart on radius service, it started to assign IP address that were already in use to the users. I'm almost crazy here, I don't know what can be causing this, we have been using this scheme for at least three months and this problem never happened.
Can you capture a debug of FR assigning a duplicate?
2012/10/23 Phil Mayers <p.mayers@imperial.ac.uk>
On 23/10/12 11:52, Antonio Modesto wrote:
Hi,
I use radius sqlippool to assign IP address to my users, yesterday, after a restart on radius service, it started to assign IP address that were already in use to the users. I'm almost crazy here, I don't know what can be causing this, we have been using this scheme for at least three months and this problem never happened.
Can you capture a debug of FR assigning a duplicate?
Unfortunately, it's kinda of hard to me to get a debug right now, it's a production server. I solved a part of the problem, I noticed that there where 98 clients connected on a specific NAS, but there was only 80 entries for that NAS on radippool table, thus there was a possibility of when a new client was establishing a connection, it would get an IP that was in use but was not in the table. The workaround was to disconnect these clients.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/** list/users.html <http://www.freeradius.org/list/users.html>
Antonio Modesto wrote:
I noticed that there where 98 clients connected on a specific NAS, but there was only 80 entries for that NAS on radippool table, thus there was a possibility of when a new client was establishing a connection, it would get an IP that was in use but was not in the table.
Well, that's the issue. Somehow it's assigning IPs, but not recording them. That's not really supposed to happen. Is your database OK? Alan DeKok.
It seems to be ok, the load average of the server: load averages: 0.00, 0.00, 0.00 I even created some indexes on radippool table: +-----------+------------+------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | +-----------+------------+------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+ | radippool | 0 | PRIMARY | 1 | id | A | 1047 | NULL | NULL | | BTREE | | | radippool | 1 | FramedIPAddress | 1 | FramedIPAddress | A | 523 | NULL | NULL | | BTREE | | | radippool | 1 | NASIPAddress | 1 | NASIPAddress | A | 69 | NULL | NULL | | BTREE | | | radippool | 1 | CallingStationID | 1 | CallingStationID | A | 1047 | NULL | NULL | | BTREE | | | radippool | 1 | username | 1 | username | A | 1047 | NULL | NULL | | BTREE | | | radippool | 1 | pool_name | 1 | pool_name | A | 1 | NULL | NULL | | BTREE | | +-----------+------------+------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+ 6 rows in set (0.00 sec) 2012/10/23 Alan DeKok <aland@deployingradius.com>
Antonio Modesto wrote:
I noticed that there where 98 clients connected on a specific NAS, but there was only 80 entries for that NAS on radippool table, thus there was a possibility of when a new client was establishing a connection, it would get an IP that was in use but was not in the table.
Well, that's the issue. Somehow it's assigning IPs, but not recording them. That's not really supposed to happen.
Is your database OK?
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Atenciosamente, * Antônio Modesto Gerente de TI* Praça Getúlio Vargas, 77 – Sala 308 – Centro Santo Antônio do Monte – MG – CEP: 35560-000 Tel:(37) 3281-2800 Contato: isimples@isimples.com.br http://www.isimples.com.br Aviso:Esta mensagem e quaisquer arquivos em anexo podem conter informações confidenciais e/ou privilegiadas. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, por favor, não leia, copie, repasse, imprima, guarde, nem tome qualquer ação baseada nessas informações. Notifique o remetente imediatamente por e-mail e apague a mensagem permanentemente. Atenção: embora a Isimples Telecom, tome seus cuidados para garantir a ausência de vírus neste e-mail, a empresa não se responsabiliza por quaisquer perdas ou danos decorrentes do uso da mensagem e seus anexos. A segurança e ausência de erros na transmissão do e-mail não podem ser garantidas, já que as informações podem ser interceptadas, corrompidas, perdidas, destruídas, atrasadas, chegarem incompletas, ou, ainda, conter vírus. Recomendamos checar se o e-mail e seus anexos contém vírus, uma vez que nem a Isimples Telecom ou o remetente se responsabilizam pela transmissão destes.
Antonio Modesto wrote:
It seems to be ok, the load average of the server:
load averages: 0.00, 0.00, 0.00
I even created some indexes on radippool table:
Well.. the default IP Pool indexes should be OK. And the default constraints should be OK. It's not an index problem. Alan DeKok.
Antonio Modesto wrote:
I use radius sqlippool to assign IP address to my users, yesterday, after a restart on radius service, it started to assign IP address that were already in use to the users.
Then the SQL IP Pool was erased somehow. Restarting FreeRADIUS won't change the SQL database.
The strange is that most, if not all of the duplicated address, are between a specific NAS and a random one.
Obs. The expiry-time is set on 1h, and the interim update is set on 10m.
Any suggestions?
Find out what is removing the IPs from the SQL pool. Alan DeKok.
participants (3)
-
Alan DeKok -
Antonio Modesto -
Phil Mayers