Well you’re right of course… here’s full config sans passwords and stuff:
# 2023-11-13 08:04:30 by RouterOS 7.12
# software id = J6WP-02EH
#
# model = RBD52G-5HacD2HnD
/interface bridge
add add-dhcp-option82=yes arp=proxy-arp comment="VLAN bridge" dhcp-snooping=\
yes igmp-snooping=yes ingress-filtering=no name=bridge1 protocol-mode=\
none vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] comment=WAN
set [ find default-name=ether4 ] comment=Raspberry
set [ find default-name=ether5 ] comment="Switch trunk"
/interface wireguard
add comment="WireGuard main interface" listen-port=18457 mtu=1420 name=\
wireguard1
/interface vlan
add comment="Main VLAN, data access" interface=bridge1 name=vlan1 vlan-id=33
add comment="Guest VLAN, Internet access only" interface=bridge1 name=vlan2 \
vlan-id=10
add comment="Work VLAN, maximum isolation" interface=bridge1 name=vlan3 \
vlan-id=20
/interface list
add name=Wireless
add name=LAN
add name=WAN
add name=Management
add name=WireGuard
add name=External
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk comment=cropp group-ciphers=tkip,aes-ccm \
mode=dynamic-keys name=profile2 supplicant-identity="" unicast-ciphers=\
tkip,aes-ccm
/interface wireless
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=\
20/40/80mhz-XXXX comment="5 GHz" country=france default-forwarding=no \
disabled=no distance=indoors frequency=auto installation=indoor mode=\
ap-bridge security-profile=profile2 skip-dfs-channels=all ssid=cropp \
wireless-protocol=802.11
/interface wireless manual-tx-power-table
set wlan2 comment="5 GHz"
/interface wireless nstreme
set wlan2 comment="5 GHz"
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip pool
add comment="Main VLAN pool" name=main_pool ranges=\
192.168.33.10-192.168.33.254
add comment="Guest VLAN pool" name=guest_pool ranges=\
192.168.11.11-192.168.11.254
add comment="Work VLAN pool" name=work_pool ranges=\
192.168.22.10-192.168.22.100
/ip dhcp-server
add address-pool=main_pool interface=vlan1 lease-time=1m name=main_dhcp
add address-pool=guest_pool interface=vlan2 lease-time=1m name=guest_dhcp
add address-pool=work_pool interface=vlan3 lease-time=10m name=work_dhcp
/routing pimsm instance
add disabled=yes name=pim1 vrf=main
/routing table
add fib name=wireguard
/interface bridge port
add bridge=bridge1 comment=Raspberry ingress-filtering=no interface=ether4 \
pvid=33
add bridge=bridge1 comment="Switch trunk" interface=ether5 pvid=33
add bridge=bridge1 comment="5 GHz" interface=wlan2 pvid=10
/ip neighbor discovery-settings
set discover-interface-list=none protocol=""
/ip settings
set rp-filter=strict
/ipv6 settings
set disable-ipv6=yes forward=no
/interface bridge vlan
add bridge=bridge1 comment="Allow VLAN 33" tagged=bridge1,ether5,wlan2 \
untagged=ether4 vlan-ids=33
add bridge=bridge1 comment="Allow VLAN 10" tagged=bridge1,ether5 untagged=\
wlan2 vlan-ids=10
add bridge=bridge1 comment="Allow VLAN 20" tagged=bridge1,ether5 \
vlan-ids=20
/interface list member
add interface=wlan2 list=Wireless
add interface=vlan1 list=LAN
add interface=vlan1 list=Management
add interface=vlan2 list=LAN
add interface=vlan3 list=LAN
add interface=ether1 list=WAN
add interface=wireguard1 list=WireGuard
add interface=ether1 list=External
add interface=wireguard1 list=Management
add interface=wireguard1 list=External
/interface wireguard peers
add allowed-address=0.0.0.0/0 endpoint-address=1.2.3.4 \
endpoint-port=12345 interface=wireguard1 persistent-keepalive=10s \
public-key="=somekey="
/ip address
add address=172.16.1.130/24 comment="WireGuard peer" \
interface=wireguard1 network=172.16.1.0
add address=192.168.33.1/24 comment="Main VLAN" interface=vlan1 network=\
192.168.33.0
add address=192.168.11.1/24 comment="Guest VLAN" interface=vlan2 network=\
192.168.11.0
add address=192.168.22.1/24 comment="Work VLAN" interface=vlan3 network=\
192.168.22.0
/ip dhcp-client
add add-default-route=no comment=WAN interface=ether1 use-peer-dns=no
/ip dhcp-server network
add address=192.168.11.0/24 comment="Guest network" dns-server=192.168.11.1 \
gateway=192.168.11.1
add address=192.168.22.0/24 comment="Work network" dns-server=192.168.22.1 \
gateway=192.168.22.1
add address=192.168.33.0/24 comment="Main network" dns-server=192.168.33.1 \
gateway=192.168.33.1
/ip dns
set allow-remote-requests=yes doh-max-server-connections=30 \
max-udp-packet-size=16384 query-total-timeout=5s servers=1.1.1.1
/ip firewall address-list
add address=192.168.33.0/24 list="Main VLAN"
add address=192.168.11.0/24 list="Guest VLAN"
add address=192.168.22.0/24 list="Work VLAN"
add address=192.168.11.0/24 comment="WireGuard: source guest" list=WireGuard
add address=192.168.22.0/24 comment="WireGuard: source work" list=WireGuard
add address=192.168.33.0/24 comment="WireGuard: source main" list=WireGuard
add address=1.1.1.1 comment="WireGuard: exclude from destination" list=\
WireGuardExclude
add address=192.168.11.0/24 list=LAN
add address=192.168.22.0/24 list=LAN
add address=192.168.33.0/24 list=LAN
add address=172.16.1.0/24 list=LAN
/ip firewall filter
add action=accept chain=input comment=\
"Accept established, related, untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="Drop invalid input" connection-state=\
invalid log=yes log-prefix=drop_invalid
add action=drop chain=forward comment="Drop invalid input" connection-state=\
invalid log=yes log-prefix=drop_invalid
add action=accept chain=input comment="Accept ICMP" log=yes protocol=icmp
add action=accept chain=input comment="Allow SSH & WinBox from Management" \
dst-port=22,8291 in-interface-list=Management protocol=tcp
add action=drop chain=input comment="Drop and log External input" \
in-interface-list=WAN log=yes log-prefix=drop_input
add action=fasttrack-connection chain=forward comment=\
"FastTrack established, related" \
connection-state=established,related disabled=yes hw-offload=yes
add action=accept chain=forward comment=\
"Accept established, related, untracked (existing connections)" \
connection-state=established,related,untracked
add action=drop chain=input comment="Drop all !LAN" disabled=yes \
in-interface-list=!LAN log=yes log-prefix=not_from_LAN
add action=drop chain=input comment="Drop Guest->Main: input" \
dst-address-list="Main VLAN" log=yes log-prefix=drop_guest \
src-address-list="Guest VLAN"
add action=drop chain=forward comment="Drop Guest->Main: forward" \
dst-address-list="Main VLAN" log=yes log-prefix=drop_guest \
src-address-list="Guest VLAN"
add action=drop chain=input comment="Drop Work->Main: input" \
dst-address-list="Main VLAN" log=yes log-prefix=drop_work \
src-address-list="Work VLAN"
add action=drop chain=forward comment="Drop Work->Main: forward" \
dst-address-list="Main VLAN" log=yes log-prefix=drop_work \
src-address-list="Work VLAN"
add action=drop chain=input comment="Drop Work->Guest: input" \
dst-address-list="Guest VLAN" log=yes log-prefix=drop_work \
src-address-list="Work VLAN"
add action=drop chain=forward comment="Drop Work->Guest: forward" \
dst-address-list="Guest VLAN" log=yes log-prefix=drop_work \
src-address-list="Work VLAN"
/ip firewall mangle
add action=jump chain=prerouting comment="WireGuard: jump to marking" \
connection-state=new jump-target=mark-connections
add action=accept chain=prerouting comment=\
"WireGuard: accept return connections" in-interface=wireguard1
add action=mark-routing chain=prerouting comment="WireGuard: mark routing" \
connection-mark=wireguard disabled=yes log-prefix=mark_routing \
new-routing-mark=wireguard passthrough=no
add action=mark-connection chain=mark-connections comment=\
"WireGuard: mark desired traffic" connection-mark=no-mark \
dst-address-list=!WireGuardExclude dst-address-type=!local log-prefix=\
mark_conn new-connection-mark=wireguard passthrough=yes src-address-list=\
WireGuard
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" disabled=yes \
out-interface=ether1
add action=masquerade chain=srcnat comment="WireGuard: masquerade" \
out-interface=wireguard1
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
/ip route
add comment="Static route to WireGuard peer" disabled=no distance=1 \
dst-address=1.2.3.4/32 gateway=192.168.79.1 pref-src="" \
routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add comment="test def route" disabled=yes distance=1 dst-address=0.0.0.0/0 \
gateway=192.168.79.1 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
add comment="WireGuard: default route @main" disabled=no distance=1 \
dst-address=0.0.0.0/0 gateway=wireguard1 pref-src="" routing-table=main \
scope=30 suppress-hw-offload=no target-scope=10
add comment="WireGuard: default route" disabled=no distance=1 dst-address=\
0.0.0.0/0 gateway=wireguard1 pref-src="" routing-table=wireguard scope=30 \
suppress-hw-offload=no target-scope=10
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/ip ssh
set forwarding-enabled=both host-key-type=ed25519 strong-crypto=yes
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 firewall filter
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 ICMPv6" protocol=\
icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" port=\
33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!*2000011
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 packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
"defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!*2000011
/system clock
set time-zone-name=Europe/Paris
/system identity
set name=mikrotik
/system logging
add topics=bridge
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=none
/tool mac-server ping
set enabled=no
I’ve decided to try approach outlined by @sindy in this post: http://forum.mikrotik.com/t/static-default-route-im-missing-something/119183/30 but still no luck. Basically, for this test, I want my LANs to reach 1.1.1.1 via ISPs gw (192.168.79.1, automatic route by DHCP @ether1), and everything else should go to the WireGuard. What happens now (if I enable defconf masquerade and route): 1.1.1.1 is working fine, WireGuard destinations hang (traceroute stops at the router). Right now I’m solving it by routing everything via WireGuard (see default 0.0.0.0/0 route @main), but I’d like to fully utilize the power of mangle (basically, I want to have address lists, where I can put domains etc). I can make this work with static routes or routing rules, but I want to do it properly via firewall.
Thanks everyone