diff options
Diffstat (limited to 'notes/projects/radius/sql/README.ippool.md')
| -rw-r--r-- | notes/projects/radius/sql/README.ippool.md | 84 |
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 | |||
| 5 | Objectives | 5 | Objectives |
| 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 | ||
| 80 | Network Block Management | 80 | Auditing Reports |
| 81 | ------------------------ | 81 | ---------------- |
| 82 | 82 | ||
| 83 | The following displays IP usage by IP pool: | ||
| 84 | |||
| 85 | SELECT * FROM pool_audit() ORDER BY poolname, regionType; | ||
| 86 | |||
| 87 | The following displays IP usage by IP pool and region: | ||
| 88 | |||
| 89 | SELECT * FROM region_audit() ORDER BY poolName, regionName; | ||
| 90 | |||
| 91 | The following displays IP usage by defined netblocks: | ||
| 92 | |||
| 93 | SELECT * FROM netblock_audit() ORDER BY poolName, network; | ||
| 94 | |||
| 95 | The following displays the state of each IP address: | ||
| 96 | |||
| 97 | SELECT * FROM ip_audit() ORDER BY ipAddress; | ||
| 83 | 98 | ||
| 84 | 99 | ||
| 85 | IP Address Assignments | 100 | IP Address Assignments |
| 86 | ---------------------- | 101 | ---------------------- |
| 102 | |||
| 103 | IP addresses can be manually assigned or auto-assigned based upon the NAS and | ||
| 104 | pool type specified. | ||
| 105 | |||
| 106 | The 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 | |||
| 114 | The above assignment will fail if a netblock containing '209.193.4.8/32' has | ||
| 115 | been marked as 'busyout'. A assignment to a busy netblock can be forced using | ||
| 116 | the '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 | |||
| 125 | The following is an example of auto-assigning an IP address based upon a client | ||
| 126 | session's NAS and pool type: | ||
| 127 | |||
| 128 | SELECT ip_autoassign | ||
| 129 | ( assignUser := 'autoassign1@example.net', | ||
| 130 | assignNas := 'br1.sol', | ||
| 131 | assignPool := 'dhcp' | ||
| 132 | ); | ||
| 133 | |||
| 134 | By default, `ip_autoassign()` will attempt to assign "sticky" IP addresses to a | ||
| 135 | session. A sticky address is a best effort attempt to re-assign the IP address | ||
| 136 | previously used by the subscriber. Sticky IP address assignments use the | ||
| 137 | following 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 | |||
| 145 | Dynamic IP addresses can be requested by passing 'assignPrevIp' with a value of | ||
| 146 | FALSE 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 | |||
| 155 | When 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 | |||
| 161 | Both manual and auto-assigned IP addresses are freed using `ip_release()`: | ||
| 162 | |||
| 163 | SELECT ip_release( '209.193.4.3' ); | ||
| 164 | |||
