redundant ippools using rlm_ippool in v1.1.3
I am stuck with v1.1.3 in this case, otherwise I would use rlm_sqlippool. I need to assign IP addresses depending on the NAS the user comes in: 'huntgroups' contains lns0x NAS-IP-Address == a.b.c.x lns0y NAS-IP-Address == a.b.c.y In 'users' I set 'Post-Auth-Type' depending on 'Huntgroup-Name' (Userdata are in a MySQL database): DEFAULT Huntgroup-Name == "lns0x", Post-Auth-Type := LNS0X Fall-Through = Yes DEFAULT Huntgroup-Name == "lns0y", Post-Auth-Type := LNS0Y Fall-Through = Yes The modules section in radiusd.conf has the ippool definitions like # subnets on lns0x ippool lns0x-00 { range-start = 192.168.111.1 range-stop = 192.168.111.6 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0x_00 ip-index = /var/cache/freeradius/db.index_lns0x_00 override = yes maximum-timeout = 0 } ippool lns0x-01 { range-start = 192.168.111.9 range-stop = 192.168.111.14 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0x_01 ip-index = /var/cache/freeradius/db.index_lns0x_01 override = yes maximum-timeout = 0 } # subnets on lns0y ippool lns0x-00 { range-start = 192.168.112.1 range-stop = 192.168.112.6 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0y_00 ip-index = /var/cache/freeradius/db.index_lns0y_00 override = yes maximum-timeout = 0 } ippool lns0x-01 { range-start = 192.168.112.9 range-stop = 192.168.112.14 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0y_01 ip-index = /var/cache/freeradius/db.index_lns0y_01 override = yes maximum-timeout = 0 } My first attempt on the post-auth Section looked like Post-Auth-Type LNS0X { redundant { lns0x-00 lns0x-01 } } Post-Auth-Type LNS0Y { redundant { lns0y-00 lns0y-01 } } This does not work because the 'Pool-Name' check attribute is missing in users. If I set Pool-Name in users, addresses are only returned from the matching poolname module until it is depleted, the alternative pool module is not called. Is it possible to achieve the intended setup with rlm_ippool or is this only possible with rlm_sqlippool? Mit freundlichem Gru�, -- Matthias Witte - witte@netzquadrat.de Telefon: +49 (0)211-30 20 33-18 Telefax: +49 (0)211-30 20 33-22 [netzquadrat] GmbH - Gladbacher Str. 74 - 40219 D�sseldorf HRB D�sseldorf 36121 - Gesch�ftsf�hrer: Thilo Salmon, Tim Mois Steuernummer: 106/5719/1836, Umsatzsteuer-ID: DE246863050 billiger-telefonieren.de - billiger-surfen.de - stromseite.de - sms.de
there is strict condition in rlm_ippool.c if ((vp = pairfind(request->config_items, PW_POOL_NAME)) != NULL){ if (data->name == NULL || strcmp(data->name,vp->strvalue)) so pool_name should be equal to config's name of pool although, 01 Jul 2004 Kostas Kalevras wrote ( http://www.mail-archive.com/freeradius-users@lists.freeradius.org/msg06686.h... )
Do a cvs update on the ippool module or wait for tomorrow's CVS snapshot. Then you can set Pool-Name to DEFAULT and it will match all of the ippool module instances.
there is no other comparison of pool name with any other strings, so i apply my own patch for my own radius-server. it works. You should to set Pool-Name to "DEFAULT" in 'users'. like this
DEFAULT Huntgroup-Name == "lns0x", Pool-Name := DEFAULT, Post-Auth-Type := LNS0X Fall-Through = Yes
DEFAULT Huntgroup-Name == "lns0y", Pool-Name := DEFAULT, Post-Auth-Type := LNS0Y Fall-Through = Yes
patch are: --8<--------------------------------------------------------------------- --- rlm_ippool.c-orig 2008-09-01 12:43:53.000000000 +0600 +++ rlm_ippool.c 2008-09-01 12:44:13.000000000 +0600 @@ -480,7 +480,10 @@ * run only if they match */ if ((vp = pairfind(request->config_items, PW_POOL_NAME)) != NULL){ - if (data->name == NULL || strcmp(data->name,vp->strvalue)) + if (data->name == NULL || (strcmp(data->name,vp->strvalue) && strcmp("DEFAULT", vp->strvalue))) return RLM_MODULE_NOOP; } else { DEBUG("rlm_ippool: Could not find Pool-Name attribute."); --8<--------------------------------------------------------------------- May be i made it wrong, but it works. 2Kostas: Is there another way to create redundant ippools? why current version of rlm_ippools does not work with DEFAULT name? we do something wrong?
I am stuck with v1.1.3 in this case, otherwise I would use rlm_sqlippool.
I need to assign IP addresses depending on the NAS the user comes in:
'huntgroups' contains
lns0x NAS-IP-Address == a.b.c.x lns0y NAS-IP-Address == a.b.c.y
In 'users' I set 'Post-Auth-Type' depending on 'Huntgroup-Name' (Userdata are in a MySQL database):
DEFAULT Huntgroup-Name == "lns0x", Post-Auth-Type := LNS0X Fall-Through = Yes
DEFAULT Huntgroup-Name == "lns0y", Post-Auth-Type := LNS0Y Fall-Through = Yes
The modules section in radiusd.conf has the ippool definitions like
# subnets on lns0x ippool lns0x-00 { range-start = 192.168.111.1 range-stop = 192.168.111.6 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0x_00 ip-index = /var/cache/freeradius/db.index_lns0x_00 override = yes maximum-timeout = 0 }
ippool lns0x-01 { range-start = 192.168.111.9 range-stop = 192.168.111.14 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0x_01 ip-index = /var/cache/freeradius/db.index_lns0x_01 override = yes maximum-timeout = 0 }
# subnets on lns0y ippool lns0x-00 { range-start = 192.168.112.1 range-stop = 192.168.112.6 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0y_00 ip-index = /var/cache/freeradius/db.index_lns0y_00 override = yes maximum-timeout = 0 }
ippool lns0x-01 { range-start = 192.168.112.9 range-stop = 192.168.112.14 netmask = 255.255.255.248 cache-size = 6 session-db = /var/cache/freeradius/db.pool_lns0y_01 ip-index = /var/cache/freeradius/db.index_lns0y_01 override = yes maximum-timeout = 0 }
My first attempt on the post-auth Section looked like
Post-Auth-Type LNS0X { redundant { lns0x-00 lns0x-01 } }
Post-Auth-Type LNS0Y { redundant { lns0y-00 lns0y-01 } }
This does not work because the 'Pool-Name' check attribute is missing in users.
If I set Pool-Name in users, addresses are only returned from the matching poolname module until it is depleted, the alternative pool module is not called.
Is it possible to achieve the intended setup with rlm_ippool or is this only possible with rlm_sqlippool?
Mit freundlichem Gru?,
-- С уважением, Михаил Черняховский, НП "Магинфоцентр", г. Магнитогорск. (3519) 212-474.
The patch works as promised in version 1.1.3 if applied. The post-auth section in radiusd.conf doesn't though. As suggested by Michael with Kostas' patch applied you have to pass "DEFAULT" as Pool-Name check attribute in 'users'.
You should to set Pool-Name to "DEFAULT" in 'users'. like this
DEFAULT Huntgroup-Name == "lns0x", Pool-Name := DEFAULT, Post-Auth-Type := LNS0X Fall-Through = Yes
DEFAULT Huntgroup-Name == "lns0y", Pool-Name := DEFAULT, Post-Auth-Type := LNS0Y Fall-Through = Yes
The post-auth section as posted by me does not work:
Post-Auth-Type LNS0X { redundant { lns0x-00 lns0x-01 } }
lns0x-01 is for unknown reasons not called. It has to be: Post-Auth-Type LNS0X { group { lns0x-00 { ok = return fail = 1 } lns0x-01 { ok = return fail = 1 } notfound = reject } } The accounting section contains simply lns0x-00 lns0x-01 lns0y-00 lns0y-01 Thanks for your help! -- Matthias Witte - witte@netzquadrat.de Telefon: +49 (0)211-30 20 33-18 Telefax: +49 (0)211-30 20 33-22 [netzquadrat] GmbH - Gladbacher Str. 74 - 40219 D�sseldorf HRB D�sseldorf 36121 - Gesch�ftsf�hrer: Thilo Salmon, Tim Mois Steuernummer: 106/5719/1836, Umsatzsteuer-ID: DE246863050 billiger-telefonieren.de - billiger-surfen.de - stromseite.de - sms.de
Здравствуйте, FreeRadius! Вы писали 16 сентября 2008 г., 23:23:13:
The patch works as promised in version 1.1.3 if applied. The post-auth section in radiusd.conf doesn't though.
As suggested by Michael with Kostas' patch applied you have to pass "DEFAULT" as Pool-Name check attribute in 'users'.
You should to set Pool-Name to "DEFAULT" in 'users'. like this
DEFAULT Huntgroup-Name == "lns0x", Pool-Name := DEFAULT, Post-Auth-Type := LNS0X Fall-Through = Yes
DEFAULT Huntgroup-Name == "lns0y", Pool-Name := DEFAULT, Post-Auth-Type := LNS0Y Fall-Through = Yes
The post-auth section as posted by me does not work:
Post-Auth-Type LNS0X { redundant { lns0x-00 lns0x-01 } }
what about simple: Post-Auth-Type LNS0X { lns0x-00 lns0x-01 } Post-Auth-Type LNS0Y { lns0y-00 lns0y-01 }
lns0x-01 is for unknown reasons not called. It has to be: are lns0x-00 have no free entries? in my case second pool used only when first does't give free ip.
participants (2)
-
Matthias Witte -
Michael Chernyakhovsky