What is Mikrotik Load Balancing? ~ PT. Network Data System

Mikrotik Load Balancing – In a congested computer network, of course, the name of sending data and receiving data will always be there and will always work together. Of course this will make network traffic will be complicated. Therefore, there is such a thing as hardware called load balancing.

Just like it if the internet network traffic in your office or your agency is experiencing disruptions just because of data packets that collide, of course it is very troublesome. Therefore, it is necessary to have load balancing from Mikrotik.

Understanding Mikrotik Load Balancing

Load balancing is the process of distributing network traffic across multiple servers. This ensures that no single server endures too many requests. By spreading work evenly, load balancing improves application responsiveness. It also increases the availability of apps and websites for users.

The load balancer manages the flow of information between the server and the endpoint device (PC, laptop, tablet, or smartphone). Servers can be on-premises, in a data center or a public cloud. Servers can also be physical or virtual. Load balancers help servers move data efficiently, optimize use of application delivery resources, and prevent server overload.

Mikrotik load balancing performs continuous health checks on servers to ensure they can handle requests. If necessary, Mikrotik load balancing removes unhealthy servers from the pool until they are restored. Some load balancers even trigger the creation of new virtual application servers to cope with the increased demand.

The Best Mikrotik Load Balancing

Talking about Mikrotik load balancing, there are some of the best Mikrotik load balancing that can be applied according to needs.

Load Balancing Mikrotik 2 ISP

On mikrotik, there are many methods that can be used if you have more than 2 internet lines such as BGP, Failover, Load Balance, etc. Mikrotik 2 ISP load balancing is one of the most reliable.

Mikrotik PCC Load Balancing

The method called Mikrotik PCC Load Balancing is if you use load balancing two connection lines.

PCC (Per Connection Classifier). With PCC we can group the connection traffic via or in and out of the router into several groups. This grouping can be distinguished by src-address, dst-address, src-port and or dst-port. The router will remember the gateway path that was passed at the beginning of the connection traffic, so that subsequent packets that are still associated with the initial connection will be passed on the same gateway path as well.

Load Balancing Mikrotik 3 ISP

This is one of the most profitable Mikrotik load balancing. So, Mikrotik 3 ISP load balancing is a thing called failover.

If you run load balancing to all 3 ISPs, our network performance will not be optimal because there is 1 ISP that has shared bandwidth. Although the number is greater than the dedicated one, shared means that 100Mbps is still being divided again, usually the average bandwidth we find is only around 15-20Mbps.

Therefore, we will only run load balancing using 2 ISPs that have dedicated bandwidth. Meanwhile ISPs that have shared bandwidth will be generated as backups when all dedicated bandwidth ISPs experience problems (down).

Load Balancing Mikrotik NTH

In Mikrotik load balancing there is a feature called NTH. NTH itself is a feature on the Mikrotik firewall that is used as a counter for data packets or connections (new packets). There are two main parameters of this NTH, namely “Every” and “Packet”.

“Every” is a counter parameter, although “Packet” is a packet indication of how many NTH rules will be executed. Thus the implementation of NTH is carried out by activating a counter on the mangle, then marked with a ‘Route-Mark’. So this route mark is used as the basis for making policy routes.

Mikrotik Load Balancing and Failover Settings

It was mentioned above if there is a way to set load balancing and Mikrotik Failover, this is very useful if you want to use 3 ISPs directly.

Before starting the configuration, in order to make it easier to create a mangle rule, make an address list containing the LAN and network addresses that are immediately connected to the router. The way for the above topology, there is ether1-ISP1, ether2-ISP2, ether3-ISP3, and LAN network (only 1), then:

/ip firewall address-list

add address=11.11.11.0/24 list=LAN

add address=22.22.22.0/24 list=LAN

add address=33.33.33.0/24 list=LAN

add address=192.168.100.0/24 list=LAN

The packages mentioned above can be classified according to src-address, src-port, dst-address, and dst-port.

  1. Firewall Mangle

/ip firewall mangle

add action=mark-routing chain=prerouting src-address-list=LAN dst-address-list=!LAN

dst-address-type=!local new-routing-mark=route_to_ISP1 passthrough=no

per-connection-classifier=both-addresses:2/0

add action=mark-routing chain=prerouting src-address-list=LAN dst-address-list=!LAN

dst-address-type=!local new-routing-mark=route_to_ISP2 passthrough=no

per-connection-classifier=both-addresses:2/1

Since we only use src-address and dst-address (both-address), each mark is named route_to_ISP1 and route_to_ISP2.

Next, we create a recursive route using a static route protocol to route traffic to the online world. We first note the gateway of each ISP.

ISP1: 11.11.11.1

ISP2: 22.22.22.1

ISP3: 33.33.33.1

Because there are 3 ISPs that we will use for recursive routes to the online world, therefore we need 3 public IPs in the online world to create a recursive default gateway. Make sure this IP can be pinged and rarely down.

ISP1: 11.11.11.1 ==> 1.0.0.1

ISP2: 22.22.22.1 ==> 1.1.1.1

ISP3: 33.33.33.1 ==> 8.8.4.4

/ip route

## Static host route to public ip on the internet.

## Set a new scope value (different from default scope=30), eg=25.

add distance=1 ff-address=1.0.0.1/32 gateway=11.11.11.1 scope=25

add distance=1 ff-address=1.1.1.1/32 gateway=22.22.22.1 scope=25

add distance=1 ff-address=8.8.4.4/32 gateway=33.33.33.1 scope=25

## Default gateway to route traffic coming from the router itself.

## The target-scope value is the same as the scope value on the static host route.

## The check-gateway=ping parameter makes the router ping the gateway every 10 seconds interval,

## If ping 2x timeout in a row,

## then the link to the recursive ISP to the gateway is considered down.

add check-gateway=ping distance=1 gateway=1.0.0.1 target-scope=25

add check-gateway=ping distance=2 gateway=1.1.1.1 target-scope=25

add check-gateway=ping distance=3 gateway=8.8.4.4 target-scope=25

## Default gateway for routing traffic marked route_to_ISP1.

## The target-scope value is the same as the scope value on the static host route.

## Set priority using distance: ISP1, ISP2, ISP3

add distance=1 gateway=1.0.0.1 routing-mark=route_to_ISP1 target-scope=25

add distance=2 gateway=1.1.1.1 routing-mark=route_to_ISP1 target-scope=25

add distance=3 gateway=8.8.4.4 routing-mark=route_to_ISP1 target-scope=25

## Default gateway for routing traffic marked route_to_ISP2.

## The target-scope value is the same as the scope value on the static host route.

## Set priority using distance: ISP2, ISP1, ISP3

add distance=1 gateway=1.1.1.1 routing-mark=route_to_ISP2 target-scope=25

add distance=2 gateway=1.0.0.1 routing-mark=route_to_ISP2 target-scope=25

add distance=3 gateway=8.8.4.4 routing-mark=route_to_ISP2 target-scope=25

Load Balancing Setting Service

Maybe there are still many people who do not understand how to use load balancing. Although this is indeed one of the things that is needed, of course, after all, load balancing must exist on every dense computer network such as office agencies, government, schools, universities, and must use load balancing.

If you are still unable to do load balancing settings, then you can hire a load balancing setting service. Services like this are very common if you want to install load balancing.

You can really rely on NetData for load balancing setting services, you will get a guaranteed stable load balancing and also with affordable service costs with the best quality.

Conclusion

The main purpose of load balancing is to prevent a single server from being overloaded and possibly crashing. In other words, load balancing can improve service availability and help prevent downtime.

Leave a comment

Your email address will not be published. Required fields are marked *