ipsec pool Tool
Synopsis
ipsec pool --status|--add|--del|--replace|--resize|--leases|--purge|--batch [options] ipsec pool --showattr|--statusattr|--addattr|--delattr [options]
Description
The ipsec pool utility manages virtual IP address pools and attributes stored
in an SQL database and provided to peers by the
attr-sql plugin.
The auxiliary ipsec command, if available, sets the execution path to
${libexecdir}/ipsec/ which is usually /usr/libexec/ipsec/ or
/usr/local/libexec/ipsec/. The ${libexecdir} directory can be configured
with the --libexecdir ./configure
option defaulting to ${prefix}/libexec).
The ipsec pool utility is automatically enabled with one of the
./configure options
--enable-attr-sql or --enable-sql
and can be configured with the following
strongswan.conf options
| Key | Default | Description |
|---|---|---|
database |
Database URI for the database that stores IP pools and configuration attributes. If it contains a password, make sure to adjust the access permissions of the config file accordingly |
|
load |
Plugins to load in ipsec pool tool |
Options
--status-
Show a list of installed pools with statistics plus nameserver info.
--showattr-
Show a keyword list of the major attribute types.
--statusattr [--hexout]-
hexoutOutput all values in hex format
Show a list of all attributes stored in the database with the values displayed in the native format if the type is known by --showattr, or in hex format otherwise.
--add <name> --start <start> --end <end> [--timeout <timeout>]-
nameName of the pool as used in
connections.<conn>.poolsinswanctl.confstartStart address of the pool
endEnd address of the pool
timeoutLease time in hours (use
d,m, orsto alternatively configure the time in days, minutes or seconds, respectively),0for static leasesAdd a new pool to the database.
--add <name> --addresses <file> [--timeout <timeout>]-
nameName of the pool as used in
connections.<conn>.poolsinswanctl.conffileFile where newline-separated pool addresses for are read from
Optionally each address can be pre-assigned to a roadwarrior identity, e.g.10.231.14.2=alice@strongswan.org. If a-(hyphen) is given instead of a file name, the addresses are read fromSTDIN. Reading addresses stops at the end of file or an empty line. Pools created with this command can not be resized.timeoutLease time in hours (use
d,m, orsto alternatively configure the time in days, minutes or seconds, respectively),0for static leasesAdd a list of pool addresses to the database.
--addattr <type> --addr|--mask|--server|--subnet|--string|--hex <value>-
typeA keyword from
--showattror a number from the range1..32767addrIPv4 or IPv6 address
maskIPv4 or IPv6 netmask (synonym for
--addr)serverIPv4 or IPv6 address of a server (synonym for --addr)
subnetIPv4 subnet[s] given by network/mask[,network/mask,…]
stringValue of a string-type attribute
hexHex value of any attribute
Add a new attribute to the database.
--del <name>-
nameName of the pool to delete
Delete a pool from the database.
--delattr <type> [--addr|--mask|--server|--subnet|--string|--hex <value>]-
typeA keyword from
--showattror a number from the range1..32767addrIPv4 or IPv6 address
maskIPv4 or IPv6 netmask (synonym for
--addr)serverIPv4 or IPv6 address of a server (synonym for
--addr)subnetIPv4 subnet[s] given by network/mask[,network/mask,…]
stringValue of a string-type attribute
hexHex value of any attribute
Delete a specific or all attributes of a given type from the database.
--replace <name> --start <start> --end <end> [--timeout <timeout>]-
nameName of the pool as used in
connections.<conn>.poolsinswanctl.confstartStart address of the new pool
endEnd address of the new pool
timeoutLease time in hours (use
d,m, orsto alternatively configure the time in days, minutes or seconds, respectively),0for static leasesReplace an existing pool in the database.
--replace <name> --addresses <file> [--timeout <timeout>]-
nameName of the pool as used in
connections.<conn>.poolsinswanctl.conffileFile where newline-separated pool addresses for are read from
Optionally each address can be pre-assigned to a roadwarrior identity, e.g.10.231.14.2=alice@strongswan.org. If a-(hyphen) is given instead of a file name, the addresses are read fromSTDIN. Reading addresses stops at the end of file or an empty line. Pools created with this command can not be resized.timeoutLease time in hours (use
d,m, orsto alternatively configure the time in days, minutes or seconds, respectively),0for static leasesReplace a list of pool addresses in the database.
--resize <name> --end <end>-
nameName of the pool to resize
endNew end address for the pool
Grow or shrink an existing pool.
--leases <name> [--filter <filter>] [--utc]-
nameName of the pool to show leases from
filterFilter string containing comma separated key=value filters:
-pool: Name of the pool
-id: Assigned identity of the lease
-addr: Lease IP address
-tstamp: UNIX timestamp when lease was valid, as integer
-status: Status of the lease: onlinevalid
expired
utcShow times in UTC instead of local time
Show lease information using filters.
--purge <name>-
nameName of the pool to purge
Delete expired leases of a pool.
--batch <file>-
fileFile to read the newline separated commands from
Commands appear as they are written on the command line, e.g.
--replace mypool --start 10.0.0.1 --end 10.0.0.254
--del dns
--add dns --server 10.1.0.1
--add dns --server 10.1.1.1
If a-(hyphen) is given as a file name, the commands are read fromSTDIN. Reading commands stops at the end of file. Empty lines are ignored. In order to avoid recursion the file may not contain a--batchcommand.Read commands from a file and execute them atomically.