In short: an address list is a list of addresses with a name, which firewall rules use in place of an address written by hand. You write the entries yourself (static) or the firewall adds them as traffic goes by (dynamic, usually with an expiry). On this mechanism you build blacklists, port knocking, management allowlists, and domain filters.
What is an address list?
It’s a group of IP addresses under a common name, which the filter, NAT, mangle, and raw rules can check with a single parameter. Instead of ten rules, one per address, you write one rule that says “everything that comes from the gestione list”. You add or remove an address from the list and the rule stays as it is.
Each entry is a row in /ip firewall address-list: the name of the list (list, required) and the address (address).
How do I add static entries?
With add, giving the name of the list and the address. The address can be a single IP, a subnet, or a range:
/ip firewall address-list
add list=gestione address=192.168.88.0/24 comment="LAN"
add list=gestione address=10.255.255.0/24 comment="Management VPN"
add list=blacklist address=203.0.113.10 comment="Scanner seen on 2026-10-10"
add list=stampanti address=192.168.88.200-192.168.88.210
A range that coincides with a subnet is rewritten in CIDR form on save: 192.168.0.0-192.168.1.255 becomes 192.168.0.0/23 (you check it with the Dojo IP calculator). IP-to-IP ranges apply to IPv4 only.
⚠️ Warning: the addresses in the examples are the ones from my lab. Adapt them to your network.
And if instead of the address I write a DNS name?
The router accepts it and resolves it on its own: the entry with the name stays, and under it dynamic entries appear (D flag) with the addresses the name returns. It’s the trick the howto for blocking DNS over HTTPS and DNS over TLS rests on: dns.google brings 8.8.8.8 and 8.8.4.4 with it. If you then also add 8.8.8.8 by hand to the same list, the router answers already have such entry.
There’s also the opposite way: an entry in /ip dns static with the address-list parameter puts into the list the addresses the router answers to devices for that domain, and removes them when the TTL of the answer expires.
How are dynamic entries born?
A firewall rule creates them with action=add-src-to-address-list (puts the packet’s source address in the list) or action=add-dst-to-address-list (puts the destination). You choose the list with address-list, the duration with address-list-timeout:
/ip firewall filter
add chain=input protocol=tcp dst-port=23 in-interface-list=WAN \
action=add-src-to-address-list address-list=blacklist address-list-timeout=1d \
comment="Whoever touches telnet is blacklisted for a day"
add chain=input in-interface-list=WAN src-address-list=blacklist action=drop \
comment="Drop the blacklist"
The point everyone misses: these two actions work in passthrough. The rule notes the address down and the packet keeps going to the next rules, as if nothing happened. To really block it you need a second rule that does drop.
If an address already in the list hits the rule again, the entry doesn’t double up: it gets refreshed. The manual says so for the SSH brute-force protection. In the lab the remaining time went back up with the new packets, but not always to the full value: for a blacklist what matters is that whoever keeps knocking stays in, not the exact second.
How long does an entry last, and what happens on reboot?
It depends on the timeout. The reboot is the moment where the difference shows:
| How the entry is born | Timeout | After a reboot |
|---|---|---|
By hand, without timeout |
none | stays: it’s configuration |
By hand, with timeout=… |
the one written | lost: it already shows with the D flag, like a dynamic entry |
From a rule, address-list-timeout=1h (or another time) |
the one written | lost |
From a rule, address-list-timeout=none-dynamic |
none | lost: it stays only until the reboot |
From a rule, address-list-timeout=none-static |
none | stays, and goes into export and backup |
none-dynamic and none-static exist only in the rules (address-list-timeout): in /ip firewall address-list add the router answers invalid time value. The maximum time is 35w3d13:13:56, that is 21474836 seconds, a little under 249 days. With none-static the rule builds a list that grows forever: use it only if you know who will clean it up.
Where do I use address lists in the rules?
With two parameters, src-address-list and dst-address-list, present in filter, NAT, mangle, and raw. In front of the name you can put ! to say “who is not in the list”:
/ip firewall filter
add chain=input protocol=tcp dst-port=8291,22 src-address-list=gestione action=accept \
comment="WinBox and SSH only from management"
add chain=input protocol=tcp dst-port=22 in-interface-list=WAN \
src-address-list=!gestione action=drop comment="SSH from outside, if you are not on the list"
Each parameter accepts one single list. Watch the trap: src-address-list=A,B is accepted without errors, but it means neither “in A and in B” nor “in A or in B”. The comma is part of the name: the rule looks for a list named exactly A,B, which usually doesn’t exist, so it never matches. With the ! in front it’s worse: !A,B matches everyone. If you need two groups, put everything in the same list or write two rules. You can, however, use source and destination together in the same rule: “from list A toward list B”.
The raw table is the right place for long lists of addresses to drop no matter what, because it drops in prerouting and saves the connection tracking work. The manual uses it this way for bogons, with the not_global_ipv4 list of the networks that can’t travel on the internet:
/ip firewall raw
add chain=prerouting src-address-list=not_global_ipv4 in-interface-list=WAN action=drop \
comment="Drop non-global addresses from WAN"
For IPv6 the menu is /ipv6 firewall address-list: same logic, it accepts an address, a prefix, or a DNS name, but not IP-to-IP ranges.
How do I see what’s inside a list?
With print, filtering by name. Dynamic entries have the D flag and show the time left before they expire:
/ip firewall address-list print where list=blacklist
/ip firewall address-list print where list~"^bussata"
/ip firewall address-list print count-only where list=blacklist
/ip firewall address-list export where list=gestione
~ compares against a regular expression, handy to see several lists together. count-only tells you just how many entries there are: it’s the first thing to look at on a blacklist that’s been running for months. The export of a single list is there from RouterOS 7.13 and exports only the static entries.
To know whether the list really works, look at the counters of the rules that use it:
/ip firewall filter print stats where comment~"blacklist"
To remove an address from all the lists it ended up in:
/ip firewall address-list remove [find address=203.0.113.10]
What are they for in practice?
- Blacklist: whoever touches a port nobody should touch (telnet, a bait port) ends up in a list for a day and the router ignores them.
- Port knocking: three lists in a row, with timeouts of a few seconds, move the address from one knock to the next until WinBox opens. It’s the howto for port knocking on MikroTik; its trap uses the negation
!to blacklist whoever knocks out of order. - Management allowlist: the networks you administer the router from, in a single list you use in all the input rules. In the basic hardening the networks are few and the interfaces are enough; when the places you come in from grow many, the list saves you from rewriting the rules.
- Networks to protect: in the hotspot the
lan-protettelist names the networks guests must not reach, and a script updates it when the WAN changes (protecting the LAN from hotspot clients). In multi-line balancing thereti-wanlist keeps the traffic toward the modems’ networks out of PCC (ECMP and PCC). - Bogons: the addresses that can’t arrive from the internet (private, loopback, documentation), dropped in raw.
- Domains: a DNS name in a list follows the service’s addresses, as for the DoH servers.
How they work in detail you’ll also find in the MikroTik manual: Address-lists.
What are the typical mistakes?
- The name written differently.
Blacklistin the rule andblacklistin the list are two different lists. The router accepts the rule without complaining, and the rule never finds anyone. If theprint statscounter stays at zero, compare the names letter by letter. - The list without the drop.
add-src-to-address-listnotes down and lets through. Without a rule that drops whoever is in the list, the blacklist fills up and blocks nothing. - The order of the rules. The rule that puts into the list must be above the one that drops everything, otherwise the packet never gets there. In multi-stage sequences (knocking, brute force) the order is part of the logic: the manual writes the SSH rules from the last stage to the first precisely for this.
- The timeout too short. With one-minute stages, the manual’s SSH protection lets 27 password attempts a minute through. The timeout decides how much the rule weighs: too short stops no one, too long locks you out too.
- The bogon that cuts you off. In the lab the WAN is in
10.6.x.x/12with gateway10.0.0.1: if in raw you drop the list with10.0.0.0/8from the WAN, you lose the gateway. Remove from the bogon list the private networks you actually use on the WAN. - The list that grows out of control. A dynamic blacklist on the internet collects thousands of addresses a day. Keep it under control with
count-onlyand prefer finite timeouts tonone-static.
⚠️ Warning: a blacklist that lists by connections, not by mistakes, can block you too. Put your management allowlist before the rules that count, as the manual does in the SSH protection.
Tested in the lab on a routerboard with RouterOS 7.24.5 (stable): IP, subnet, a range converted to CIDR and an unaligned range that stays a range; a DNS name resolved into dynamic entries and already have such entry for an address already present; entries from add-src-to-address-list with a timeout, none-dynamic and none-static (flags and export); the maximum time; a rule with the wrong list name accepted without an error; a comma in the list name (A,B is one single name); count-only, export, and remove [find address=…]; an IPv6 range rejected. The behavior on reboot and the raw table with bogons are from the documentation.
Frequently asked questions
What is an address list on MikroTik?
It’s a list of IP addresses with a name, in /ip firewall address-list. The filter, NAT, mangle, and raw rules check it with src-address-list or dst-address-list, so you add or remove addresses without touching the rules.
Do the entries in an address list survive a reboot?
The ones written by hand without a timeout do. The ones with a timeout, and the ones created by a rule with a time or with none-dynamic, have the D flag, don’t go into the export, and according to the manual are lost. Among the ones created by the rules, only the none-static ones stay, which are static and go into the export.
Can I put a domain name in an address list?
Yes: the router resolves the name and adds dynamic entries under it with the returned addresses. Don’t also add the same addresses by hand to the same list: the router rejects them as duplicates.
Why does the rule with add-src-to-address-list block nothing?
Because it works in passthrough: it puts the address in the list and lets the packet keep going. To block, you need a second rule with src-address-list= and action=drop.
Can I use two address lists in the same rule?
One for the source and one for the destination, yes. Two in the same parameter, no: src-address-list=A,B is accepted, but RouterOS reads it as the name of a single list, A,B, and the rule never matches. Merge the addresses into one list or write two rules.



