Community discussions

MikroTik App
 
aliakberm92
just joined
Topic Author
Posts: 1
Joined: Sat May 21, 2016 11:22 am

Dual WAN Policy based Load Balancing with Failover

Mon May 23, 2016 7:52 am

Hello,

I am configuring my router and I want to setup the scenario as following:

LAN1 = 192.168.1.0/24 - eth5
LAN2 = 192.168.2.0/24 - eth5
WAN1 = 10.0.0.1 - eth1
WAN2 = 10.0.1.1 - eth2

I need to route my traffic from LAN1 to WAN1 only using policy based routing and LAN2 traffic over WAN2 only. But in case any of the links go down the traffic should be routed to the backup WAN i.e. if WAN1 goes down then LAN1 traffic should be diverted to WAN2. Also when the link comes up it should be diverted back to WAN1 only.

Any suggestions or help will be highly appreciated.
 
tiftok
newbie
Posts: 49
Joined: Thu Apr 07, 2016 1:40 pm

Re: Dual WAN Policy based Load Balancing with Failover

Mon May 23, 2016 9:07 pm

Hello
/ip firewall address-list add list=LAN1 address=192.168.1.2-192.168.1.254 ;
/ip firewall address-list add list=LAN2 address=192.168.2.2-192.168.2.254 ;
 /ip firewall mangle add chain=prerouting src-address-list=LAN1 action=mark-routing new-routing-mark=LAN1 ;
 /ip firewall mangle add chain=prerouting src-address-list=LAN2 action=mark-routing new-routing-mark=LAN2;
 /ip route
add distance=1 gateway=10.0.0.1 routing-mark=LAN1;
add distance=1 gateway=10.0.1.1 routing-mark=LAN2;

Have a good day :D

Who is online

Users browsing this forum: cralin, K0NCTANT1N, rextended, smirgo and 55 guests