/ip firewall filter
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=established,related,untracked
add action=drop chain=input comment="defconf: drop invalid input" connection-state=invalid in-interface-list=!LAN log=yes log-prefix=DROP_INVALID
add action=drop chain=forward comment="defconf: drop invalid forward" connection-state=invalid in-interface-list=!LAN log=yes log-prefix=DROP_INVALID
add action=drop chain=input comment="defconf: drop ICMP" log=yes log-prefix=DROP_ICMP protocol=icmp src-address=!10.0.0.0/24
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN log=yes log-prefix=DROP_INVALID_DSTNAT
add action=drop chain=forward comment="drop DoH-Blocklist TCP 443,853,5353" dst-address-list=DoH-Blocklist dst-port=443,853,5353 in-interface-list=LAN log=yes log-prefix=DROP_DOH protocol=tcp src-address-list=!Allowed-DNS
add action=drop chain=forward comment="drop DoH-Blocklist UDP 443,853,5353" dst-address-list=DoH-Blocklist dst-port=443,853,5353 in-interface-list=LAN log=yes log-prefix=DROP_DOH protocol=udp src-address-list=!Allowed-DNS
add action=drop chain=input comment="drop ssh from outside network" dst-port=22 log=yes log-prefix=DROP_SSH protocol=tcp src-address=!10.0.0.0/24
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Mark connections for hairpin NAT" dst-address-list=!Allowed-DNS dst-port=53 new-connection-mark=DNS passthrough=yes protocol=udp src-address-list=!Allowed-DNS
add action=accept chain=prerouting dst-address=10.0.0.0/24 in-interface=bridge
add action=accept chain=prerouting in-interface=pppoe0
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=redirect chain=dstnat comment="Redirect to local DNS" dst-address-list=!Allowed-DNS dst-port=53 protocol=udp src-address-list=!Allowed-DNS to-ports=53
add action=redirect chain=dstnat comment="Redirect to local DNS" dst-address-list=!Allowed-DNS dst-port=53 protocol=tcp src-address-list=!Allowed-DNS to-ports=53
add action=dst-nat chain=dstnat dst-port=51820 protocol=udp to-addresses=10.0.0.5