IP Allocation
ProxPanel supports two modes of IP assignment and switches between them per subscriber.
Mode 1 — Static IP
Section titled “Mode 1 — Static IP”If subscribers.static_ip is set to an IPv4 address:
- RADIUS Access-Accept returns
Framed-IP-Address = <that_IP>. - The IP is also persisted in
radreplytable (attribute = 'Framed-IP-Address'). - Same IP reused every login.
Static IPs are useful for port forwards, voice services, etc. Set via Subscribers → Edit → Static IP (IPv4 format validated, no duplicates allowed across active subscribers).
Mode 2 — Pool (dynamic)
Section titled “Mode 2 — Pool (dynamic)”If static_ip is empty:
- RADIUS returns
Framed-Pool = <service.pool_name>. - MikroTik allocates from that pool on PPPoE connect.
With ProISP IP Management enabled (default since v1.0.164), there’s a third layer:
- On first connect, ProxPanel calls MikroTik to allocate an IP, then writes it into
radreplyso the same subscriber gets the same IP back on reconnect. - The
ip_pool_assignmentstable tracksavailablevs.in_useIPs per pool, preventing collisions.
Duplicate-IP defenses
Section titled “Duplicate-IP defenses”Several layers prevent two subscribers getting the same IP:
| Layer | Where | What it does |
|---|---|---|
AllocateIP | ippool/pool.go | When picking a pool IP, excludes anything already in radreply (v1.0.179). |
set_static_ip bulk action | handlers/subscriber.go | Refuses if the IP is already in radreply for another user (v1.0.226). |
findAvailableIP | radius/server.go | On a static-IP conflict (3 retries), assigns a free IP from the same /24 (v1.0.227). |
| Service change | handlers/subscriber.go | Deletes old Framed-IP-Address and releases the pool slot on plan change (v1.0.225). |
| Stale session cleanup | services/stale_session_cleanup.go | Closes radacct rows >30 min without interim update, freeing the IP. |
If a duplicate ever appears, see Duplicate IPs troubleshooting.
Importing existing pools
Section titled “Importing existing pools”When you add a NAS with API credentials, ProxPanel auto-imports its IP pools:
- Each
/ip poolfrom MikroTik becomes a row inip_pool_assignments. - Active sessions are synced — IPs in use are marked
in_use. - This happens once on NAS creation and on every API credential update.
Manual re-import: NAS → row action → Sync IP Pools.
Per-subnet conflict resolution
Section titled “Per-subnet conflict resolution”If a subscriber’s static IP collides at PPPoE login 3 times in a row, the system auto-assigns a different IP from the same /24 subnet. This handles the case where two operators accidentally configured the same static IP for different customers — instead of one of them being stuck offline, they each get a working IP and the operator is logged for investigation.