Framed-IPv6-Prefix and Delegated-IPv6-Prefix + SQL

Martin Brault martyb at creenet.com
Wed Oct 22 04:48:38 CEST 2014


Hello,

I have been searching how to add Framed and Delegated IPv6 accounting 
data into SQL and have come across this relatively old info:

http://freeradius.1045715.n5.nabble.com/IPv6-Accounting-td4432174.html

I am using RedHat/CentOS EL7 with the packaged freeradius-3.0.1

I have started modding queries.conf and have made some good progress:

specific changes, I added columns in the SQL radacct table (and I 
altered the table to add the columns in question):

                column_list = "\
                         acctsessionid,          acctuniqueid, 
  username, \
                         realm,                  nasipaddress, 
  nasportid, \
                         nasporttype,            acctstarttime, 
  acctupdatetime, \
                         acctstoptime,           acctsessiontime, 
  acctauthentic, \
                         connectinfo_start,      connectinfo_stop, 
  acctinputoctets, \
                         acctoutputoctets,       calledstationid, 
  callingstationid, \
                         acctterminatecause,     servicetype, 
  framedprotocol, \
                         framedipaddress,        framedipv6address, 
  framedipv6pool,\
                         framedipv6prefix,       delegatedipv6prefix"



and in the start { query, I added:

'%{Framed-IPv6-Address}',
'%{Framed-IPv6-Pool}',
'%{Framed-IPv6-Prefix}',
'%{Delegated-IPv6-Prefix}'
)"


When I look at the detail file, I see the info I am wishing to insert 
into the database, note the mask of /64 and /56

Tue Oct 21 17:30:04 2014
         Acct-Session-Id = '0098EF19'
         Tunnel-Type:0 = L2TP
         Tunnel-Medium-Type:0 = IPv4
         Tunnel-Server-Endpoint:0 = '192.168.204.210'
         Tunnel-Client-Endpoint:0 = '192.168.204.231'
         Tunnel-Assignment-Id:0 = 'foo'
         Tunnel-Client-Auth-Id:0 = 'foo'
         Tunnel-Server-Auth-Id:0 = 'pppoe'
         Acct-Tunnel-Connection = '26314987'
         Delegated-IPv6-Prefix = 2001:db8:a000::/56
         Framed-Protocol = PPP
         Framed-Interface-Id = 5c73:a540:688f:37e2
         Framed-IPv6-Prefix = 2001:db8:a000:ff::/64
         Framed-IP-Address = 192.168.138.1
         User-Name = 'pppoeuser'
         Acct-Authentic = RADIUS
         X-Ascend-Connect-Progress = LAN-Session-Up
[...snip...]


strangely, when I check what was logged in the SQL table however, I get 
for some reason /38 netmask for both pieces of information (apologies 
for the formatting...):


MariaDB [radius]> select * from radacct where radacctid = '1494';

|      1494 | 009E2FDE      | 7a22c13be9bcca21aaab7d7494ed1826 | 
pppoeuser |           |       | 192.168.128.24 | 2546      | Virtual 
  | 2014-10-21 17:30:41 | 2014-10-21 17:30:41 | NULL         | 
   0 |               0 | RADIUS        | 2000000000        | 
       |               0 |              111 |                 | 
lag-72:450 |                    | Framed-User | PPP            | 
72.10.138.1     |                   |                | 
2001:db8:a000:ff:0:0:0:0/38 | 2001:db8:a000:0:0:0:0:0/38 |



why would the detail file have the correct /64 and /56 netmasks, yet the 
INSERT (which seems to explode the data into proper ipv6addr format with 
padded zeroes) would have this strange /38 netmask added?

I feel I am close, any help would be much appreciated.

Thanks,

M.


More information about the Freeradius-Users mailing list