My code is over here.
[admin@MikroTik] > /export compact
jan/04/2002 15:35:22 by RouterOS 6.0rc13
software id = Q8EC-lDTH
/ip dhcp-server
add address-pool=dhcp-pool-1 disabled=no interface=ether1 name=dhcp1
/ip address
add address=10.0.0.1/22 comment=LAN interface=ether1 network=10.0.0.0
add address=192.168.1.2/24 comment="first unifi link" interface=ether2 network=
192.168.1.0
add address=192.168.2.2/24 comment="unifi link 2" interface=ether3 network=
192.168.2.0
add address=192.168.3.2/24 comment="unifi link 3" interface=ether4 network=
192.168.3.0
add address=192.168.4.2/24 comment="unifi link 4" interface=ether5 network=
192.168.4.0
/ip dhcp-server network
add address=10.0.0.0/22 comment="added by setup" dns-server=8.8.8.8 gateway=
10.0.0.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip dns static
add address=192.168.88.1 disabled=yes name=router
add address=8.8.8.8 disabled=yes name=dns123
add address=8.8.8.8 disabled=yes
add address=8.8.8.8 name=dns.google.com
/ip firewall filter
add action=passthrough chain=hs-unauth-to comment="place hotspot rules here"
add chain=input dst-port=8291 protocol=tcp
add chain=input dst-port=23 protocol=tcp src-port=23
add chain=input protocol=tcp src-port=80
add chain=input
/ip firewall mangle
add action=mark-connection chain=input in-interface=ether2 new-connection-mark=
WAN1_conn
add action=mark-connection chain=input in-interface=ether3 new-connection-mark=
WAN2_conn
add action=mark-connection chain=input in-interface=ether4 new-connection-mark=
WAN3_conn
add action=mark-connection chain=input in-interface=ether5 new-connection-mark=
WAN4_conn
add action=mark-routing chain=output connection-mark=WAN1_conn
new-routing-mark=to_WAN1
add action=mark-routing chain=output connection-mark=WAN2_conn
new-routing-mark=to_WAN2
add action=mark-routing chain=output connection-mark=WAN3_conn
new-routing-mark=to_WAN3
add action=mark-routing chain=output connection-mark=WAN4_conn
new-routing-mark=to_WAN4
add chain=prerouting dst-address=192.168.1.0/24 in-interface=ether1
add chain=prerouting dst-address=192.168.2.0/24 in-interface=ether1
add chain=prerouting dst-address=192.168.3.0/24 in-interface=ether1
add chain=prerouting dst-address=192.168.4.0/24 in-interface=ether1
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=
auth in-interface=ether1 new-connection-mark=WAN1_conn
per-connection-classifier=both-addresses-and-ports:4/0
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=
auth in-interface=ether1 new-connection-mark=WAN2_conn
per-connection-classifier=both-addresses-and-ports:4/1
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=
auth in-interface=ether1 new-connection-mark=WAN3_conn
per-connection-classifier=both-addresses-and-ports:4/2
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=
auth in-interface=ether1 new-connection-mark=WAN4_conn
per-connection-classifier=both-addresses-and-ports:4/3
add action=mark-routing chain=prerouting connection-mark=WAN1_conn
in-interface=ether1 new-routing-mark=to_WAN1
add action=mark-routing chain=prerouting connection-mark=WAN2_conn
in-interface=ether1 new-routing-mark=to_WAN2
add action=mark-routing chain=prerouting connection-mark=WAN3_conn
in-interface=ether1 new-routing-mark=to_WAN3
add action=mark-routing chain=prerouting connection-mark=WAN4_conn
in-interface=ether1 new-routing-mark=to_WAN4
add action=mark-connection chain=prerouting disabled=yes dst-address-type=
!local hotspot=auth in-interface=ether1 new-connection-mark=WAN1_conn
per-connection-classifier=both-addresses-and-ports:4/0
add action=mark-connection chain=prerouting disabled=yes dst-address-type=
!local hotspot=auth in-interface=ether1 new-connection-mark=WAN2_conn
per-connection-classifier=both-addresses-and-ports:4/1
add action=mark-connection chain=prerouting disabled=yes dst-address-type=
!local hotspot=auth in-interface=ether1 new-connection-mark=WAN3_conn
per-connection-classifier=both-addresses-and-ports:4/2
add action=mark-connection chain=prerouting disabled=yes dst-address-type=
!local hotspot=auth in-interface=ether1 new-connection-mark=WAN4_conn
per-connection-classifier=both-addresses-and-ports:4/3
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here"
to-addresses=0.0.0.0
add action=masquerade chain=srcnat out-interface=ether2
add action=masquerade chain=srcnat out-interface=ether3
add action=masquerade chain=srcnat out-interface=ether4
add action=masquerade chain=srcnat out-interface=ether5 to-addresses=0.0.0.0
add action=masquerade chain=srcnat comment="masquerade hotspot network"
src-address=10.0.0.0/22 to-addresses=0.0.0.0
add action=masquerade chain=srcnat comment="masquerade hotspot network"
src-address=10.0.0.0/22
add chain=pre-hotspot dst-address-type=!local hotspot=auth
/ip route
add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=to_WAN1
add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.3.1 routing-mark=to_WAN3
add check-gateway=ping distance=1 gateway=192.168.4.1 routing-mark=to_WAN4
add check-gateway=ping distance=1 gateway=192.168.1.1
add check-gateway=ping distance=2 gateway=192.168.2.1
add check-gateway=ping distance=3 gateway=192.168.3.1
add check-gateway=ping distance=4 gateway=192.168.4.1
/system routerboard settings
set cpu-frequency=1200MHz memory-frequency=1066DDR
[admin@MikroTik] >