SOFTWARE / INFRASTRUCTURE / SECURITY / KENYA
Done
Action completed
Technical Guide Wireless Networking & ISP Solutions Network Security Intermediate • 6 min read

Configuring firewall rules

L Author: Lawrence Kamau (Lead Systems Architect & Infrastructure Engineer)
Reviewed by: Peter Mwangi (Senior Network & Field Infrastructure Engineer)
Published: May 1, 2026 • Last Updated: Nov 22, 2026 • Target Hardware: All MikroTik RouterOS v7.x routers.

Purpose: Harden the router control plane (Input chain) and isolate internal VLANs from unauthorized cross-access (Forward chain) using stateful connection tracking.

Prerequisites

  • Defined WAN and LAN/Management interface lists (Interface -> Interface List).

Step-by-Step Configuration

STEP 01 — Protect the Router Control Plane (Input Chain)

Accept established/related connections, drop invalid packets, allow ICMP, allow WinBox/SSH strictly from your Management subnet/interface list, and drop all other WAN input.

STEP 02 — Secure Transit Traffic & Block Inter-VLAN Leakage (Forward Chain)

Allow established/related traffic, drop invalid packets, block Guest/Customer VLANs from reaching Management/Staff subnets, and drop unsolicited WAN-to-LAN packets not DST-NATed.

STEP 03 — Verify Rule Order (Top-Down Evaluation)

Ensure general Accept Established/Related rules sit above broad Drop rules so active sessions are processed at high speed.

CLI / Configuration Snippet

# RouterOS v7.x — Essential Stateful Input & Forward Firewall Baseline
/ip firewall filter
# Input Chain: Protect the router itself
add chain=input connection-state=established,related action=accept comment="Accept established/related"
add chain=input connection-state=invalid action=drop comment="Drop invalid"
add chain=input in-interface-list=MGMT action=accept comment="Allow Mgmt VLAN access"
add chain=input in-interface-list=WAN action=drop comment="Drop all unsolicited WAN input"

# Forward Chain: Protect LANs & isolate Guest VLAN
add chain=forward connection-state=established,related action=accept
add chain=forward connection-state=invalid action=drop
add chain=forward src-address=10.10.30.0/24 dst-address=10.10.0.0/16 action=drop comment="Isolate Guest from Internal"
add chain=forward connection-state=new connection-nat-state=!dstnat in-interface-list=WAN action=drop comment="Drop non-DSTNAT WAN"
Expected Results & Verification

External port scans against the WAN IP are silently dropped while authorized Management VLAN engineers retain full WinBox/SSH access.

Troubleshooting Matrix

Issue:
Fix:
SECURITY HARDENING

Block external DNS queries (UDP/TCP 53) on the WAN interface so your router cannot be used as an open DNS resolver.

BACKUP & RECOVERY

Export firewall configuration (/ip firewall export file=fw-rules) after every policy audit.

L
Lawrence Kamau Delight Engineering Team
Lead Systems Architect & Infrastructure Engineer
Specialization: MikroTik RouterOS 7, FreeRADIUS, Linux CWP Hosting Clusters & Network Architecture

Directs network architecture and server infrastructure at Delight Office Solutions, overseeing the core YouBroadband ISP routing matrix and enterprise deployments.

Tested on Delight Living ISP Network (YouBroadband)
Nairobi NOC • Kabiria Road, Dagoretti South
Related Technical Guides
Was this engineering guide helpful?
Need professional installation, auditing, or troubleshooting? Request Network Consultation →