Now the config is complete.
I want to block access to WAN for addresses from the list (that was my comment on this rule).
Unless you have another recommendation.
# 2024-11-30 17:36:33 by RouterOS 7.16.1
# software id = xxx
#
/interface bridge
add name=bridge1
/interface ethernet
set [ find default-name=ether1 ] comment="" \
disable-running-check=no
set [ find default-name=ether3 ] comment="" disable-running-check=\
no name=ether2
set [ find default-name=ether5 ] comment="" \
disable-running-check=no name=ether3
set [ find default-name=ether6 ] comment="" \
disable-running-check=no name=ether4
set [ find default-name=ether7 ] comment=\
"" disable-running-check=no \
disabled=yes name=ether5
set [ find default-name=ether2 ] comment="" disable-running-check=no \
name=ether6
set [ find default-name=ether4 ] comment="" \
disable-running-check=no name=ether7
/disk
set slot1 media-interface=none media-sharing=no slot=slot1
set slot2 media-interface=none media-sharing=no slot=slot2
set slot3 media-interface=none media-sharing=no slot=slot3
set slot4 media-interface=none media-sharing=no slot=slot4
set slot5 media-interface=none media-sharing=no slot=slot5
set slot6 media-interface=none media-sharing=no slot=slot6
set slot7 media-interface=none media-sharing=no slot=slot7
set slot8 media-interface=none media-sharing=no slot=slot8
set slot9 media-interface=none media-sharing=no slot=slot9
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp ranges=192.168.77.10-192.168.77.100
/ip dhcp-server
add address-pool=dhcp interface=bridge1 name=dhcp1
/port
set 0 name=serial0
set 1 name=serial1
set 2 name=serial4
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether5
add bridge=bridge1 interface=ether6
add bridge=bridge1 interface=ether7
add bridge=bridge1 interface=ether4
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add interface=ether1 list=WAN
add interface=bridge1 list=LAN
/ip address
add address=192.168.77.1/24 comment="default configuration" interface=bridge1 \
network=192.168.77.0
/ip dhcp-client
add interface=ether1 use-peer-dns=no
/ip dhcp-server lease
add address=192.168.77.10 client-id=1:xx:xx:xx:xx:xx:xx mac-address=\
9C:2F:9D:50:39:2D server=dhcp1
add address=192.168.77.11 client-id=1:xx:xx:xx:xx:xx:xx mac-address=\
9C:29:76:51:48:9D server=dhcp1
add address=192.168.77.12 client-id=1:xx:xx:xx:xx:xx:xx mac-address=\
26:70:95:10:48:76 server=dhcp1
/ip dhcp-server network
add address=192.168.77.0/24 dns-server=192.168.77.1 gateway=192.168.77.1 \
netmask=24
/ip dns
set allow-remote-requests=yes servers=xx.xx.xx.xx,xx.xx.xx.xx \
verify-doh-cert=yes
/ip firewall filter
add action=drop chain=input comment="block IP based on blacklist to WAN access" \
connection-state=new in-interface=all-ethernet src-address-list=\
pwlgrzs-blacklist
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" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related disabled=yes hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN
add action=masquerade chain=srcnat comment=HairpinNat dst-address=\
192.168.77.0/24 src-address=192.168.77.0/24
/ip ipsec profile
set [ find default=yes ] dpd-interval=2m dpd-maximum-failures=5
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/system clock
set time-zone-name=xxx
/system note
set show-at-login=no
/system ntp client servers
add address=0.xx.pool.ntp.org
/system scheduler
add disabled=yes interval=1w name=dl-mt-blacklist on-event=\
pwlgrzs-blacklist-dl policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=2024-12-01 start-time=00:05:00
add disabled=yes interval=1w name=ins-mt-blacklist on-event=\
pwlgrzs-blacklist-replace policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=2024-12-01 start-time=00:10:00
/system script
add dont-require-permissions=no name=pwlgrzs-blacklist-dl owner=admin \
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
source="/tool fetch url=\"https://raw.githubusercontent.com/pwlgrzs/Mikrot\
ik-Blacklist/master/blacklist.rsc\" mode=https"
add dont-require-permissions=no name=pwlgrzs-blacklist-replace owner=admin \
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
source="/ip firewall address-list remove [find where list=\"pwlgrzs-blackl\
ist\"]; /import file-name=blacklist.rsc; /file remove blacklist.rsc"