L2TP broken after router swap

Hi all,
I swapped yesterday a hAP ac2 with a 5009 router.
I’m pretty sure to copied all config from the olt to the new one, but something went wrong, sure.

I have a remote RB750 that won’t connet in L2TP with the new router

config of the 5009 at home

/export hide-sensitive 
# 2024-03-08 18:50:03 by RouterOS 7.12.1
# software id = D0I7-RUA4
#
# model = RB5009UG+S+
# serial number = 
/interface bridge
add admin-mac=78:9A:18:CB:0D:EE auto-mac=no comment=defconf name=bridge
/interface vlan
add interface=ether8 name="WiFi domotica" vlan-id=50
add interface=ether8 name="WiFi guest" vlan-id=51
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1 use-peer-dns=yes user=1460151
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip ipsec profile
set [ find default=yes ] dpd-interval=disable-dpd enc-algorithm=aes-256 hash-algorithm=sha256
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
add name=dhcp_guest ranges=192.168.99.2-192.168.99.50
add name=dhcp_l2tp ranges=192.168.100.2-192.168.100.5
add name=dhcp_pool3 ranges=192.168.101.50-192.168.101.254
/ip dhcp-server
add address-pool=dhcp interface=bridge lease-time=10m name=defconf
add address-pool=dhcp_guest authoritative=after-2sec-delay interface="WiFi guest" lease-time=1d name=server-guest
add address-pool=dhcp_pool3 interface="WiFi domotica" lease-time=1w3d name=dhcp1
/ppp profile
add dns-server=1.1.1.1 local-address=192.168.100.1 name=l2tp
/interface bridge port
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=ether6
add bridge=bridge comment=defconf interface=ether7
add bridge=bridge comment=defconf interface=ether8
add bridge=bridge comment=defconf interface=sfp-sfpplus1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface l2tp-server server
set authentication=mschap1,mschap2 default-profile=l2tp enabled=yes use-ipsec=required
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=pppoe-out1 list=WAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
add address=192.168.99.1/24 interface="WiFi guest" network=192.168.99.0
add address=192.168.101.1/24 interface="WiFi domotica" network=192.168.101.0
/ip dhcp-client
add comment=defconf disabled=yes interface=ether1
/ip dhcp-server lease
[... some leases ...]
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=192.168.88.1
add address=192.168.99.0/24 dns-server=1.1.1.1,8.8.8.8 gateway=192.168.99.1
add address=192.168.101.0/24 dns-server=8.8.8.8,1.1.1.1 gateway=192.168.101.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip 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 ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=accept chain=input comment="Per L2TP" dst-port=1701,500,4500 in-interface-list=all protocol=udp
add action=accept chain=input comment="Per L2TP" in-interface-list=all protocol=ipsec-esp
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="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
add action=accept chain=forward comment="Da LAN a L2TP NAS" dst-address=192.168.100.0/24 src-address=192.168.88.0/24
add action=accept chain=forward comment="Autorizza da rete casa a domotica" dst-address=192.168.101.0/24 src-address=192.168.88.0/24
add action=drop chain=input comment="defconf: drop all not coming from LAN" in-interface-list=!LAN
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="Blocca navigazione alla foscam" out-interface=pppoe-out1 src-address=192.168.88.43
add action=drop chain=forward comment="Blocco per rete ospiti" dst-address=192.168.88.0/24 src-address=192.168.99.0/24
add action=drop chain=forward comment="Blocco per rete ospiti" dst-address=192.168.99.0/24 src-address=192.168.88.0/24
add action=drop chain=forward comment="Blocca WiFi Domotica vs WiFi casa" connection-state=new dst-address=192.168.88.0/24 src-address=192.168.101.0/24
add action=drop chain=forward comment="Blocca WiFi Domotica vs Guest" dst-address=192.168.99.0/24 src-address=192.168.101.0/24
add action=accept chain=forward comment="OpenVPN con Pi-VPN" dst-address=192.168.88.11 dst-port=50000 log=yes protocol=tcp
add action=accept chain=forward comment=Zabbix disabled=yes dst-address=192.168.88.24 dst-port=10051 log=yes protocol=tcp
add action=accept chain=forward comment="Backup SCP su Frannuc" disabled=yes dst-address=192.168.88.20 dst-port=50023 protocol=tcp
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat comment="NAT per navigazione ospiti" out-interface=ether1 out-interface-list=WAN src-address=192.168.99.0/24
add action=dst-nat chain=dstnat comment="NAT per accesso in VPN" dst-port=50000 log=yes protocol=tcp to-addresses=192.168.88.11 to-ports=50000
add action=dst-nat chain=dstnat comment="Per Wireguard" dst-port=51820 protocol=udp to-addresses=192.168.88.52 to-ports=51820
add action=dst-nat chain=dstnat comment="NAT per Zabbix" disabled=yes dst-port=10051 log=yes protocol=tcp to-addresses=192.168.88.24 to-ports=10051
add action=dst-nat chain=dstnat comment="SCP per backup clienti" disabled=yes dst-port=50023 protocol=tcp to-addresses=192.168.88.20 to-ports=222
/ip service
set telnet address=192.168.88.0/24 disabled=yes
set ftp address=192.168.88.0/24
set www address=192.168.88.0/24
set ssh address=192.168.88.0/24
set api address=192.168.88.0/24
set winbox address=192.168.88.0/24
set api-ssl address=192.168.88.0/24
/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
/ppp secret
add name=francesco profile=l2tp remote-address=192.168.100.10 routes=192.168.88.0/24
add name=nasbackup profile=l2tp remote-address=192.168.100.2 routes=192.168.88.0/24
/system clock
set time-zone-name=Europe/Rome
/system identity
set name=MikroHome
/system note
set show-at-login=no
/tool graphing interface
add
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

I have not the remote config (so sad)

the error is

 18:55:12 ipsec,info respond new phase 1 (Identity Protection): local_ip[500]<=>remote_ip[58523]
 18:55:12 ipsec,error no suitable proposal found.
 18:55:12 ipsec,error remote_ip failed to get valid proposal.
 18:55:12 ipsec,error remote_ip failed to pre-process ph1 packet (side: 1, status 1).
 18:55:12 ipsec,error remote_ip phase1 negotiation failed.

Any ideas, please?

Thanks!

If you use Interface list, it will be easier to navigate and there will be a correct traffic flow. You have a slightly incorrect order of firewall rules.
Good practice says that it is best to use the “drop=all” method. This means that at the end of the Input chain and forward chain, the last rules will always have drop=all. It will be more correct.
Input chain:

/ip firewall address-list
add address=192.168.88.0/24 list=Main-LAN
add address=192.168.99.0/24 list=Guest-LAN
add address=192.168.100.2-192.168.100.5 list=L2TP-VPN
add address=192.168.101.0/24 list=Other-LAN

/ip 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 ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=accept chain=input src-address-list=Main-LAN comment="Config Access"
add action=accept chain=input comment=L2TP dst-port=500,1701,4500 \
    in-interface-list=WAN protocol=udp
add action=accept chain=input comment="IKE IPSec" in-interface-list=WAN \
    protocol=ipsec-esp
add action=accept chain=input comment="Allow LAN DNS queries-UDP" \ 
dst-port=53 in-interface-list=Main-LAN protocol=udp
add action=accept chain=input comment="Allow LAN DNS queries - TCP" \
dst-port=53 in-interface-list=Main-LAN protocol=tcp
add action=accept chain=input comment="Allow LAN DNS queries-UDP" \ 
dst-port=53 in-interface-list=Guest-LAN protocol=udp
add action=accept chain=input comment="Allow LAN DNS queries - TCP" \
dst-port=53 in-interface-list=Guest-LAN protocol=tcp
add action=drop chain=input comment="drop all else"

In the Forward section, we create rules by observing the address-list entries.Do not mix input chain with Forward.

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
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=accept chain=forward comment="allow internet traffic" in-interface-list=Main-LAN out-interface-list=WAN
add action=accept chain=forward comment="allow internet traffic" in-interface-list=Guest-LAN out-interface-list=WAN
add action=accept chain=forward comment=VPN dst-address-list=MAIN-LAN \
    src-address-list=L2TP-VPN
	
	your rules..................
add action=accept chain=forward comment="allow dst-nat from both WAN and LAN (including port forwarding)" connection-nat-state=dstnat
add action=drop chain=forward comment="drop all else"



/ip firewall nat
add action=masquerade chain=srcnat ipsec-policy=out,none out-interface-list=WAN \
    src-address=192.168.88.0/24
add action=masquerade chain=srcnat ipsec-policy=out,none out-interface-list=WAN \
    src-address=192.168.99.0/24

Thank you a lot! I’ll review my firewall rules :slight_smile:
I found the problem, the IPsec defconf from the old one was a little different on the crypt. In the new one there was a new defconf.
Not so easy to find, having not the remote, but now it is connected :slight_smile: