I have setup dual WAN for a customer, using a hEX S on 7.25.1.
Ether1 is fiber, hands out CGNAT, ether2 is FWA, hands out public IPV4
I have setup recursive routing, and use DHCP scripts that inserts gateway address into probe routes.
Everything works as expected on the customer side, if I disable ether1 or disconnect fiber patch, the router switches to FWA, when fiber connection is re-enabled, primary route on ether1 is back.
Problem is with the L2TP tunnel back to my main router (on 7.23.1).
When ether1 is disabled, the tunnel is stale for a period (as expected), it then terminates and re-establishes over ether2, so far so good.
However, when I re-enable ether1 normal traffic is back on fiber, but the tunnel remains stuck, it won't re-establish using fiber.
If I once again disable ether1, the tunnel re-establishes over ether2 but no more on ether1.
I have tried to disable tunnel and flush everything about IPSec, no use.
The error even survives a reboot of the customer router.
On the server side I have also tried to disable L2TP server and remove every trace of IPSec SAs, still no use.
Only thing that solves the problem is power-cycling the customer's router, then it's back.
Any suggestions for a solution?
Here is customer router config (irrelevant cfg removed)
/interface list
add name=WAN-interfaces/interface list member
add interface=ether1 list=WAN-interfaces
add interface=ether2 list=WAN-interfaces/interface l2tp-client
add connect-to=1.2.3.4 disabled=no ipsec-secret=mysecret name=
l2tp-out1 password=mypassword use-ipsec=yes user=myuser/ip dhcp-client
add add-default-route=no interface=ether1 name=client1 script="
\n :if ($bound=1) do={
\n :log info "DHCP Lease obtained on ether1 - set probe route 1 ga
teway and enable"
\n /ip route set [find comment="WAN1 probe"] \
\n gateway=($"gateway-address" . "%" . $interface) disabl
ed=no
\n } else={
\n :log info "DHCP Lease lost on ether1 - disable probe route 1"
\n /ip route set [find comment="WAN1 probe"] disabled=yes
\n }
\n" use-peer-dns=no
add add-default-route=no interface=ether2 name=client2 script="
\n :if ($bound=1) do={
\n :log info "DHCP Lease obtained on ether2 - set probe route 2 g
ateway and enable"
\n /ip route set [find comment="WAN2 probe"] \
\n
\n gateway=($"gateway-address" . "%" . $interface) disabl
ed=no
\n } else={
\n :log info "DHCP Lease lost on ether1 - disable probe route 2"
\n /ip route set [find comment="WAN2 probe"] disabled=yes
\n }
\n" use-peer-dns=no/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN-interfaces/ip route
add comment="WAN1 probe" disabled=no dst-address=8.8.8.8/32 gateway=
0.0.0.0/0%ether1 scope=10
add comment="WAN2 probe" disabled=no dst-address=208.67.222.222/32 gateway=
0.0.0.0/0%ether2 scope=10
add check-gateway=ping comment="WAN1 primary" distance=1 dst-address=
0.0.0.0/0 gateway=8.8.8.8 scope=30 target-scope=11
add check-gateway=ping comment="WAN2 backup" distance=2 dst-address=0.0.0.0/0
gateway=208.67.222.222 scope=30 target-scope=11/system watchdog
set ping-timeout=5m watch-address=8.8.8.8/tool netwatch
add disabled=no down-script="
\n :log warning "VPN watchdog: L2TP tunnel down"
\n :log warning "VPN watchdog: Disabling L2TP tunnel"
\n /interface l2tp-client disable [find name="l2tp-out1"]
\n :delay 30s
\n :log warning "VPN watchdog: Re-enabling L2TP tunnel"
\n /interface l2tp-client enable [find name="l2tp-out1"]
\n " host=10.0.100.1 interval=5m test-script="" timeout=1m type=icmp
up-script=
"
\n :log info "VPN watchdog: L2TP tunnel restored"
\n "