Back to blog

MikroTik / RouterOS  ·  Security Rules  ·  November 2026

Firewall Templates for
Villas, Shops & Hotels

A good small-site firewall is the same underneath everywhere and different on top. The base protects the router and drops what should never arrive; the top layer is a handful of short sub-chains that describe who in that building may talk to what. Here are three complete templates, for a villa, a shop and a hotel, line by line, with the reasons and the tests.

RouterOS Firewall Templates Starlink POS Hospitality Jump Chains

One base, three site types: only the segments and their sub-chains change BASE · services trimmed · input default-deny · RAW bogons · state first · final drops · IPv6 mirror VILLA OWNER GUEST IOT MGMT SHOP POS STAFF GUEST CCTV MGMT HOTEL FRONTDESK STAFF GUEST BMS CCTV MGMT

The other posts in this set are about technique: structure, IPv6 parity, dynamic defences. This one is the result: three complete templates that combine them, for the three kinds of site that make up most small installations in Crete.

Each template is the same base plus a few sub-chains. Read the base once, then read only what changes per site.

Prerequisites

01

The Base Every Site Gets

Most of a good firewall is the same everywhere. Write it once, review it once, and spend the thinking on what is different.

RouterOS — the base layer
# ---- BASE: identical on every site ----
/interface list
add name=WAN
add name=LAN
add name=MGMT
# services: off unless needed; the rest only from MGMT
/ip service disable telnet,ftp,www,api,api-ssl
/ip service set winbox address=10.0.99.0/24,10.10.10.0/24
/ip service set ssh address=10.0.99.0/24,10.10.10.0/24
/tool mac-server set allowed-interface-list=MGMT
/tool mac-server mac-winbox set allowed-interface-list=MGMT
/ip neighbor discovery-settings set discover-interface-list=MGMT
/ip dns set allow-remote-requests=yes
# RAW: junk from the internet never reaches connection tracking
/ip firewall address-list
add list=bogons address=0.0.0.0/8
add list=bogons address=10.0.0.0/8
add list=bogons address=169.254.0.0/16
add list=bogons address=172.16.0.0/12
add list=bogons address=192.168.0.0/16
add list=bogons address=224.0.0.0/3
# add 100.64.0.0/10 ONLY on links with a public WAN address (not Starlink/4G CGNAT)
/ip firewall raw
add chain=prerouting in-interface-list=WAN src-address-list=bogons action=drop
# input: the router itself
/ip firewall filter
add chain=input connection-state=established,related,untracked action=accept
add chain=input connection-state=invalid action=drop
add chain=input protocol=icmp action=accept
add chain=input in-interface-list=MGMT action=accept
add chain=input in-interface-list=LAN protocol=udp dst-port=53,67 action=accept
add chain=input in-interface-list=LAN protocol=tcp dst-port=53 action=accept
add chain=input action=drop comment="FINAL DROP input"
# forward: state, then one jump per segment, then drop
add chain=forward connection-state=established,related,untracked action=accept
add chain=forward connection-state=invalid action=drop
add chain=forward in-interface-list=WAN connection-nat-state=dstnat action=accept
# ...site-specific jumps go here...
add chain=forward action=drop comment="FINAL DROP forward"
/ip firewall nat add chain=srcnat out-interface-list=WAN action=masquerade

Everything site-specific hangs off two places: which interfaces are in LAN and MGMT, and the jumps that go above the final forward drop. The base is the same on a two-bedroom villa and a 120-room hotel, which is the point: the parts that protect the router itself are never improvised on site.

⚠ Gotcha — Two lines that depend on the WAN

100.64.0.0/10 belongs in bogons only when the WAN has a public address; on Starlink or 4G it is where the router's own address and gateway live. And the dstnat accept in forward is harmless when there are no port forwards, but delete it on CGNAT links anyway: it documents that nothing is published.

The IPv6 half of the base is the parity ruleset from dual-stack parity, applied before the WAN is allowed to receive a prefix.

02

Holiday Villa

An owner who wants the cameras on their phone, guests who want Netflix, and a smart lock that should never see either.

RouterOS — villa segments and sub-chains (on top of the base)
# ---- VILLA: owner, guests, smart home; Starlink WAN (CGNAT) ----
# vlan10-owner, vlan20-guest, vlan30-iot are in LAN; vlan99-mgmt and wg-admin in MGMT
/ip firewall filter
add chain=forward in-interface=vlan10-owner action=jump jump-target=owner \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan20-guest action=jump jump-target=guest \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan30-iot action=jump jump-target=iot \
    place-before=[find comment="FINAL DROP forward"]
# owner: the internet, and the smart-home devices (apps, cameras)
add chain=owner out-interface-list=WAN action=accept
add chain=owner out-interface=vlan30-iot action=accept
add chain=owner action=drop
# guests: the internet only; client isolation is on the Wi-Fi side
add chain=guest out-interface-list=WAN action=accept
add chain=guest action=drop
# smart home: its cloud, never the owner or the guests
add chain=iot out-interface-list=WAN action=accept
add chain=iot action=drop
# management: the router dials out to the WireGuard hub (CGNAT: nobody can dial in)
/interface wireguard peers add interface=wg-admin public-key="<hub key>" \
    endpoint-address=hub.example.net endpoint-port=13231 allowed-address=10.10.10.0/24 \
    persistent-keepalive=25s
FromMay reachWhy
Ownerinternet, smart-home devicesThe owner's phone controls the locks, the AC and the cameras.
GuestsinternetA stranger every week: nothing of the owner's, nothing of the house's.
Smart homeinternet (its cloud)Locks, AC and cameras phone home; they must not reach the owner's laptop.
Managementeverything (input)Over WireGuard from the hub only; the router dials out because Starlink is CGNAT.
⚠ Gotcha — Guests seeing guests is a Wi-Fi setting, not a firewall rule

Two guest phones on the same SSID talk at layer 2 without touching the router's firewall. Turn off client-to-client forwarding on the guest Wi-Fi (in CAPsMAN or the wifi datapath) and, on wired guest ports, use bridge port isolation. The firewall can only separate VLANs from each other.

03

Shop with Card Terminals

The terminals reach their acquirer and nothing else. Everything in the shop that isn't a terminal is somewhere else.

RouterOS — shop segments and sub-chains (on top of the base)
# ---- SHOP: card terminals, staff, guests, cameras; fibre WAN ----
/ip firewall address-list
# the payment processor's hosts, by name: the router keeps the IPs current
add list=payments address=pos.example-acquirer.com
add list=payments address=tms.example-acquirer.com
/ip firewall filter
add chain=forward in-interface=vlan10-pos action=jump jump-target=pos \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan20-staff action=jump jump-target=staff \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan30-guest action=jump jump-target=guest \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan40-cctv action=jump jump-target=cctv \
    place-before=[find comment="FINAL DROP forward"]
# card terminals: the acquirer on 443, nothing else, not even "the internet"
add chain=pos dst-address-list=payments protocol=tcp dst-port=443 action=accept
add chain=pos action=drop log=yes log-prefix="POS-DENY"
# staff: the internet and the NVR's web UI
add chain=staff out-interface-list=WAN action=accept
add chain=staff dst-address=10.0.40.10 protocol=tcp dst-port=80,443,554 action=accept
add chain=staff action=drop
add chain=guest out-interface-list=WAN action=accept
add chain=guest action=drop
# cameras: nothing out; the NVR is in the same VLAN, so recording needs no rule
add chain=cctv action=drop

The POS sub-chain is the reason this template exists. Card terminals don't need "the internet"; they need the acquirer's hosts on 443. A DNS name in an address list is resolved by the router and refreshed as the records change, so the rule follows the acquirer without anyone editing IPs. The log=yes on the final POS drop turns any surprise (a firmware update server, a new acquirer endpoint) into a log line rather than a silent failure at the till.

⚠ Gotcha — Test with the acquirer's real endpoints before go-live

Terminals also talk to a terminal-management host for updates and keys, and some use several hostnames that change with the acquirer's infrastructure. Run the shop in "log, don't drop" for a day (change the final POS rule to action=accept log=yes), collect every destination the terminals actually use, then switch back to drop.

04

Hotel

More segments, more strangers, and building systems that a vendor maintains from outside.

RouterOS — hotel segments and sub-chains (on top of the base)
# ---- HOTEL: front desk + PMS, staff, many guests, building systems, cameras ----
/ip firewall address-list
add list=pms address=10.0.15.20 comment="PMS server"
add list=bms-vendor address=198.51.100.40 comment="HVAC/locks vendor support host"
/ip firewall filter
add chain=forward in-interface=vlan10-frontdesk action=jump jump-target=frontdesk \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan20-staff action=jump jump-target=staff \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan30-guest action=jump jump-target=guest \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan70-bms action=jump jump-target=bms \
    place-before=[find comment="FINAL DROP forward"]
add chain=forward in-interface=vlan60-cctv action=jump jump-target=cctv \
    place-before=[find comment="FINAL DROP forward"]
# front desk: the PMS and the internet
add chain=frontdesk dst-address-list=pms action=accept
add chain=frontdesk out-interface-list=WAN action=accept
add chain=frontdesk action=drop
# staff: the PMS web UI and the internet, not the front-desk PCs
add chain=staff dst-address-list=pms protocol=tcp dst-port=443 action=accept
add chain=staff out-interface-list=WAN action=accept
add chain=staff action=drop
# guests: the internet; one guest can't hold 300 connections (P2P, malware)
add chain=guest protocol=tcp connection-limit=300,32 action=drop
add chain=guest out-interface-list=WAN action=accept
add chain=guest action=drop
# building systems: only the vendor's support host, only HTTPS
add chain=bms dst-address-list=bms-vendor protocol=tcp dst-port=443 action=accept
add chain=bms action=drop log=yes log-prefix="BMS-DENY"
add chain=cctv action=drop
SegmentThe rule that matters
Front deskReaches the PMS server; staff PCs don't reach the front-desk PCs.
GuestsInternet only, with a per-guest connection cap; bandwidth fairness is a queue, not a firewall rule.
Building systems (HVAC, door locks)Only the vendor's support host, only HTTPS, every denial logged.
CCTVNo outbound at all; the NVR is local.
⚠ Gotcha — The door-lock system is the crown jewel

In a hotel the system that encodes room keys is more sensitive than the PMS: a compromise there is physical access to every room. Keep it in BMS or its own VLAN, never on the front-desk network "because reception uses it". Reception reaches its encoder through a single rule to a single host.

For the network around this firewall (APs, the WLC, dual WAN and phones), see the resort hotel build.

05

Rolling a Template Out

A template is only useful if applying it to a live site can't take the site down.

StepHow
1 · Export what is there/export terse file=before; keep it off the router too.
2 · Safe ModeCtrl+X in the terminal: if your session drops, every change is rolled back.
3 · Lists and services firstInterface lists, address lists, /ip service, MAC-server. Nothing is blocked yet.
4 · Input chain, ending in dropTest a second Winbox/SSH session before adding the final drop.
5 · Forward chain with jumpsOne segment at a time, testing each from a device in that segment.
6 · RAW and IPv6Last, once the filter is proven.
7 · Export and diff/export terse file=after; store both with the job notes.
💡 The Cisco side

On IOS the same templates are zone-based firewall: one zone per segment, a zone-pair per allowed arrow, the self zone for the router itself, and object-groups for the acquirer and vendor hosts (resolved by FQDN on newer IOS-XE). The supermarket and law firm builds show complete examples.

06

Verify It

Before you leave the site, attack it from every segment.

FromTryExpected
Guestping the router's MGMT address, browse, scan 10.0.0.0/8Only browsing works.
Smart home / BMS / CCTVcurl any public siteFails (except the BMS vendor host and the IoT clouds in the villa).
POScurl https://example.com, then a test paymentThe first fails and logs POS-DENY; the payment works.
Staffthe NVR UI, the PMS, a front-desk PCThe first two work, the third doesn't.
Outsidenmap the WAN, over IPv4 and IPv6Nothing answers.
Router/ip firewall filter print statsEvery guard and final drop counted your tests.

Takeaways

  1. Most of the firewall is the base, and the base never changes between sites: services trimmed, input default-deny, RAW bogons, state first.
  2. What changes is the segments and one short sub-chain each, jumped to from forward.
  3. Card terminals reach their acquirer, not the internet; log the denials and learn the real endpoints before go-live.
  4. Guests seeing guests is a Wi-Fi setting; the firewall separates VLANs, not clients in one VLAN.
  5. On CGNAT links, management dials out and bogons must not include 100.64.0.0/10.
  6. Roll out in Safe Mode, one segment at a time, and attack every segment before you leave.

Part of a set on RouterOS security rules: rule order & performance · dual-stack parity · dynamic defences · templates for villas, shops & hotels. Foundations: the RouterOS firewall, properly.

Want a firewall like this on your site?

I install and audit MikroTik networks for villas, shops and hotels in Crete, with the firewall built from tested templates and verified from every segment before handover.

Book a Discovery Call →