SQLIPPOOL/IPPOOL prefix/range format
Hi, SQLIPPOOL requires, maintenance of an IP address table carrying individual IPs Is there a way to handle IP prefixes (prefix/range format) so that in large networks having many different networks could main and utilze this effectively. For example it would be cumbersome if it happens to populate a table with each IP of 10.10.0.0/16. The other query is how would it affect the performance if it happens to scan through the entire table during new ip assignment of a client(e.g. mobile device). On the contrary, Perl has Net::IP for handling ip prefixes which may be better in performance when it comes to large deployments. What is your opinion please ? Is there a way/module to handle this? Thanks a lot for your thoughts/assistance. rg
rsg wrote:
Hi,
SQLIPPOOL requires, maintenance of an IP address table carrying individual IPs
Is there a way to handle IP prefixes (prefix/range format) so that in large networks having many different networks could main and utilze this effectively.
Sure; write an "allocate-find" SQL query that does just that. You'd probably need a stored procedure. There's no native support for it in the module.
For example it would be cumbersome if it happens to populate a table with each IP of 10.10.0.0/16.
Shrug. It's only 64k rows. I doubt it would be prohibitively expensive.
The other query is how would it affect the performance if it happens to scan through the entire table during new ip assignment of a
The default SQL schemas for the radippool table are indexed. It won't do a sequential scan, it'll fetch just one row.
client(e.g. mobile device). On the contrary, Perl has Net::IP for handling ip prefixes which may be better in performance when it comes to large deployments.
What is your opinion please ? Is there a way/module to handle this?
Thanks a lot for your thoughts/assistance.
rg - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thanks a lot for the reply and valuable suggestions Phil. Sorry for the mistyped IP prefix: 10.0.0.0/16 would make sense I guess. Could you think of the trouble if we are to have tables with different subnets allocated to different networks. Regards, rg On Mon, Mar 31, 2008 at 12:31 PM, Phil Mayers <p.mayers@imperial.ac.uk> wrote:
rsg wrote:
Hi,
SQLIPPOOL requires, maintenance of an IP address table carrying individual IPs
Is there a way to handle IP prefixes (prefix/range format) so that in large networks having many different networks could main and utilze this effectively.
Sure; write an "allocate-find" SQL query that does just that. You'd probably need a stored procedure.
There's no native support for it in the module.
For example it would be cumbersome if it happens to populate a table with each IP of 10.10.0.0/16.
Shrug. It's only 64k rows. I doubt it would be prohibitively expensive.
The other query is how would it affect the performance if it happens to scan through the entire table during new ip assignment of a
The default SQL schemas for the radippool table are indexed. It won't do a sequential scan, it'll fetch just one row.
client(e.g. mobile device). On the contrary, Perl has Net::IP for handling ip prefixes which may be better in performance when it comes to large deployments.
What is your opinion please ? Is there a way/module to handle this?
Thanks a lot for your thoughts/assistance.
rg - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi, Can you provide me with some more info to proceed with this? I'm not quite sure of how to do it with "allocate-find". How could I define IP Prefixes and have my DB tables filled only with network prefixes? Many thanks for your help. rg On Mon, Mar 31, 2008 at 12:42 PM, rsg <ranil.santhish@gmail.com> wrote:
Thanks a lot for the reply and valuable suggestions Phil.
Sorry for the mistyped IP prefix: 10.0.0.0/16 would make sense I guess. Could you think of the trouble if we are to have tables with different subnets allocated to different networks.
Regards, rg
On Mon, Mar 31, 2008 at 12:31 PM, Phil Mayers <p.mayers@imperial.ac.uk> wrote:
rsg wrote:
Hi,
SQLIPPOOL requires, maintenance of an IP address table carrying individual IPs
Is there a way to handle IP prefixes (prefix/range format) so that in large networks having many different networks could main and utilze this effectively.
Sure; write an "allocate-find" SQL query that does just that. You'd probably need a stored procedure.
There's no native support for it in the module.
For example it would be cumbersome if it happens to populate a table with each IP of 10.10.0.0/16.
Shrug. It's only 64k rows. I doubt it would be prohibitively expensive.
The other query is how would it affect the performance if it happens to scan through the entire table during new ip assignment of a
The default SQL schemas for the radippool table are indexed. It won't do a sequential scan, it'll fetch just one row.
client(e.g. mobile device). On the contrary, Perl has Net::IP for handling ip prefixes which may be better in performance when it comes to large deployments.
What is your opinion please ? Is there a way/module to handle this?
Thanks a lot for your thoughts/assistance.
rg - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
rsg wrote:
Hi,
Can you provide me with some more info to proceed with this?
There's no need to email me directly; I read the list.
I'm not quite sure of how to do it with "allocate-find".
Neither am I. It was a general suggestion. Personally I wouldn't do it that way; I'd just insert the IPs into the table and let the module do it's work (unless you're leasing tens of millions of ips). I guess if you want the radippool to only contain "active" ips it would be something like the following: allocate-find = "select freeip('%P')" allocate-update = "insert into radippool ..." allocate-clear = "delete from radippool ..." "freeip" would need to be a database stored procedure that did something like: create function freeip(text) as $$$ # mypools contains a mapping of pool name to netblock for netblock in select net from mypools where pool_name=$1 # for each block in the pool, try to find a free IP ips = select ip from radippool where ip<<netblock and pool_name=$1 free_ips = netblock - ips if free_ips: return free_ips[0] $$$ language pseudo-python ...however, the stored procedure language would need IP address awareness and the ability to intersect/subtract CIDR blocks and IP lists. I'm not aware of any such capability in e.g. postgres plpgsql, so you'd need python or perl. Basically, you'll have to write this yourself.
How could I define IP Prefixes and have my DB tables filled only with network prefixes?
That's not possible. You will have to retain state per-IP in order to map the nas+port (or whatever key you choose) to the IP leased and expiry time. From your email you sound like you're familiar with perl - you may wish to use rlm_perl instead of rlm_sqlippool; however you'll basically have to re-implement rlm_sqlippool.
participants (2)
-
Phil Mayers -
rsg