aboutsummaryrefslogtreecommitdiffstats
path: root/notes/projects/radius/sql/README.ippool.md
diff options
context:
space:
mode:
Diffstat (limited to 'notes/projects/radius/sql/README.ippool.md')
-rw-r--r--notes/projects/radius/sql/README.ippool.md84
1 files changed, 81 insertions, 3 deletions
diff --git a/notes/projects/radius/sql/README.ippool.md b/notes/projects/radius/sql/README.ippool.md
index b463df8..d6ed50f 100644
--- a/notes/projects/radius/sql/README.ippool.md
+++ b/notes/projects/radius/sql/README.ippool.md
@@ -5,7 +5,7 @@ IP Engineering RADIUS IP Pool Database
5Objectives 5Objectives
6---------- 6----------
7 7
8 * Psuedo static IP addresses 8 * Psuedo static IP addresses (i.e. "sticky" IP addresses)
9 * Per NAS Preference for geographic regions 9 * Per NAS Preference for geographic regions
10 * Ability to deavtivate/busy out specific netblocks 10 * Ability to deavtivate/busy out specific netblocks
11 11
@@ -77,10 +77,88 @@ The following PostgreSQL (psql) commands will purge RADIUS roles from Postgresql
77 DROP ROLE radius; 77 DROP ROLE radius;
78 78
79 79
80Network Block Management 80Auditing Reports
81------------------------ 81----------------
82 82
83The following displays IP usage by IP pool:
84
85 SELECT * FROM pool_audit() ORDER BY poolname, regionType;
86
87The following displays IP usage by IP pool and region:
88
89 SELECT * FROM region_audit() ORDER BY poolName, regionName;
90
91The following displays IP usage by defined netblocks:
92
93 SELECT * FROM netblock_audit() ORDER BY poolName, network;
94
95The following displays the state of each IP address:
96
97 SELECT * FROM ip_audit() ORDER BY ipAddress;
83 98
84 99
85IP Address Assignments 100IP Address Assignments
86---------------------- 101----------------------
102
103IP addresses can be manually assigned or auto-assigned based upon the NAS and
104pool type specified.
105
106The following is an example of manually specifing an IP address assignment:
107
108 SELECT ip_assign
109 ( assignIp := '209.193.4.8/32',
110 assignNas := 'br1.sol',
111 assignUser := 'jdoe8@example.net'
112 );
113
114The above assignment will fail if a netblock containing '209.193.4.8/32' has
115been marked as 'busyout'. A assignment to a busy netblock can be forced using
116the 'assignForce' option:
117
118 SELECT ip_assign
119 ( assignIp := '209.193.4.3/32',
120 assignNas := 'br1.sol',
121 assignUser := 'busy1@example.net',
122 assignForce := TRUE
123 );
124
125The following is an example of auto-assigning an IP address based upon a client
126session's NAS and pool type:
127
128 SELECT ip_autoassign
129 ( assignUser := 'autoassign1@example.net',
130 assignNas := 'br1.sol',
131 assignPool := 'dhcp'
132 );
133
134By default, `ip_autoassign()` will attempt to assign "sticky" IP addresses to a
135session. A sticky address is a best effort attempt to re-assign the IP address
136previously used by the subscriber. Sticky IP address assignments use the
137following logic to assign an IP address to a user session:
138
139 * Attempt to assign regional pool address which was last used by subscriber.
140 * Attempt to assign regional pool address which has been idle the longest.
141 * Attempt to assign non-regional pool address which was last used by subscriber.
142 * Attempt to assign non-regional pool address which has been idle the longest.
143 * Fail address assignment.
144
145Dynamic IP addresses can be requested by passing 'assignPrevIp' with a value of
146FALSE to `ip_autoassign()`:
147
148 SELECT ip_autoassign
149 ( assignUser := 'autoassign2@example.net',
150 assignNas := 'br1.sol',
151 assignPool := 'dhcp',
152 assignPrevIp := FALSE
153 );
154
155When assigning auto-assigning dynamic IP addresses, the following logic is used:
156
157 * Attempt to assign regional pool address which has been idle the longest.
158 * Attempt to assign non-regional pool address which has been idle the longest.
159 * Fail address assignment.
160
161Both manual and auto-assigned IP addresses are freed using `ip_release()`:
162
163 SELECT ip_release( '209.193.4.3' );
164