Professional Documents
Culture Documents
Load Balancing Multiple Same Subnet Links
Load Balancing Multiple Same Subnet Links
Load Balancing Multiple Same Subnet Links
This example demonstrates how to set up load balancing if the provider is giving IP addresses from the same
subnet for all links.
After the IP address is set up, the connected route will be installed as an ECMP route:
[admin@MikroTik] > /ip route print detail
0 ADC dst-address=10.1.101.0/24 pref-src=10.1.101.18 gateway=ether1,ether2
gateway-status=ether1 reachable,ether2 reachable distance=0 scope=10
4 Mangle
In our example, very simple policy routing is used. Let`s start with adding routing tables for each mangle mark:
/routing table
add fib name=first
add fib name=other
Clients from the 192.168.1.0/24 subnet are marked to use the "first" routing table and 192.168.2.0/24 to use
the "other" subnet:
/ip firewall mangle
add action=mark-routing chain=prerouting src-address=192.168.1.0/24 new-routing-mark=first
add action=mark-routing chain=prerouting src-address=192.168.2.0/24 new-routing-mark=other
5 NAT
And masquerade our local network:
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
The same can be achieved by setting up route rules instead of mangle.
6 Routes
We are adding two gateways, one to resolve in the "first" routing table and another to the "other" routing table:
/ip route
add gateway=10.1.101.1@main routing-table=first
add gateway=10.1.101.1@main routing-table=other