rlm_sqlippool_tool - Man Page

manage SQL IP pools


rlm_sqlippool_tool -p pool_name -s range_start -e range_end -t table_name -d -f raddb_dir -i instance [-c capacity] [-x existing_ips_file]

rlm_sqlippool_tool -y pool_defs_yaml_file -t table_name -d -f raddb_dir -i instance [-x existing_ips_file]


rlm_sqlippool_tool is a tool to manage IP address in SQL IP pools as used by FreeRADIUS.  It will either output SQL that can be used to manipulate the database or will interact directly with a database to populate an IP pool table.

The format of the SQL output or the commands operated on the database are based on the default FreeRADIUS ippool schemas.  The fields populated are pool_name and framedipaddress.  All other fields are left to be populated with their database defaults.


-c capacity

Number of IP addreses to populate the pool with.  Defaults to 65536, or the maximum number that can be provisioned between the start and end of the range.

-d dialect

SQL dialect to use in producing the output.

-e range_end

End IP address in the pool range.  Either IPv4 or IPv6 addresses are allowed.

-f raddb_dir

Directory containing the FreeRADIUS configuration.  If this option is specified, then rlm_sqlippool_tool will parse the configuration and attempt to talk directly to the database server specified in the FreeRADIUS configuration.

-i instance

Used in conjuction with -f.  Specifies the name of the sql module instance to parse in the FreeRADIUS configuration.  Defaults to sql.

-p pool_name

The pool name to populate.

-s range_start

Start IP address in the pool range.  Either IPv4 or IPv6 addresses are allowed.

-t table_name

Name of the table in the database to populate.

-x existing_ips_file

A file containing exsiting IP addresses in the pool.  Use of this allows for more controlled growth of a sparesly populated pool.

-y pool_defs_yaml_file

A YAML formatted file containing specifications for a number of pools.


To produce MySQL formatted SQL for a pool named local populated with addresses from to

    $ rlm_sqlippool_tool -p local -s -e \
        -t dhcpippool -d mysql

To do the same but directly interacting with the SQL module configured in the FreeRADIUS configuration under /etc/raddb:

    $ rlm_sqlippool_tool -p local -s -e \
        -t dhcpippool -f /etc/raddb

To use a YAML file to specify the pool ranges to be populated, outputting PostgreSQL formatted SQL:

    $ rlm_sqlippool_tool -y pools.yaml -t dhcpippool -d postgresql

Yaml Format

A YAML file to populate multiple pools should be formatted like this:

      - start:

  - start:
    capacity: 200

  - start:
  - start:
    capacity: 1000

  - start:    '2001:db8:1:2:3:4:5:10'
    end:      '2001:db8:1:2:3:4:5:7f'

  - start:    '2001:db8:1:2::'
    end:      '2001:db8:1:2:ffff:ffff:ffff:ffff'
    capacity: 200


To output formatted SQL, the Perl Template::Toolkit module is required.

Direct connection to databases is done using Perl DBI.  The appropriate Perl DBD driver needs to be installed to enable this functionality.

See Also

radiusd.conf(5), raddb/mods-available/sql


Nick Porter <nick@portercomputing.co.uk>