# MikroTik firewall rules for a home network: a safe baseline config

- Link: https://www.smartdataline.com/mikrotik-networking/mikrotik-firewall-rules-for-a-home-network-a-safe-baseline-config/
- Published: 2026-11-22T01:40:44+00:00
- Author: Sinoptik

A new MikroTik router is powerful, but a half-configured firewall is worse than 
none: it gives you a false sense of safety. This guide walks through a minimal baseline
for a home network with one WAN port and a LAN bridge. It is based on the logic 
of MikroTik’s own default configuration, explained rule by rule so you know what
each line does and why it is there.

The commands use RouterOS 7 syntax. Interface names (ether1, bridge) and subnets
are examples, so adjust them to your setup before pasting anything.

Before you touch anything: protect yourself from a lockout
 The most common firewall
mistake is cutting off your own access. Do these two things first:

Make a backup and an export. In the terminal run /system backup save name=before-
firewall and /export file=before-firewall, then download both files from the Files
menu.
 Use Safe Mode. Turn it on in WinBox (the Safe Mode button) or in the terminal
with Ctrl+X. If you lose the connection while it is on, RouterOS rolls back the 
changes made during the session. [ADD: a screenshot of your WinBox with Safe Mode
enabled]

Step 1: **Define WAN and LAN with interface lists**
 Rules based on interface lists
are easier to read and maintain than rules tied to specific ports. Create two lists
and add your interfaces:

/interface list
 add name=WAN add name=LAN /interface list member add list=LAN interface
=bridge add list=WAN interface=ether1 If your provider uses PPPoE, the WAN member
is the PPPoE interface (for example pppoe-out1), not the physical port.

Step 2: **Protect the router itself (input chain)**
 The input chain handles traffic
addressed to the router: WinBox, SSH, DNS requests to the router, and so on. The
goal is simple: allow what is needed, drop everything that comes from outside.

/ip firewall filter
 add chain=input action=accept connection-state=established,
related,untracked comment=”accept established, related, untracked” add chain=input
action=drop connection-state=invalid comment=”drop invalid” add chain=input action
=accept protocol=icmp comment=”accept ICMP” add chain=input action=accept in-interface-
list=LAN comment=”accept from LAN” add chain=input action=drop in-interface-list
=!LAN comment=”drop everything not from LAN” Rules are checked from top to bottom
and the first match wins. That is why the final drop rule goes last: everything 
that was not explicitly allowed above it gets dropped.

Step 3: **Protect the network behind the router (forward chain)**
 The forward chain
handles traffic passing through the router, for example from a laptop in your LAN
to the internet and back.

add chain=forward action=accept connection-state=established,related,untracked comment
=”accept established, related, untracked”
 add chain=forward action=drop connection-
state=invalid comment=”drop invalid” add chain=forward action=drop connection-state
=new connection-nat-state=!dstnat in-interface-list=WAN comment=”drop new connections
from WAN that are not port forwards” The last rule blocks new connections arriving
from the internet unless they match a port forward you configured on purpose (a 
dstnat rule). Your own port forwards keep working, and nothing else gets in.

I left FastTrack out of this baseline on purpose. FastTracked connections skip most
of the normal packet processing, including queues, so it conflicts with traffic 
shaping. Add it later only if you need the extra throughput and understand what 
it bypasses.

![NAT so the LAN can reach the internet](https://www.smartdataline.com/wp-content/
uploads/2026/11/Gemini_Generated_Image_blxre8blxre8blxr.jpg)

Step 4: **NAT so the LAN can reach the internet**
 /ip firewall nat add chain=srcnat
action=masquerade out-interface-list=WAN ipsec-policy=out,none comment=”masquerade”
Step 5: Close the management services you do not use A firewall is only half of 
the job. Services that listen on the router are another way in:

/ip service
 set telnet disabled=yes set ftp disabled=yes set www disabled=yes set
api disabled=yes set api-ssl disabled=yes set winbox address=192.168.88.0/24 set
ssh address=192.168.88.0/24

/tool mac-server set allowed-interface-list=LAN
 /tool mac-server mac-winbox set
allowed-interface-list=LAN /ip neighbor discovery-settings set discover-interface-
list=LAN Replace 192.168.88.0/24 with your own LAN subnet. The address setting limits
which source addresses may connect to that service. The last three lines stop the
router from announcing itself or accepting MAC-level logins on the WAN side.

 [ADD: a screenshot of your /ip service list after the changes]

Common mistakes
 Mixing up input and forward. Input protects the router, forward
protects the devices behind it. You need both. Wrong rule order. An accept rule 
placed below a drop rule never fires. New rules are added to the bottom of the list,
so check the order after adding them. Forgetting IPv6. The IPv4 firewall does not
apply to IPv6. If IPv6 is enabled on your router, it needs its own rules under /
ipv6 firewall filter, otherwise your LAN devices may be reachable from the internet
over IPv6. Leaving default management ports open to the world. Telnet, FTP, the 
web interface, the API and WinBox should never be reachable from the WAN. Pasting
rules on top of an old config. Duplicates and conflicting rules are easy to miss.
Review /ip firewall filter print before and after. How to check that it works Open/
ip firewall filter print stats and watch the packet counters. The drop rules on 
the WAN side should slowly collect hits from internet background noise. Scan your
public IP from outside your network (for example from a mobile connection) and confirm
that no management ports respond. Test a port forward, if you have one, to confirm
that the dstnat exception works. [ADD: a short note on what you saw in the counters
or scan on your own router]

 

#### **Checklist**⏎  Backup and export saved before the changes. WAN and LAN interface lists are set up with the correct interfaces. Input chain ends with a drop for everything that is not from the LAN. Forward chain drops new connections from the WAN that are not port forwards. Unused services are disabled and the rest are restricted to your LAN. IPv6 is either disabled or has its own firewall rules. You tested access from the outside. This baseline is a starting point. Always verify the rules on your own device and RouterOS version before relying on them, and adjust interface names and addresses to match your network.
