برای امن سازی روتر میکروتیک هم در شبکه داخلی و هم در اینترنت یک مجموعه از بهترین و کاربردی ترین دستورات رو نوشتم و کافیه در ترمینال روتر کپی کنی و اینتر رو بزنی ![]()
کافیه جای Ethe2 که شبکه WAN و wifi و بقیه اترنت پورت ها با هم بریج شدند پورت های روتر خودتونو وارد کنید
/ip firewall filter
# 1. Drop invalid connections
add chain=input connection-state=invalid action=drop comment="Drop invalid connections"
# 2. Allow established and related connections
add chain=input connection-state=established,related action=accept comment="Allow established/related"
# 3. Allow internal network (WiFi) to access router
add chain=input src-address=192.168.2.0/24 action=accept comment="Allow LAN access"
# 4. Drop ICMP (ping) from WAN only
add chain=input protocol=icmp in-interface=ether2 action=drop comment="Drop ICMP from WAN"
# 5. Block brute force attempts to Winbox and SSH from WAN
add chain=input protocol=tcp dst-port=8291,22 in-interface=ether2 connection-limit=3,32 action=drop comment="Limit Winbox/SSH brute force"
# 6. Drop port scanners
add chain=input protocol=tcp psd=21,3s,3,1 action=drop comment="Drop port scanners"
add chain=input protocol=tcp tcp-flags=fin,syn,rst,psh,ack,urg action=drop comment="Drop suspicious TCP flags"
add chain=input protocol=tcp tcp-flags=fin,syn action=drop comment="Drop FIN/SYN scan"
# 7. Allow access to Winbox/SSH from LAN only
add chain=input protocol=tcp dst-port=8291,22 src-address=192.168.2.0/24 action=accept comment="Allow Winbox/SSH from LAN"
# 8. Drop all other access from WAN
add chain=input in-interface=ether2 action=drop comment="Drop all from WAN"
# 9. Allow router to respond to DNS, DHCP, etc. from LAN
add chain=input src-address=192.168.2.0/24 protocol=udp action=accept comment="Allow UDP from LAN"
# 10. Drop everything else
add chain=input action=drop comment="Drop everything else"