How to Setup Load Balancing Mikrotik PPC Method

Load Balance / Load Balancing Mikrotik is a technique or method to divide the load into several paths (links) so that the use of the path (link) to be better. Mikrotik Load balance Previously I’ve discussed in this article Load Balance / Load Balancing Mikrotik.


Next, in this article, I will discuss how to load settings Mikrotik PPC method. Due to limited time and equipment, Mikrotik Load Balance Tutorial this time I take from web as follows:
During this time many of us who assume wrong, that by using the load balance of two lines of connection, then the bandwidth that we will get to be doubled from bandwidth before using load balance (accumulation of both bandwidth). It is necessary to clarify first, that load balancer will not increase the bandwidth we get, but it only serves to divide the traffic from both bandwidths to be used in a balanced manner.
With this article, we will prove that in the use of loadbalancing unlike the mathematical formula 512 + 256 = 768, but 512 + 256 = 512 + 256, or 512 + 256 = 256 + 256 + 256.
In this article we use RB433UAH with the following conditions:
1. Ether1 and Ether2 are connected to different ISPs with different bandwidth. ISP1 of 512kbps and ISP2 of 256kbps.
2. We will use internal web-proxy and use OpenDNS.
3. Mikrotik RouterOS you are using version 4.5 because the PCC features start to be known in version 3.24.

If the conditions above are different from the condition of your network, then the configuration we will describe here should be adjusted with the configuration for your local network.

Basic Configuration

Here are the Network Topology and IP address that we will use



For client connections, we use wireless connections on wlan2 with the IP client range to netmask, where IP paired with wlan2 serves as the gateway and DNS server of the client. If you are using DNS from one of your ISPs, there will be an additional mangle that we will give a bold mark.

Once the IP and DNS configs are correct, we must pair the default route to each of our ISP’s gateway IPs so that routers forward all unrelated traffic to him to the gateway. Here we use a useful check-gateway feature if one of our gateways breaks, then the connection will be diverted to another gateway.


For setting Access Point so that PC client can connect with our wireless, we use the command


In order for the client pc to connect to the internet, we also have to change the private IP client to public IP that is in our public interface is ether1 and ether2.


Until this step, the router and the pc client can already connect to the internet. Perform ping from either the router or the pc client to the internet. If that does not work, check your configuration again.
Internal Web proxy
On certain router boards, such as RB450G, RB433AH, RB433UAH, RB800 and RB1100 have expansion slots (USB, MicroSD, CompactFlash) for additional storage. In the following example, we will use USB flash which is attached to the USB slot. For the first time installation, this additional storage will read the invalid status in / system store. To be used as a cache storage medium, storage must be formatted first and activated Later we live to enable web proxy and set cache-on-disk = yes to use our storage media. Do not forget to turn HTTP traffic (TCP port 80) into our web proxy.


Mangle settings
In load balancing this time we will use a feature called PCC (Per Connection Classifier). With PCC we can classify the connection traffic through or out of the router into groups. This grouping can be distinguished by src-address, dst-address, src-port and or dst-port. The router will recall the gateway path that is passed at the beginning of the connection traffic so that the next packets that are still associated with the connection will initially be passed on the same gateway path as well. The advantages of this PCC that answered the many complaints often breaks the connection on other load balancing techniques before the PCC due to gateway displacement.
Before creating mangle load balance, to prevent the occurrence of routing loops on traffic, then all client traffic to the network that is connected directly to the router, we must bypass from load balancing. We can create a list of IPs that are still in one network router and install the first mangle as follows

In some cases, the first traffic can come from the Internet, such as the use of remote winbox or telnet from the internet and so on, therefore we also need a mark-connection to mark the traffic so that traffic can also pass through the interface where the traffic is in.


Generally, an ISP will restrict its DNS server access from only known IPs, so if you use DNS from one of your ISPs, you should add a mangle so that DNS traffic through the ISP gateway is concerned instead of through other ISP gateways. Here we provide the ISP1 DNS mangle through the ISP1 gateway. If you use public DNS independent, like OpenDNS, you do not need the mangle below.


Because we use web proxy on the router, then the traffic we need to load balance there are 2 types. The first is traffic from the client to the internet (not HTTP), and traffic from web proxy to the internet. To be more structured and easy to read, we will use custom-chain as follows:


In the mangle above, for load balance client traffic make sure the in-interface parameters are interfaces connected to the client, and for web proxy load balance traffic, we use output chains with out-interface parameters that are not connected to the client interface. After custom chain for load balancing is made, we can create mangle in the custom chain as follows


For example, on the loadbalancing client and web proxy use the same PCC traffic separation parameter, ie both-address, so the router will remember based on src-address and dst-address of a connection. Because of our different ISP traffic (512kbps and 256kbps), we divide the traffic load into 3 sections. The first 2 sections will pass through the ISP1 gateway, and the last 1 passes through the ISP2 gateway. If each traffic from the client and proxy has been marked, the next step we live to create a mangle mark-route that will be used in the routing process later


Routing Settings
The above mangle settings will not be used if you have not created a routing based on the mark-route we have created. Here we will also make the backup routing, so that if a gateway is disconnected, then all connections will pass through the gateway that each connected


From our test results, obtained as follows
From the viewable image, that just by doing 1 download file (1 connection), we only get speed 56kBps (448kbps) because at that moment pass through ISP 1 gateway, whereas if we download the file (open new connection) again on another web, will get 30kBps (240kbps). From this test, looks can be concluded that
512kbps + 256kbps ≠ 768kbps
* Load balancing using this PCC technique will run effectively and close to balanced if more and more connections (from the client) that occur.
* Use ISPs that have FIX instead of Share bandwidth to get more optimal results.
* Load Balance using PCC is not forever and entirely a solution that must work well in all types of networks because the balancing process of traffic is based on probability logic.