From b9b38cac5e2e41326de396164c8422d946817ef0 Mon Sep 17 00:00:00 2001 From: "David M. Syzdek" Date: Tue, 14 May 2019 11:42:52 -0800 Subject: updating README --- notes/projects/radius/sql/README.ippool.md | 61 +++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/notes/projects/radius/sql/README.ippool.md b/notes/projects/radius/sql/README.ippool.md index 871889a..b463df8 100644 --- a/notes/projects/radius/sql/README.ippool.md +++ b/notes/projects/radius/sql/README.ippool.md @@ -14,36 +14,69 @@ Files * README.ippool.md - This file * ippool-database.sql - Creates database - * ippool-schema.sql - Creates database schema (tables, indexes, etc) - * ippool-functions.sql - Creates end-user/end-application functions * ippool-demo.sql - Loads demo data + * ippool-functions.sql - Creates end-user/end-application functions * ippool-queries.sql - Common or useful queries + * ippool-schema.sql - Creates database schema (tables, indexes, etc) * radius-roles.sql - Common database roles for RADIUS Initializing New Database ------------------------- - * Create base database roles for RADIUS, not not already created: + * Create base database roles for RADIUS, if not not already created: + + psql \ + -h raddbtest.prv.acsalaska.net \ + -f radius-roles.sql + + * Create database and load schema: + + psql \ + -h raddbtest.prv.acsalaska.net \ + -f ippool-database.sql - psql -h raddbtest.prv.acsalaska.net -f radius-roles.sql + psql \ + -h raddbtest.prv.acsalaska.net \ + -f ippool-schema.sql \ + -f ippool-functions.sql \ + radius_ippool - * Create database and load schema: + * Optionally, load demo data: - psql -h raddbtest.prv.acsalaska.net -f ippool-database.sql - psql -h raddbtest.prv.acsalaska.net -f ippool-schema.sql radius_ippool - psql -h raddbtest.prv.acsalaska.net -f ippool-functions.sql radius_ippool + psql \ + -h raddbtest.prv.acsalaska.net \ + -f ippool-demo.sql \ + radius_ippool - * Create RADIUS pools using `pool_add()`. - * Create RADIUS regions using `region_add()`. - * Create RADIUS NAS clients using `nas_add()`. - * Create network blocks using `netblock_add()`. - * Add IP addresses with `ip_add_network()` if `netblock_add()` was not called - with `addIpEntries := TRUE`. + * Create RADIUS pools using `pool_add()`. + * Create RADIUS regions using `region_add()`. + * Create RADIUS NAS clients using `nas_add()`. + * Create network blocks using `netblock_add()`. + * Add IP addresses with `ip_add_network()` if `netblock_add()` was not called + with `addIpEntries := TRUE`. For examples of using the above functions, please read `ippool-demo.sql`. +Destroying existing database +---------------------------- + +The following Postgresql (psql) commands will purge the database: + + \c :USER + SET ROLE wheel; + DROP DATABASE radius_ippool; + +The following PostgreSQL (psql) commands will purge RADIUS roles from Postgresql: + + SET ROLE wheel; + DROP ROLE radius_user; + DROP ROLE radius_app; + DROP ROLE radius_admin; + DROP ROLE radius; + + Network Block Management ------------------------ -- cgit v1.2.3