IP Pools in RouterOS: A Complete Guide
IP Pools in RouterOS: A Complete Guide
Section titled “IP Pools in RouterOS: A Complete Guide”RouterOS Version: 7.x+ Difficulty: Beginner Estimated Time: 15 minutes
Overview
Section titled “Overview”IP Pools define ranges of IP addresses for dynamic allocation by RouterOS services. They act as address reservoirs—services draw addresses when clients connect and return them when clients disconnect.
Services that use IP pools:
- DHCP Server - Dynamic IP assignment for network clients
- PPP (PPPoE, PPTP, L2TP, SSTP) - VPN client addressing
- Hotspot - Captive portal client addressing
- User Manager - RADIUS-based address assignment
Key features:
- Multiple non-contiguous ranges in a single pool
- Pool chaining via
next-poolfor overflow handling - Consistent address assignment for returning clients
- IPv6 prefix pools for DHCPv6 prefix delegation
Menu Reference
Section titled “Menu Reference”| Menu | Purpose |
|---|---|
/ip pool | IPv4 address pools |
/ip pool used | Currently assigned addresses |
/ipv6 pool | IPv6 prefix pools |
/ipv6 pool used | Currently assigned prefixes |
IPv4 Pool Properties
Section titled “IPv4 Pool Properties”| Property | Type | Default | Description |
|---|---|---|---|
name | string | - | Unique pool identifier (required) |
ranges | IP range list | - | Address ranges: from-to,from-to,... (required) |
next-pool | string | none | Fallback pool when current exhausted |
comment | string | - | Descriptive comment |
IPv6 Pool Properties
Section titled “IPv6 Pool Properties”| Property | Type | Default | Description |
|---|---|---|---|
name | string | - | Pool identifier (required) |
prefix | IPv6 prefix | - | Base prefix to allocate from (required) |
prefix-length | integer | - | Size of allocations (required) |
comment | string | - | Descriptive comment |
Configuration Examples
Section titled “Configuration Examples”Example 1: Basic DHCP Pool
Section titled “Example 1: Basic DHCP Pool”Create a pool for DHCP server:
# Create pool (exclude router IP .1)/ip pool add name=dhcp-pool ranges=192.168.88.10-192.168.88.254
# Verify/ip pool printImportant: Never include the router’s own IP in the pool range!
Example 2: Multiple Non-Contiguous Ranges
Section titled “Example 2: Multiple Non-Contiguous Ranges”Reserve some addresses while using others:
# IPs .1-.9 reserved for servers, .100-.149 for printers/ip pool add name=office-pool ranges=10.0.0.10-10.0.0.99,10.0.0.150-10.0.0.254Example 3: Pool Chaining (Overflow)
Section titled “Example 3: Pool Chaining (Overflow)”Automatically use secondary pool when primary exhausts:
# Primary pool/ip pool add name=pool-primary ranges=192.168.1.10-192.168.1.100
# Overflow pool/ip pool add name=pool-overflow ranges=192.168.1.150-192.168.1.200
# Chain them/ip pool set pool-primary next-pool=pool-overflowWhen pool-primary is full, new requests automatically get addresses from pool-overflow.
Example 4: PPP/VPN Client Pool
Section titled “Example 4: PPP/VPN Client Pool”For PPPoE, L2TP, or other PPP-based VPNs:
# Create pool/ip pool add name=vpn-pool ranges=10.10.10.2-10.10.10.254
# Create PPP profile using pool/ppp profile add name=vpn-profile local-address=10.10.10.1 remote-address=vpn-poolNote: PPP assigns addresses from the END of the range first (working downward).
Example 5: Hotspot Pool
Section titled “Example 5: Hotspot Pool”For captive portal clients:
# Create pool/ip pool add name=hotspot-pool ranges=10.5.50.2-10.5.50.254
# Use in hotspot/ip hotspot add name=hs1 interface=wlan1 address-pool=hotspot-poolExample 6: IPv6 Prefix Pool
Section titled “Example 6: IPv6 Prefix Pool”For DHCPv6 prefix delegation:
# Allocate /64 prefixes from a /56 block/ipv6 pool add name=pd-pool prefix=2001:db8:1000::/56 prefix-length=64
# Use with DHCPv6 server/ipv6 dhcp-server add name=dhcp6 interface=bridge address-pool=pd-poolThis creates 256 available /64 prefixes for clients.
Example 7: DHCP Server with Pool
Section titled “Example 7: DHCP Server with Pool”Complete DHCP setup:
# Step 1: Create pool/ip pool add name=lan-pool ranges=192.168.88.10-192.168.88.254
# Step 2: Configure network options/ip dhcp-server network add address=192.168.88.0/24 gateway=192.168.88.1 \ dns-server=192.168.88.1
# Step 3: Create DHCP server/ip dhcp-server add name=dhcp-lan interface=bridge address-pool=lan-pool disabled=no
# Step 4: Verify/ip dhcp-server printExample 8: Monitor Pool Usage
Section titled “Example 8: Monitor Pool Usage”# View all pools with usage/ip pool print
# View addresses currently in use/ip pool used print
# Count addresses in use/ip pool used print count-only
# Find specific client by MAC/ip pool used print where info~"00:11:22:33:44:55"How Address Assignment Works
Section titled “How Address Assignment Works”Consistent Assignment
Section titled “Consistent Assignment”RouterOS tries to give the same IP to returning clients based on:
| Service | Client Identifier |
|---|---|
| DHCP | MAC address |
| PPP | Username |
| Hotspot | MAC address |
This enables predictable addressing without static reservations.
Assignment Order
Section titled “Assignment Order”| Service | Order |
|---|---|
| DHCP | First available (ascending) |
| PPP | Last available (descending) |
PPP’s reverse order is by design and differs from other vendors.
Pool Exhaustion with next-pool
Section titled “Pool Exhaustion with next-pool”Client Request │ ▼┌─────────────────┐│ Primary Pool │───▶ Address available? ─── Yes ──▶ Assign│ (pool-primary) │ │└─────────────────┘ │ No ▼ ┌─────────────────┐ │ Overflow Pool │───▶ Assign from here │ (pool-overflow)│ └─────────────────┘Common Problems and Solutions
Section titled “Common Problems and Solutions”Problem 1: Router’s IP Assigned to Client
Section titled “Problem 1: Router’s IP Assigned to Client”Symptom: Network failure; router loses connectivity.
Cause: Pool range includes router’s interface IP.
Solution:
# Wrong: includes .1/ip pool add name=bad-pool ranges=192.168.88.1-192.168.88.254
# Correct: excludes .1/ip pool add name=good-pool ranges=192.168.88.10-192.168.88.254Problem 2: DHCP Says “Pool Empty” But Addresses Available
Section titled “Problem 2: DHCP Says “Pool Empty” But Addresses Available”Causes:
- Client-ID variations causing duplicate entries
- Infrastructure issues (faulty hardware causing reconnections)
Solutions:
# Limit one IP per MAC/ip dhcp-server set [find] client-mac-limit=1
# Check for duplicates/ip pool used print
# Shorten lease time to recycle faster/ip dhcp-server set [find] lease-time=1hProblem 3: Client Gets /32 Netmask and No Gateway
Section titled “Problem 3: Client Gets /32 Netmask and No Gateway”Cause: Pool addresses don’t match any DHCP network entry.
Solution:
# Ensure network covers pool range/ip dhcp-server network add address=192.168.88.0/24 gateway=192.168.88.1
# Verify pool is within network/ip pool print# Pool range must fall within 192.168.88.0/24Problem 4: next-pool Not Working
Section titled “Problem 4: next-pool Not Working”Causes:
- Typo in pool name
- Pools in different subnets (for DHCP)
Solution:
# Verify pool names match exactly (case-sensitive)/ip pool print
# For DHCP, all chained pools must be in same subnetProblem 5: Hotspot Pool Not Releasing Addresses
Section titled “Problem 5: Hotspot Pool Not Releasing Addresses”Cause: No idle timeout configured.
Solution:
# Configure idle timeout/ip hotspot set [find] idle-timeout=5mProblem 6: PPP User Has Multiple IPs
Section titled “Problem 6: PPP User Has Multiple IPs”Cause: Stale sessions not terminating cleanly.
Solution:
# Check actual active sessions/ppp active print
# Configure session timeout in profile/ppp profile set [find] session-timeout=1dProblem 7: IPv6 Pool Exhausted After One Assignment
Section titled “Problem 7: IPv6 Pool Exhausted After One Assignment”Cause: prefix-length not set correctly.
Solution:
# Wrong: no prefix-length means one allocation# Correct: set prefix-length to desired size/ipv6 pool set [find] prefix-length=64Pool Capacity Planning
Section titled “Pool Capacity Planning”| Network Size | Pool Range | Usable Addresses |
|---|---|---|
| /24 | .10-.254 | ~244 |
| /23 | 2 × /24 | ~509 |
| /22 | 4 × /24 | ~1021 |
| /20 | 16 × /24 | ~4093 |
Formula: Usable = 2^(32-prefix) - 3 (network, broadcast, gateway)
Tip: Leave headroom for growth. A pool at 80%+ capacity may need expansion.
Verification Commands
Section titled “Verification Commands”# List all pools/ip pool print
# Check pool utilization/ip pool print# Compare "Total" vs addresses in use
# View active assignments/ip pool used print
# View specific pool usage/ip pool used print where pool=dhcp-pool
# Count addresses in use/ip pool used print count-only
# Find client by MAC/ip pool used print where info~"AA:BB:CC"
# Check IPv6 pools/ipv6 pool print/ipv6 pool used printIntegration with Other Features
Section titled “Integration with Other Features”DHCP Server
Section titled “DHCP Server”/ip dhcp-server add address-pool=my-pool ...PPP Profile
Section titled “PPP Profile”/ppp profile add remote-address=my-pool ...Hotspot
Section titled “Hotspot”/ip hotspot add address-pool=my-pool ...RADIUS (Framed-Pool attribute)
Section titled “RADIUS (Framed-Pool attribute)”RADIUS can specify pool per-user using Framed-Pool attribute.
Related Topics
Section titled “Related Topics”Prerequisites
Section titled “Prerequisites”- IP Address Configuration - interface addressing fundamentals
Primary Use Cases
Section titled “Primary Use Cases”- DHCP Server - primary pool consumer for automatic IP distribution
- DHCP Relay - centralized DHCP requires pools for each relay subnet
Related Services
Section titled “Related Services”- PPP Profile (
/ppp profile) - uses pools for VPN clients - Hotspot Setup - uses pools for captive portal
- DHCPv6 Server - uses IPv6 pools
Edge Cases and Limitations
Section titled “Edge Cases and Limitations”- Pool names are case-sensitive -
Pool1≠pool1 - Ranges cannot overlap with other pools or static addresses
- Deleting pool with active assignments orphans those addresses
- DHCP pools must match network entries - otherwise clients get /32 netmask
- PPP assigns from end first - by design, not a bug
- next-pool must be same subnet for DHCP (different subnets won’t route)
- IPv6 prefix-length must be ≥ pool prefix - can’t allocate larger than source
Summary
Section titled “Summary”IP Pools are address reservoirs for RouterOS services:
- Create pool with appropriate ranges (exclude router IPs)
- Configure service to use pool by name
- Monitor usage with
/ip pool used print - Chain pools with
next-poolfor overflow handling
Key points:
- Never include router’s own IP in pool range
- DHCP needs matching
/ip dhcp-server networkentry - PPP assigns from end of range (descending)
- Pool names are case-sensitive
- Use
next-poolfor automatic overflow to secondary pool