Thanks wiseroute and tdw! I think I did get seriously stuck. The goal seems so close, but yet I misunderstand something. Connection can be seen for a few seconds in the connection table marked with connection mark L2TP_CONN with state "syn-received" for a few seconds, then it disappears as TCP handshake never happens.
Here is my configuration, sanitised for public IPs. If someone could point where I am going wrong, and what to do to make this scenario work it would be much appreciated.
/export
# 2023-06-28 17:03:18 by RouterOS 7.10
#
/interface bridge
add admin-mac=48:8F:5A:17:4B:44 auto-mac=no comment=defconf name=bridge
/interface wireless
set [ find default-name=wlan1 ] antenna-gain=3 band=2ghz-b/g/n channel-width=20/40mhz-XX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=G-ciems2 \
wireless-protocol=802.11
set [ find default-name=wlan2 ] antenna-gain=6 band=5ghz-a/n/ac channel-width=20/40/80mhz-XXXX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=G-ciems5 \
wireless-protocol=802.11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface lte apn
set [ find default=yes ] use-peer-dns=no
add apn=wap.telephony.com authentication=pap name="Telephony provider internet" use-peer-dns=no user=web
/interface lte
set [ find default-name=lte1 ] allow-roaming=no apn-profiles="Telephony provider internet" band=""
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk mode=dynamic-keys supplicant-identity=MikroTik
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
/interface l2tp-client
add allow=chap,mschap1,mschap2 connect-to=100.100.100.1 disabled=no name=l2tp-client profile=default user=l2tp-user@a
add allow=mschap2 connect-to=100.100.100.1 name=l2tpaa profile=default user=l2tp-user@a
/routing table
add fib name=l2tp-table
/interface bridge port
add bridge=bridge comment=defconf interface=ether1
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ip settings
set tcp-syncookies=yes
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=lte1 list=WAN
add comment=myconf interface=l2tp1 list=WAN
/interface lte settings
set external-antenna=auto
/interface ovpn-server server
set auth=sha1,md5
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
/ip dhcp-relay
add dhcp-server=192.168.88.27 interface=ether1 name=dhcp-relay1
/ip dns
set allow-remote-requests=yes servers=192.168.88.27
/ip firewall address-list
add address=0.0.0.0/8 list=BOGONS
add address=10.0.0.0/8 list=BOGONS
add address=100.64.0.0/10 list=BOGONS
add address=127.0.0.0/8 list=BOGONS
add address=169.254.0.0/16 list=BOGONS
add address=172.16.0.0/12 list=BOGONS
add address=192.0.0.0/24 list=BOGONS
add address=192.0.2.0/24 list=BOGONS
add address=192.168.0.0/16 list=BOGONS
add address=198.18.0.0/15 list=BOGONS
add address=198.51.100.0/24 list=BOGONS
add address=203.0.113.0/24 list=BOGONS
add address=224.0.0.0/3 list=BOGONS
/ip firewall filter
add action=drop chain=forward comment="Drop incoming Bogon source addresses" in-interface-list=WAN src-address-list=BOGONS
add action=jump chain=forward comment="Create chain for allowing specific ICMP types" jump-target=ICMP-chain protocol=icmp
add action=add-src-to-address-list address-list=port-scan address-list-timeout=1d chain=forward comment="port scan src-addr list making with PSD" log=yes log-prefix=psd- protocol=tcp psd=\
21,3s,3,1
add action=add-src-to-address-list address-list=port-scan address-list-timeout=1d chain=input comment="port scan src-addr list making with PSD for input" log=yes log-prefix=psd- protocol=tcp psd=\
21,3s,3,1
add action=drop chain=forward src-address-list=port-scan
add action=drop chain=input src-address-list=port-scan
add action=add-src-to-address-list address-list=TCP-2-L2TP address-list-timeout=1d chain=input comment="not in use XT tarpitting list (connection attempts to NOT ext firewall ingress port)" \
disabled=yes dst-address=200.200.200.10 dst-port=!55554 in-interface=l2tp1 log=yes log-prefix=TARL-XT-CONN protocol=tcp
add action=add-src-to-address-list address-list=TCP-2-L2TP address-list-timeout=1d chain=input comment="XT DROP list (connection attempts to not 55554)" dst-address=200.200.200.10 dst-port=!55554 \
in-interface=l2tp1 log-prefix=DROPL-XT-CONN protocol=tcp
add action=drop chain=input comment="XT drop udp attempts to router on L2TP" dst-address=200.200.200.10 in-interface=l2tp1 protocol=udp
add action=drop chain=input comment="DROP XT conn to L2TP non 55554" log=yes log-prefix="DROP XT-CON to Router:" protocol=tcp src-address-list=TCP-2-L2TP
add action=drop chain=input comment="prevent ICMP smurf attack - drop dst- broadcast pings" dst-address-type=broadcast protocol=icmp
add action=accept chain=input comment="Echo Request with limit 2 per sec, (burst 5) to avoid ping flood of the router" icmp-options=8:0 limit=2,5:packet protocol=icmp
add action=jump chain=input comment="also jump to ICMP processing chain" jump-target=ICMP-chain protocol=icmp
add action=accept chain=ICMP-chain icmp-options=0:0 protocol=icmp
add action=accept chain=ICMP-chain comment="Echo Request with limit 200 per sec, (burst 5) - for all network ICMP type 8" icmp-options=8:0 limit=200,5:packet protocol=icmp
add action=accept chain=ICMP-chain icmp-options=3:0 protocol=icmp
add action=accept chain=ICMP-chain icmp-options=3:4 protocol=icmp
add action=accept chain=ICMP-chain comment="traceroute - time exceeded (11:0)" icmp-options=11:0 protocol=icmp
add action=accept chain=ICMP-chain icmp-options=11:3 protocol=icmp
add action=return chain=ICMP-chain
add action=drop chain=input comment="prevent ICMP smurf - drop ICMP coming from outside the network" in-interface-list=WAN protocol=icmp
add action=drop chain=forward protocol=icmp
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 to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
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 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="drop all last rule" disabled=yes
/ip firewall mangle
add action=mark-connection chain=prerouting comment="mark incoming new (SSH) connection" in-interface=l2tp1 new-connection-mark=L2TP_CONN passthrough=yes
add action=mark-routing chain=prerouting comment="mark for returning SSH communicaiton for l2tp routing table" connection-mark=L2TP_CONN in-interface=bridge new-routing-mark=l2tp-table \
passthrough=yes
/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="local DNS" dst-port=53 in-interface-list=LAN protocol=tcp src-address=!192.168.88.27 to-ports=53
add action=redirect chain=dstnat comment="local DNS" dst-port=53 in-interface-list=LAN protocol=udp src-address=!192.168.88.27 to-ports=53
add action=dst-nat chain=dstnat comment="DNAT to the ssh server on LAN" dst-address=200.200.200.10 dst-port=55554 log=yes log-prefix=SSH-DNAT-from-EXT: protocol=tcp to-addresses=192.168.88.18 \
to-ports=22
/ip firewall raw
add action=drop chain=prerouting comment="UDP flood protection in case we have DNS enabled" dst-port=53 in-interface-list=WAN protocol=udp src-address-list=""
add action=accept chain=prerouting comment="internal UDP DNS flood protection" dst-port=53 in-interface-list=!WAN limit=100,5:packet protocol=udp
add action=drop chain=prerouting comment="internal UDP DNS flood protection" dst-port=53 in-interface-list=!WAN protocol=udp
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set sip disabled=yes
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=200.200.200.10 pref-src="" routing-table=l2tp-table scope=30 suppress-hw-offload=no target-scope=10
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh port=2244
set www-ssl certificate=*1 disabled=no
set api disabled=yes
set api-ssl disabled=yes
/ip ssh
set host-key-size=4096 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=!LAN
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=!LAN
/routing rule
add action=unreachable disabled=no routing-mark=l2tp-table
/system clock
set time-zone-name=Europe/London
/system note
set show-at-login=no
/system routerboard mode-button
set enabled=yes on-event=dark-mode
/system script
add comment=defconf dont-require-permissions=no name=dark-mode owner=*sys policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="\r\
\n :if ([system leds settings get all-leds-off] = \"never\") do={\r\
\n /system leds settings set all-leds-off=immediate \r\
\n } else={\r\
\n /system leds settings set all-leds-off=never \r\
\n }\r\
\n "
/system upgrade upgrade-package-source
add address=159.148.147.204
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool mac-server ping
set enabled=no