Tunnels · Topic 2 of 4

IP Pools, Ranges and Assigning Them to Services

Create RouterOS IP pools, manage their address ranges, and assign a pool to a service such as PPP profiles or a DHCP server to hand out addresses.

  • 5 min
In a nutshell
  • An IP pool is a named range of addresses created with /ip pool add.
  • A pool can hold several ranges, separated by commas.
  • next-pool continues with another pool when the first runs out.

What it is

An IP pool is a named range of addresses that a service can hand out to clients.

The pool does not give out addresses by itself. It is a reservoir. A service such as a PPP server or a DHCP server draws an address from the pool for each new client, and returns it when the client leaves.

Pools save you from assigning addresses by hand, and they let several services share the same source of addresses.

IP pool10.99.0.10 to 10.99.0.50assigned toServicePPP profile or DHCP servergives address toClientnext free address

How it works

You create the pool with one or more ranges, and then refer to it by name in the service.

Creating a pool

/ip pool add name=vpn-pool ranges=10.99.0.10-10.99.0.50
/ip pool print

The name is how services refer to the pool. The ranges setting holds the addresses, written as a start and an end address.

For a DHCP server the pool should lie in the subnet that it serves. For any service it should not contain addresses that you use for fixed devices, such as the router itself.

Managing ranges

A pool can have more than one range. List them separated by commas.

/ip pool set vpn-pool ranges=10.99.0.10-10.99.0.50,10.99.0.100-10.99.0.120

Use several ranges to skip addresses that belong to servers or other devices. For example, you can leave a gap for static hosts.

To change a pool, edit its ranges. The new ranges apply to clients that connect afterwards. Clients that already hold an address keep it.

A pool can also point to a next pool.

/ip pool add name=pool2 ranges=10.99.1.10-10.99.1.50
/ip pool set vpn-pool next-pool=pool2

When the first pool runs out of free addresses, the service continues with the next one. This lets a network grow without changing the services.

Seeing which addresses are in use

/ip pool used print

The used list shows which addresses of each pool are currently taken, and which service or client holds each one. Use it to check why a client did not get an address, or to see how full the pool is.

If a pool is exhausted, new clients cannot connect. Enlarge the range or add a next pool.

Exam tip

Size the pool for more clients than you expect, and watch the used list so you notice when it fills up.

Assigning a pool to a service

A pool is useful only when a service refers to it. Different services use it in different places.

ServiceWhere the pool is named
PPPThe remote-address of a PPP profile
DHCP serverThe address-pool of the server

For PPP, the profile hands out addresses from the pool.

/ppp profile set office remote-address=vpn-pool

Each client that logs in with this profile receives the next free address from vpn-pool. Its server end uses the local-address of the profile.

For DHCP, the server entry names the pool.

/ip dhcp-server set dhcp1 address-pool=vpn-pool

Take care that pools used by different services do not overlap. One pool can serve several services, because it keeps track of which addresses are taken. Two separate pools with overlapping ranges cannot know about each other, so they can offer the same address twice.

Pool and static addresses

A client with a fixed address, set in a secret or a static lease, should use an address outside the pool. Otherwise the pool may give the same address to another client.

Keep the static addresses in their own range, and keep the pool for everyone else.

Watch out

Two services that share overlapping pools can hand out the same address, so give each service its own range.

What to remember for the exam

Six facts cover this topic.

  • An IP pool is a named range of addresses created with /ip pool add.
  • A pool can hold several ranges, separated by commas.
  • next-pool continues with another pool when the first runs out.
  • /ip pool used print shows the addresses that are currently in use.
  • A PPP profile uses a pool through remote-address, and a DHCP server uses it through address-pool.
  • Fixed addresses should be kept outside the pool.

Common mistakes

These four mistakes are common.

Creating a pool and never assigning it. A pool gives out no addresses until a service refers to it.

Overlapping pools. Two services can then offer the same address.

Including fixed addresses in the range. A pool client may take an address that a static host already uses.

Letting the pool run out. New clients cannot connect, so monitor the used list.

Check yourself

Work through these three questions.

  • How do you give a pool more than one range?

    List the ranges separated by commas in the ranges setting. This lets you skip addresses that belong to other devices.

  • How do you assign a pool to a PPP service?

    Put the pool name in the remote-address of the PPP profile. Each client then receives the next free address from the pool.

  • Where do you check which pool addresses are taken?

    Run /ip pool used print. It lists the addresses in use and which service or client holds them.

Topic 2 of 4 in Tunnels

Test yourself on Tunnels

The full MikroTik MTCNA question bank has 558 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.