aboutsummaryrefslogtreecommitdiffstats
path: root/notes/projects/radius/sql/README.ippool.md
blob: b463df8bd742111d19ec2d61e91e31b09e65f90d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

IP Engineering RADIUS IP Pool Database
======================================

Objectives
----------

   * Psuedo static IP addresses
   * Per NAS Preference for geographic regions
   * Ability to deavtivate/busy out specific netblocks

Files
----

   * README.ippool.md     - This file
   * ippool-database.sql  - Creates database
   * 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, 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 ippool-schema.sql \
            -f ippool-functions.sql \
            radius_ippool

   * Optionally, load demo data:

         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`.

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
------------------------



IP Address Assignments
----------------------