RLM_SQLIPPOOL_TOOL(8)

๐Ÿ“ฆ
version 3.2.10 ยท 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, opensuse-leap 16.0

๐Ÿ’… RLM_SQLIPPOOL_TOOL ๐Ÿ’…

okay bestie, so this is the manual page for rlm_sqlippool_tool, straight out of the System Manager's Manual โ€” and yes, it's the whole page, i'm not skipping a single crumb ๐Ÿ“


โœจ NAME โœจ

rlm_sqlippool_tool โ€” the girl whose entire job is managing SQL IP pools. periodt.


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

Two whole moods, pick your fighter:

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]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

So rlm_sqlippool_tool is literally the tool that manages IP addresses in the SQL IP pools that FreeRADIUS uses. iconic behavior only ๐Ÿ‘‘

It's giving two options, and honestly both slay:

  • it will output SQL that you can use to manipulate the database, or
  • it will interact directly with a database to populate an IP pool table.

The format of the SQL output โ€” and the commands it runs on the database โ€” are all based on the default FreeRADIUS ippool schemas. The fields it populates are pool_name and framedipaddress. Every other field? Left completely alone to be populated with their database defaults ๐Ÿ™ˆ (she minds her own business, as she should).


๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -c capacity โ€” number of IP addresses to populate the pool with. Defaults to 65536, or the maximum number that can be provisioned between the start and end of the range. no cap, unless the range says otherwise ๐Ÿ’€
  • -d dialect โ€” the 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. we love a flexible queen ๐ŸŒˆ
  • -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. so brave of her fr fr ๐Ÿ”ฅ
  • -i instance โ€” used in conjunction 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. main character energy ๐Ÿ’–
  • -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 existing IP addresses in the pool. Using this allows for more controlled growth of a sparsely populated pool. ngl that's kind of a vibe check for your pool ๐ŸŒฑ
  • -y pool_defs_yaml_file โ€” a YAML formatted file containing specifications for a number of pools. multiple pools at once? she ate ๐Ÿ’…

โญ EXAMPLES โญ

producing MySQL formatted SQL

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

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

same thing, but talking straight to the database

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 10.0.0.1 -e 10.0.0.199 \
    -t dhcpippool -f /etc/raddb

YAML era

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 โ€” copy this exactly, bestie, it's not a drill ๐Ÿ˜ญ:

pool_with_a_single_contiguous_range:
  - start:    192.0.2.3
    end:      192.0.2.250

pool_with_a_single_sparse_range:
  - start:    10.10.10.0
    end:      10.10.20.255
    capacity: 200

pool_with_multiple_ranges:
  - start:    10.10.10.1
    end:      10.10.10.253
  - start:    10.10.100.0
    end:      10.10.199.255
    capacity: 1000

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

v6_pool_with_sparse_range:
  - start:    '2001:db8:1:2::'
    end:      '2001:db8:1:2:ffff:ffff:ffff:ffff'
    capacity: 200
โš ๏ธ heads up: those v6 ranges are in quotes for a reason โ€” keep them exactly like that ๐Ÿซถ

๐Ÿ”ฎ PREREQUISITES ๐Ÿ”ฎ

  • To output formatted SQL, the Perl Template::Toolkit module is required. non-negotiable ๐Ÿ’€
  • Direct connection to databases is done using Perl DBI. The appropriate Perl DBD driver needs to be installed to enable this functionality. so like, install your driver before you come for her ๐Ÿ™ˆ

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


๐Ÿ’œ AUTHORS ๐Ÿ’œ

Nick Porter <nick@portercomputing.co.uk> โ€” the legend responsible, we stan ๐Ÿซถ


and that's the whole page, bestie โ€” no crumbs left behind โœจ This was RLM_SQLIPPOOL_TOOL, part of the System Manager's Manual โ€” go forth and populate those pools, and may your pool_name and framedipaddress always be iconic ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from