The config I am trying get will accomplish the following
ISP1 Primary
ISP2 Secondary
l2tp traffic prefers ISP2 but will fail over to ISP1 if it does not connect with ISP2
All traffic fails over to ISP2 if ISP1 down.
ISP 1 and 2 have static routes.
One internal VLAN
the pre-routing chain seems to have no effect. If I use postrouting or output chain the reply to address is wrong when the packet hits the remote l2tp server and the connection does not establish. The issue seems to be that the l2tp traffic is being initiated from the router itself and does not enter the pre-routing stage.
I also have a simple queue that affect this traffic and they seem to work.
Have you tried to make that masquerade rule more specific? i.e. specifying out interface and maybe even changing to src-nat and specifying to-addresses?
try to put a route (ej to public l2tp tunel ip address) using the gateway of isp2 put distance 1 for failover. Doing this u are forcing to establish the tunnel over the second isp
then replicate for isp with distance 2.
ip route add dst-address=public-ip-of-l2tptunnel gateway=isp2-ip distance=1
Some good news. This worked for getting the l2tp to connect through isp2, it broke some nat rules but I did not mention them in the post and I was able to fix them. I will give you partial credit and pm you for where to send some paypal.