OK, I've committed a new rlm_ippool_tool that works with the latest
rlm_ippool.c. As such, anyone using rlm_ippool and FreeRADIUS can
now easily upgrade to the new rlm_ippool code without losing data.
http://www.freeradius.org/cgi-bin/cvsweb.cgi/~checkout~/radiusd/src/modules/rlm_ippool/rlm_ippool.c?rev=1.25&content-type=text/plain
http://www.freeradius.org/cgi-bin/cvsweb.cgi/~checkout~/radiusd/src/modules/rlm_ippool/rlm_ippool_tool.c?rev=1.3&content-type=text/plain

If you need a copy of the old rlm_ippool_tool, the one in branch_0_9
will work with the earlier version of rlm_ippool. This is (for reading
the DBs which is what's important here) functionally identical to
ippooltool which is probably known to those of you who've suffered
problems with rlm_ippool before.
http://www.freeradius.org/cgi-bin/cvsweb.cgi/~checkout~/radiusd/src/modules/rlm_ippool/rlm_ippool_tool.c?rev=1.3.2.1&content-type=text/plain

And if all else fails, you can extract your IPpool details from radwho -r
if you're using utmp support.

So now we need testers. I'm running the new code myself, and its on track
for 0.9.2, barring new failure reports. Unless anything else comes up, this
will go into branch_0_9 on Wednesday next week, and 0.9.2 will hopefully
happen on Thursday or Friday. (And keep in mind that's probably on Australian
time, so I could be 16 hours ahead of you.)

Here're the scripts I used to update my installation with the minimum of downtime:

(Assuming you're in the dir with db.main* and have a copy of the old rlm_ippool_tool
compiled here as rlm_ippool_tool.091)

/etc/init.d/freeradius stop
./rlm_ippool_tool.091 -v db.mainpool db.mainindex | ./poolfromiptool.pl |sort -k 5 >1
radwho -r | ./poolfromradwho.pl |sort -k 5 >2
diff 1 2
        No differences is good. Otherwise you have to work out which is more correct
        and use it below.
mkdir save
mv db.main* save
(Install new FreeRADIUS with new rlm_ippool code. Start and stop server)
        This generates new db.mainpool and db.mainindex files for you
bash 1
        Or 2 if you prefer. :-)
rlm_ippool_tool -v db.mainpool db.mainindex | ./poolfromiptool.pl |sort -k 5 >3
diff3 1 2 3
        Again, no differences is good. 3 should match whichever of 1 or 2 you used
/etc/init.d/freeradius start

Test wildly. :-)

And now for the scripts:
poolfromradwho.pl:
#! /usr/bin/perl


while (<>) {
        next unless /^.*,.*,PPP,S(\d+),.*,(\d+\.\d+\.\d+\.\d+),(\d+\.\d+\.\d+\.\d+)$/;
        my ($tty, $nas, $ip) = ($1, $2, $3);

# Only want pool IPs
        next unless $ip =~ /^150\.203\.110\.(\d+)/;
# Skip static IPs
        next if ($1 > 217);
        print "rlm_ippool_tool -n db.mainpool db.mainindex $ip $nas $tty\n"
}
poolfromiptool.pl
#! /usr/bin/perl


while (<>) {
        next unless /NAS:(\d+\.\d+\.\d+\.\d+) port:(0x[0-9a-fA-Z]+) - 
ipaddr:(\d+\.\d+\.\d+\.\d+) active:1/;
        my ($nas, $tty, $ip) = ($1, hex($2), $3);

# Only want pool IPs
        next unless $ip =~ /^150\.203\.110\.(\d+)/;
# Skip static IPs
        next if ($1 > 217);
        print "rlm_ippool_tool -n db.mainpool db.mainindex $ip $nas $tty\n"
}

--
Paul "TBBle" Hampson
Bubblesworth Pty Ltd (ABN: 51 095 284 361)
[EMAIL PROTECTED]

On a sidewalk near Portland State
University someone wrote `Trust Jesus', and
someone else wrote `But Cut the Cards'.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to