not logged in | [Login]
Always use radiusd -X
when debugging!
Robust dynamic IPv4 pools for FreeRADIUS Server allowing arbitrary groups of NASs to share IP address blocks in an efficient and flexible manner.
This module implements dynamic IPv4 address pools with the following features:
The module uses following netvim SQL tables:
Startup
This script generates MySQL queries to update the ips table after making changes in ip_pools table. You should run the queries each time you add IP pools.
#!/usr/bin/env php
<?php
error_reporting(E_ALL);
mysql_connect("localhost", "root", "password");
mysql_select_db("netvim");
$rows = mysql_query("select ip_start, ip_stop from ip_pools");
while ($row = mysql_fetch_assoc($rows)) {
$todo = $row["ip_stop"] - $row["ip_start"] + 1;
$done = 0;
$ineach = 100;
$startwith = $row["ip_start"];
echo "LOCK TABLES ips WRITE;\n";
while ($done < $todo) {
echo "REPLACE INTO ips (ip) VALUES ";
for ($i = 1; $i < $ineach && $done < $todo; $i++, $startwith++, $done++) {
echo "($startwith), ";
}
echo "($startwith);\n";
$startwith++; $done++;
}
echo "UNLOCK TABLES;\n";
}
?>
Last edited by Arran Cudbard-Bell, 2011-11-21 12:51:56
Sponsored by Network RADIUS