I have a static default route on ether1
And dynamic IP from LTE with dynamic gateway and higher distance.
I want to ping-check a remote host (eg 8.8.8.8/1.1.1.1) via static default route. (because the default gateway can be up, and isp network down)
If ping-check fails x-amount of times, I want to failover default to whatever the gateway of LTE is.
If ping-check succeeds via ether1 again, set default route back to ether1 gateway.
I am looking at https://help.mikrotik.com/docs/pages/vi ... d=26476608
Some of the commands in ros7 doesnt exist, so I had to tweak it.
My attempt
Code: Select all
/interface lte apn
set [ find default=yes ] add-default-route=no apn=xxx use-peer-dns=no
/ip dhcp-client
add add-default-route=no interface=ether1
/ip firewall mangle
add action=mark-connection chain=output connection-mark=no-mark connection-state=new new-connection-mark=ISP1_conn out-interface=ether1
add action=mark-routing chain=output connection-mark=ISP1_conn new-routing-mark=to_ISP1 out-interface=ether1
add action=mark-connection chain=output connection-mark=no-mark connection-state=new new-connection-mark=ISP2_conn out-interface=lte1
add action=mark-routing chain=output connection-mark=ISP2_conn new-routing-mark=to_ISP2 out-interface=lte1
/ip route
add dst-address=8.8.8.8 gateway=172.16.179.1 scope=10
add dst-address=8.8.8.8 gateway=lte1 scope=10
add check-gateway=ping distance=1 gateway=8.8.8.8 routing-table=to_ISP1
add check-gateway=ping distance=1 gateway=8.8.8.8 routing-table=to_ISP2
No route becomes active
Code: Select all
[admin@MikroTik] /ip> route/print
Flags: D - DYNAMIC; I, A - ACTIVE; c, s, y - COPY; H - HW-OFFLOADED; + - ECMP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DISTANCE
0 As + 8.8.8.8/32 lte1 1
1 As + 8.8.8.8/32 172.16.179.1 1
DAc 100.96.231.83/32 lte1 0
DAc 172.16.179.0/24 ether1 0
2 IsH 0.0.0.0/0 8.8.8.8 1
3 IsH 0.0.0.0/0 8.8.8.8 1
After this I can ping 8.8.8.8., but obviously nothing else works.
I feel its pretty close to solving this now?