Load Balancing Script

Load balance on the mikrotik is a technique to distribute the traffic load on two or more lines in a balanced connection, so that traffic can run optimally, maximize throughput, minimize response times and avoid overload on one connection path.
During this time many of us who think wrong, that by using loadbalance two connection lines, then the greater the bandwidth that we will get a doubling of bandwidth before using loadbalance (accumulation of both the bandwidth). This needs to be clear first, that loadbalance will not add much bandwidth we get, but it only served to split the traffic from both the bandwidth so they can be used in a balanced manner.
Here script Load Balancing for Mikrotik Router Board

/ip firewall mangle
add action=mark-connection chain=input comment=\"NEW Load Balance" connection-state=new \ disabled=no in-interface=Speedy-1 new-connection-mark=ADSL-1 \ passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new \ disabled=no in-interface=Speedy-2 new-connection-mark=ADSL-2 \ passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=ADSL-1 \ disabled=no new-routing-mark=route-1 passthrough=no
add action=mark-routing chain=output comment="" connection-mark=ADSL-2 \ disabled=no new-routing-mark=route-2 passthrough=no
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan-hotspot new-connection-mark=speedy-amik passthrough=yes per-connection-classifier=\ both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting comment="" disabled=no \ dst-address-type=!local in-interface=Lokal new-connection-mark=\ ADSL-2 passthrough=yes per-connection-classifier=\ both-addresses-and-ports:2/1
/ip firewall nat
add chain=srcnat action=masquerade src-address="172.16.123.0/27"

/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=PPPoE-1 \ routing-mark=route-1
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=PPPoE-2 \ routing-mark=route-2
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=PPPoE-2
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=PPPoE-1
add comment="" disabled=no distance=3 dst-address=0.0.0.0/0 gateway=PPPoE-2

0 Comment:

Post a Comment