Такая ситуация: у нас три провайдера метрика 1 для gateway через первого провайдера, метрика2 для gateway через второго провайдера, метрика 3 - для третьего. Так мы получим отказоустойчивость нашего шлюза, если пропадет инет на первом провайдере - мы пойдем на второго, ну а если и на втором - то на третьего.
10.10.1.254, 10.10.2.254, 172.16.0.10 - шлюзы провайдеров.
или IP -> Routes -> "+" -> Dst.address 0.0.0.0/0, Gateway - 10.10.1.254, Type Unicast, Distans -1, Scope - 30, Target Scope -10, Routing Mark - rout_ether1 -> ok
или IP -> Routes -> "+" -> Dst.address 0.0.0.0/0, Gateway - 10.10.2.254, Type Unicast, Distans -1, Scope - 30, Target Scope -10, Routing Mark - rout_ether2 -> ok
или IP -> Routes -> "+" -> Dst.address 0.0.0.0/0, Gateway - 172.16.0.10 , Type - Unicast, Distans -1, Scope - 30, Target Scope -10, Routing Mark - rout_ppp8 -> ok
или IP -> Routes -> "+" -> Dst.address 0.0.0.0/0, Gateway - 8.8.8.8 , Check Gateway - ping, Type - Unicast, Distans -1, Scope - 30, Target Scope -10,-> ok
или IP -> Routes -> "+" -> Dst.address 0.0.0.0/0, Gateway - 8.8.4.4 , Check Gateway - ping, Type - Unicast, Distans -2, Scope - 30, Target Scope -10,-> ok
или IP -> Routes -> "+" -> Dst.address 0.0.0.0/0, Gateway - 1.1.36.3 , Check Gateway - ping, Type - Unicast, Distans -3, Scope - 30, Target Scope -10,-> ok
или IP -> Routes -> "+" -> Dst.address 8.8.8.8, Gateway - 10.10.1.254, Type - Unicast, Distans -1, Scope - 10, Target Scope -10,-> ok
или IP -> Routes -> "+" -> Dst.address 8.8.4.4, Gateway - 10.10.2.254, Type - Unicast, Distans -1, Scope - 10, Target Scope -10,-> ok
или IP -> Routes -> "+" -> Dst.address 1.1.36.3, Gateway -172.16.0.10, Type - Unicast, Distans -1, Scope - 10, Target Scope -10,-> ok
С основной маршрутизацией то все, но вот теперь надо научить наш Mikrotik отвечать на соединения через того же провайдера, через которого пришел пакет.
Пометим каждое соединение пришедшее снаружи и адресованное нашему роутеру:
/ip firewall mangle add action=mark-connection chain=input in-interface=ether1 new-connection-mark=syn_ether1
/ip firewall mangle add action=mark-connection chain=input in-interface=ether2 new-connection-mark=syn_ether2
/ip firewall mangle add action=mark-connection chain=input in-interface=Megalink_ppp8 new-connection-mark=syn_ppp8
Что бы отвечать через те же интерфейсы, откуда пришли запросы, поставим соответствующую роутинг-марку на каждое соединение.
/ip firewall mangle add action=mark-routing chain=output connection-mark=syn_ether1 new-routing-mark=rout_ether1 passthrough=no
/ip firewall mangle add action=mark-routing chain=output connection-mark=syn_ether2 new-routing-mark=rout_ether2 passthrough=no
/ip firewall mangle add action=mark-routing chain=output connection-mark=syn_ppp8 new-routing-mark=rout_ppp8 passthrough=no
где rout_ether1, rout_ether2, rout_ppp8 марки которая мониторится в правилах для маршрута по умолчанию, которые мы настроили в начале статьи.
Аналогичные правила для forward цепочки
/ip firewall mangle add action=mark-connection chain=forward in-interface=ether1 new-connection-mark=ether1-syn-f passthrough=no
/ip firewall mangle add action=mark-connection chain=forward in-interface=ether2 new-connection-mark=ether2-syn-f passthrough=no
/ip firewall mangle add action=mark-connection chain=forward in-interface=Megalink_ppp8 new-connection-mark=ppp8-syn-f passthrough=no
/ip firewall mangle add action=mark-routing chain=prerouting connection-mark=ether1-syn-f in-interface-list=lan new-routing-mark=rout_ether1
/ip firewall mangle add action=mark-routing chain=prerouting connection-mark=ether2-syn-f in-interface-list=lan new-routing-mark=rout_ether2
/ip firewall mangle add action=mark-routing chain=prerouting connection-mark=ppp8-syn-f in-interface-list=lan new-routing-mark=rout_ppp8
Где интерфейс лист lan состоит из br-vlan21, br-vlan100, ether5 - это все локальные сети которые могут запросить доступ в инет.