Hi all!
First of all, I know this topic is old, but it is the right topic for me.
I "fight" on my MKT with "Advanced Routing Failover without Scripting"
http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting
I've got 2 WAN connections, and 2 LAN (LAN2 I do not use, so lets say there is only LAN1).
If I do not use /ip route (s) from that wiki art, and use mangle as I paste later everything works fine.
All trafic from WAN1 goes out from WAN1, (the same for WAN2).
I although do default routes without marks for outgoing traffic from MKT itself.
That all works.
Now below I'll copy/paste my settings (ip, mangle, routes) whitch does not work.
I think the problem is in mangle, because I tried few arts about failover and
In Chupaka Wiki there are no routes without marks. If I don't use routs without marks I have no internet connection..
Chupaka wrote:
so all outgoing traffic is marked with ISP1 (which goes to GW1) and ISP2 (which goes to GW2) marks
I don't know how mark ALL OUTGOING traffic. As I wrote above, I use some default routes without marks to have internet connection.
HERE IP ROUTES that works for me, but no failover here (and I want to have it):
0 A S dst-address=0.0.0.0/0 gateway=94.87.83.254
gateway-status=94.87.83.254 reachable via WAN1
distance=1 scope=30 target-scope=10 routing-mark=to_WAN1
3 S dst-address=0.0.0.0/0 gateway=192.168.0.0
gateway-status=192.168.0.0 unreachable distance=2
target-scope=10 routing-mark=to_WAN2
6 A S dst-address=0.0.0.0/0 gateway=94.87.83.254
gateway-status=94.87.83.254 reachable scope=30 target-scope=10
7 S dst-address=0.0.0.0/0 gateway=192.168.0.0
gateway-status=192.168.0.0 unreachable distance=2 target-scope=10
16 ADC dst-address=192.168.0.0/24 pref-src=192.168.0.59 gateway=WAN2
gateway-status=WAN2 reachable distance=0 scope=10
17 ADC dst-address=192.168.33.0/24 pref-src=192.168.33.1 gateway=LAN2
gateway-status=LAN2 reachable distance=0 scope=10
18 ADC dst-address=192.168.168.0/24 pref-src=192.168.168.1 gateway=LAN1
gateway-status=LAN1 reachable distance=0 scope=10
19 ADC dst-address=94.87.83.224/27 pref-src=94.87.83.242 gateway=WAN1
gateway-status=WAN1 reachable distance=0 scope=10
So here are my basic settings (I made to have failover withous script, but it does not work):
HOST1A - 8.8.8.8
HOST1B - 8.8.4.4
HOST2A - 208.67.220.220
HOST2B - 208.67.222.222
Fake GW1 - 172.16.1.1
Fake GW2 - 172.16.2.2
GW1: 94.87.83.254
GW2: 192.168.0.1
ip address print detail
0 address=192.168.168.1/24 network=192.168.168.0 interface=LAN1 actual-interface=LAN1
1 address=192.168.0.59/24 network=192.168.0.0 interface=WAN2 actual-interface=WAN2
2 address=192.168.33.1/24 network=192.168.33.0 interface=LAN2 actual-interface=LAN2
3 D address=94.87.83.242/27 network=94.87.83.224 interface=WAN1 actual-interface=WAN1
/ip firewall mangle print detail
0 ;;; DEFAULT ROUTING table for traffic from LAN to connected (WAN) networks
chain=prerouting action=accept dst-address=94.87.83.0/24
in-interface=LAN1
1 chain=prerouting action=accept dst-address=192.168.0.0/24
in-interface=LAN1
2 ;;; INPUT in WAN1, out WAN1
chain=input action=mark-connection new-connection-mark=WAN1_conn
passthrough=yes in-interface=WAN1
3 chain=output action=mark-routing new-routing-mark=to_WAN1
passthrough=no connection-mark=WAN1_conn
4 ;;; INPUT in WAN2, out WAN2
chain=input action=mark-connection new-connection-mark=WAN2_conn
passthrough=yes in-interface=WAN2
5 chain=output action=mark-routing new-routing-mark=to_WAN2
passthrough=no connection-mark=wan2_conn
6 ;;; Forward in WAN1, out WAN1
chain=forward action=mark-connection new-connection-mark=WAN1_forward
passthrough=yes connection-state=new in-interface=WAN1
7 chain=prerouting action=mark-routing new-routing-mark=to_WAN1
passthrough=no in-interface=LAN1 connection-mark=WAN1_forward
8 ;;; Forward in WAN2, out WAN2
chain=forward action=mark-connection new-connection-mark=WAN2_forward
passthrough=yes connection-state=new in-interface=WAN2
9 chain=prerouting action=mark-routing new-routing-mark=to_WAN2
passthrough=no in-interface=LAN1 connection-mark=WAN2_forward
/ip route print detail
0 A S dst-address=0.0.0.0/0 gateway=172.16.1.1
gateway-status=172.16.1.1 recursive via 94.87.83.254 WAN1
distance=1 scope=30 target-scope=10 routing-mark=to_WAN1
1 S dst-address=0.0.0.0/0 gateway=172.16.2.2
gateway-status=172.16.2.2 recursive via 192.168.0.1 WAN2
distance=2 scope=30 target-scope=10 routing-mark=to_WAN1
2 A S dst-address=0.0.0.0/0 gateway=172.16.2.2
gateway-status=172.16.2.2 recursive via 192.168.0.1 WAN2
distance=1 scope=30 target-scope=10 routing-mark=to_WAN2
3 S dst-address=0.0.0.0/0 gateway=172.16.1.1
gateway-status=172.16.1.1 recursive via 94.87.83.254 WAN1
distance=2 scope=30 target-scope=10 routing-mark=to_WAN2
4 A S dst-address=8.8.4.4/32 gateway=192.168.0.1
gateway-status=192.168.0.1 reachable via WAN2 distance=1
scope=10 target-scope=10
5 SB dst-address=8.8.4.4/32 type=blackhole distance=20
6 A S dst-address=8.8.8.8/32 gateway=94.87.83.254
gateway-status=94.87.83.254 reachable via WAN1
distance=1 scope=10 target-scope=10
7 SB dst-address=8.8.8.8/32 type=blackhole distance=20
8 A S dst-address=172.16.1.1/32 gateway=208.67.222.222
gateway-status=208.67.222.222 recursive via 94.87.83.254 WAN1
check-gateway=ping distance=1 scope=10 target-scope=10
9 S dst-address=172.16.1.1/32 gateway=8.8.8.8
gateway-status=8.8.8.8 recursive via 94.87.83.254 WAN1
check-gateway=ping distance=1 scope=10 target-scope=10
10 A S dst-address=172.16.2.2/32 gateway=208.67.220.220
gateway-status=208.67.220.220 recursive via 192.168.0.1 WAN2
check-gateway=ping distance=1 scope=10 target-scope=10
11 S dst-address=172.16.2.2/32 gateway=8.8.4.4
gateway-status=8.8.4.4 recursive via 192.168.0.1 WAN2
check-gateway=ping distance=1 scope=10 target-scope=10
12 ADC dst-address=192.168.0.0/24 pref-src=192.168.0.59
gateway=WAN2 gateway-status=WAN2 reachable distance=0 scope=10
13 ADC dst-address=192.168.33.0/24 pref-src=192.168.33.1
gateway=LAN2 gateway-status=LAN2 reachable distance=0 scope=10
14 ADC dst-address=192.168.168.0/24 pref-src=192.168.168.1
gateway=LAN1 gateway-status=LAN1 reachable distance=0 scope=10
15 ADC dst-address=94.87.83.224/27 pref-src=94.87.83.242
gateway=WAN1 gateway-status=WAN1 reachable distance=0 scope=10
16 A S dst-address=208.67.220.220/32 gateway=192.168.0.1
gateway-status=192.168.0.1 reachable via WAN2
distance=1 scope=10 target-scope=10
17 SB dst-address=208.67.220.220/32 type=blackhole distance=20
18 A S dst-address=208.67.222.222/32 gateway=94.87.83.254
gateway-status=94.87.83.254 reachable via WAN1
distance=1 scope=10 target-scope=10
19 SB dst-address=208.67.222.222/32 type=blackhole distance=20
Please check my mangle rules. Thank you.
pszemaz