Firewall Best Practices Guide

Hardening your router for production environments.

Prerequisite: If hardening tunnel or VLAN interfaces, ensure you have completed VPN Tunnels or VLAN Configuration before proceeding.

Prerequisites

Pre-Flight Requirements

Input Chain Hardening

Standard v7 Input chain model: drop invalid first, allow established/related, accept ICMP, allow management interfaces, drop remainder.

/ip firewall filter add chain=input connection-state=invalid action=drop place-before=0 comment="drop invalid"
/ip firewall filter add chain=input connection-state=established,related action=accept place-before=1 comment="allow established/related"
/ip firewall filter add chain=input protocol=icmp action=accept place-before=2 comment="allow ICMP"
/ip firewall filter add chain=input in-interface-list=LAN action=accept place-before=3 comment="allow LAN management"
/ip firewall filter add chain=input action=drop place-before=4 comment="drop all others"

Export Backup (RSC)

/export file=backup-before-firewall

Related Procedures

VPN Tunnels — tunnel policies require Input/Forward chain rules. VLAN Configuration — apply firewall rules per VLAN interface as needed.

Recovery

If Input rules lock you out, use Netinstall Recovery to restore access.

Common Pitfalls