Hello,
i would like your advices about my firewall filter rules.
i’m a noob, I have build my rules following several tutorials and mikrotik manual.
I think understanding more or less the job of them, but less about the importance of the ordering of them, especially wireguard rules, fasttrack rules and ssh protecting rules.
I have also a problem for setup wireguard: client can access to lan but can’t access internet.
Here my firewall rules, could you said me your opinion about them and the necessary changes for optmize them?
Thank you
/ip firewall filter
add action=add-src-to-address-list address-list=Syn_Flooder address-list-timeout=30m chain=input comment="Add Syn Flood IP to the list" connection-limit=30,32 protocol=tcp tcp-flags=syn
add action=drop chain=input comment="Drop to syn flood list" src-address-list=Syn_Flooder
add action=add-src-to-address-list address-list=Port_Scanner address-list-timeout=1w chain=input comment="Port Scanner Detect" protocol=tcp psd=21,3s,3,1
add action=drop chain=input comment="Drop to port scan list" src-address-list=Port_Scanner
add action=jump chain=input comment="Jump for icmp input flow" jump-target=ICMP protocol=icmp
add action=drop chain=input comment="Block all access to the winbox - except to support list # DO NOT ENABLE THIS RULE BEFORE ADD YOUR SUBNET IN THE SUPPORT ADDRESS LIST" dst-port=8291 protocol=tcp src-address-list=!support
add action=jump chain=forward comment="Jump for icmp forward flow" jump-target=ICMP protocol=icmp
add action=drop chain=forward comment="Drop to bogon list" dst-address-list=bogons
add action=add-src-to-address-list address-list=spammers address-list-timeout=3h chain=forward comment="Add Spammers to the list for 3 hours" connection-limit=30,32 dst-port=25,587 limit=30/1m,0:packet log=yes protocol=tcp
add action=drop chain=forward comment="Avoid spammers action" dst-port=25,587 log=yes protocol=tcp src-address-list=spammers
add action=accept chain=input comment="Accept DNS - UDP" port=53 protocol=udp
add action=accept chain=input comment="Accept DNS - TCP" port=53 protocol=tcp
add action=accept chain=input comment="allow wireguard" dst-port=13231 protocol=udp
add action=accept chain=forward comment="Allow wireguard traffic to lan" dst-address=10.28.201.0/24 src-address=10.13.13.0/24
add action=accept chain=forward comment="Allow wireguard traffic to internet" dst-address=0.0.0.0/24 src-address=10.13.13.0/24
add action=fasttrack-connection chain=forward comment=Fasttrack connection-state=established,related disabled=yes hw-offload=yes
add action=accept chain=forward comment=Fasttrack connection-state=established,related disabled=yes
add action=accept chain=input comment="Accept to established connections" connection-state=established
add action=accept chain=input comment="Accept to related connections" connection-state=related
add action=accept chain=input comment="Full access to SUPPORT address list" src-address-list=support
add action=accept chain=input comment="Allow IGMP for Orange TV" in-interface=vlan840-TV-Stream protocol=igmp
add action=accept chain=output comment="Allow IGMP for Orange TV" out-interface=vlan840-TV-Stream protocol=igmp
add action=accept chain=input comment="Allow IGMP for Orange TV" in-interface=ether7-TV protocol=igmp
add action=accept chain=forward comment="Allow Forward Multicast Orange" dst-address=224.0.0.0/4 dst-port=8200,8202 in-interface=vlan840-TV-Stream protocol=udp
add action=drop chain=input comment="drop ssh brute forcers" dst-port=22 log=yes log-prefix=dropssh_ protocol=tcp src-address-list=ssh_blacklist
add action=add-src-to-address-list address-list=ssh_blacklist address-list-timeout=1w3d chain=input connection-state=new dst-port=22 log=yes log-prefix=dropssh_ protocol=tcp src-address-list=ssh_stage3
add action=add-src-to-address-list address-list=ssh_stage3 address-list-timeout=1m chain=input connection-state=new dst-port=22 log=yes log-prefix=dropssh_ protocol=tcp src-address-list=ssh_stage2
add action=add-src-to-address-list address-list=ssh_stage2 address-list-timeout=1m chain=input connection-state=new dst-port=22 log=yes log-prefix=dropssh_ protocol=tcp src-address-list=ssh_stage1
add action=add-src-to-address-list address-list=ssh_stage1 address-list-timeout=1m chain=input connection-state=new dst-port=22 log=yes log-prefix=dropssh_ protocol=tcp
add action=drop chain=forward comment="drop ssh brute downstream" dst-port=22 protocol=tcp src-address-list=ssh_blacklist
add action=drop chain=input comment="BLOQUE TOUTES LES CONNEXIONS ENTRANTES (exception avant)"
add action=accept chain=ICMP comment="Echo request - Avoiding Ping Flood" icmp-options=8:0 limit=1,5:packet protocol=icmp
add action=accept chain=ICMP comment="Echo reply" icmp-options=0:0 protocol=icmp
add action=accept chain=ICMP comment="Time Exceeded" icmp-options=11:0 protocol=icmp
add action=accept chain=ICMP comment="Destination unreachable" icmp-options=3:0-1 protocol=icmp
add action=accept chain=ICMP comment=PMTUD icmp-options=3:4 protocol=icmp
add action=drop chain=ICMP comment="Drop to the other ICMPs" protocol=icmp
add action=jump chain=output comment="Jump for icmp output" jump-target=ICMP protocol=icmp