/ip firewall filter
add chain=input connection-state=invalid action=drop comment="drop invalid \
connections" disabled=no
add chain=input protocol=tcp psd=10,3s,3,1 action=drop comment="drop possible \
port scans" disabled=no
add chain=input protocol=udp dst-port=137-139 action=drop comment="deny \
NETBIOS services" disabled=no
add chain=input protocol=udp dst-port=161 action=accept comment="allow SNMP \
connections" disabled=no
add chain=input protocol=tcp dst-port=2000 action=accept comment="allow \
bandwidth test TCP connections" disabled=no
add chain=input protocol=udp action=accept comment="allow UDP protocol" \
disabled=no
add chain=input protocol=tcp dst-port=21 action=accept comment="allow FTP \
access" disabled=no
add chain=input protocol=tcp dst-port=22 action=accept comment="allow SSH \
access" disabled=no
add chain=input protocol=tcp dst-port=80 action=accept comment="allow HTTP \
access" disabled=no
add chain=input protocol=tcp dst-port=8291 action=accept comment="allow Winbox \
access" disabled=no
add chain=input protocol=tcp dst-port=1723 action=accept comment="allow PPTP \
access" disabled=no
add chain=input connection-state=established action=accept comment="accept \
estalished connections" disabled=no
add chain=input connection-state=related action=accept comment="accept related \
connections" disabled=no
add chain=input protocol=icmp icmp-options=8:0 action=accept \
comment="allow ICMP echo request" disabled=no
add chain=forward in-interface=Local out-interface=Global action=drop \
comment="" disabled=no
add chain=input protocol=icmp icmp-options=3:4 action=accept comment="allow \
ICMP Fragmentation Needed" disabled=no
add chain=input action=log log-prefix="" comment="log everything else" \
disabled=yes
add chain=input action=drop comment="drop everything else" disabled=yes
Note, that you still have to enable last rules to achieve any effect. I posted them as disabled due to security reasons. Of course, you can substitute input chain with any other, including forward. If you don't use some services like SNMP or PPTP just disable or even delete appropriate rules.