Skip to content

IP Allocation

ProxPanel supports two modes of IP assignment and switches between them per subscriber.

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 radreply table (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).

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 radreply so the same subscriber gets the same IP back on reconnect.
  • The ip_pool_assignments table tracks available vs. in_use IPs per pool, preventing collisions.

Several layers prevent two subscribers getting the same IP:

LayerWhereWhat it does
AllocateIPippool/pool.goWhen picking a pool IP, excludes anything already in radreply (v1.0.179).
set_static_ip bulk actionhandlers/subscriber.goRefuses if the IP is already in radreply for another user (v1.0.226).
findAvailableIPradius/server.goOn a static-IP conflict (3 retries), assigns a free IP from the same /24 (v1.0.227).
Service changehandlers/subscriber.goDeletes old Framed-IP-Address and releases the pool slot on plan change (v1.0.225).
Stale session cleanupservices/stale_session_cleanup.goCloses radacct rows >30 min without interim update, freeing the IP.

If a duplicate ever appears, see Duplicate IPs troubleshooting.

When you add a NAS with API credentials, ProxPanel auto-imports its IP pools:

  • Each /ip pool from MikroTik becomes a row in ip_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.

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.