You are on page 1of 14

2 WAN 1 Evo/3g Load balancing in mikrotik using PCC

Method.
Open your mikrotik using Winbox.
Go to interfaces and name the interfaces as Local , WAN1, WAN3 and pppoe1.
Local interface will be our output and will entertain our users, WAN1 is attached to a PTCL
DSL Modem, WAN3 is also attached to a PTCL DSL Modem and pppoe1 is our EVO/3G
usb.

Evo/Nitro/3G modem with Mikrotik


Connect your Evo/Nitro/3G modem with Mikrotik and restart Mikrotik to take the settings.
You will see a new entry in Interface with the name PPP_Client1. Goto Interfaces and delete
the PPP_Client1 and click on Down arrow with plus sign.

Select PPP Client.

A new menu will pop up.


In General tab,Select the port where your 3G modem is connected.

In General tab,Select the port where your 3G modem is connected.


In PPP Tab,Click on advanced mode to get all the options visible.
Here,you have to enter your username and password provided by your Internet service
provider.
(I am doing settings for Ptcl Evo and using the username and password for Ptcl Evo. You
should use the username and password provided by your Internet Service Provider. )
Phone: #777
Dial Command: ATDT
User: vwireless@ptcl.com
Password: ptcl
Un check Dial on Demand,Add default route,Use Peer DNS.
Keep Alive Timeout: 0.
Press apply and Ok.
When you see connected status,its means you are connected successfully.

Now go to Ip and set your DNS.


Then Go to IP >Routes to add default gateway.
In Default gateway Tab,select PPP_out1.

You are done..You have successfully connected your Evo/Nitro/3G Modem with Mikrotik.
Now goto tools > Ping and ping to google.com to check your internet connectivity.

You can also watch a video in urdu language on howto connect Evo/Nitro/3G Modem with
Mikrotik..

Set your 3G usb username and password. I will treat ppp-out1 as WAN2.
Be sure to change the IPs of Modem1 and Modem2.

When your 3G modem is ready, Give IP addresses to your WAN Links.


Go to IP > Addresses, click on red plus sign and give IP to Local interface.
Address= 192.168.0.1/24
Interface= Local
Now assign IP to your WAN1
Address=192.168.1.2/24
Interface=WAN1
Now assign IP to your WAN3
Address=192.168.2.2/24
Interface=WAN3

Your Addresses should look like this.

Now come to the Mangle rules which is the essence of this article.
Click on IP > Firewall > Mangle
Click on Red + sign to add a new mangle rule for WAN1
Chain=input
In.interface=WAN1
Click on advanced tab
Action=mark connection
New Connection Mark=WAN1_conn
Check the pass through.

Repeat the process for WAN3


Chain=input
In.interface=WAN3
Click on advanced tab
Action=mark connection
New Connection Mark=WAN3_conn
Check the pass through.
Do the same for the WAN2 which is our usb or ppp-out1
Chain=input
In.interface=ppp-out1
Click on advanced tab
Action=mark connection

New Connection Mark=WAN2_conn


Check the pass through.
Your mangle rules should look like this.

Now again we will add mangle rules.


Click on red + sign.
Chain=output
Connection mark=WAN1-conn
Click on advanced tab
Action=mark routing
New Connection Mark=to_WAN1
Check the pass through.

Again for WAN3


Chain=output
Connection mark=WAN3-conn
Click on advanced tab
Action=mark routing
New Connection Mark=to_WAN3
Check the pass through.

Again for WAN2/our USB


Chain=output
Connection mark=WAN2-conn
Click on advanced tab
Action=mark routing
New Connection Mark=to_WAN2
Check the pass through.
Your mangle rules should look like this.

Now we will add PCC (Per connection Classifier) Rules.


Click on red + sign to add a new mangle rule for PCC
Chain=Prerouting
In.interface=Local
Click on Advanced tab.
Per connection Classifier=both addresses and ports 3/0
3 over 0).
Click on extra tab.
DST.address type
Address type=Local.
Click on invert
Click on action tab.
Action=mark connection
New connection mark=WAN1_Conn

(we have three lines so we will use

Again for WAN3


Chain=Prerouting
In.interface=Local
Click on Advanced tab.
Per connection Classifier=both addresses and ports 3/1 .
Click on extra tab.
DST.address type
Address type=Local.
Click on invert
Click on action tab.
Action=mark connection
New connection mark=WAN3_Conn
Now for WAN2
Chain=Prerouting
In.interface=Local
Click on Advanced tab.
Per connection Classifier=both addresses and ports 3/2 .
Click on extra tab.
DST.address type
Address type=Local.
Click on invert

Click on action tab.


Action=mark connection
New connection mark=WAN2_Conn
Your PCC rules should look like this.
Now we will add final mangle rules.
Click on red + sign
Chain=prerouting
In.interface=Local
Connection mark=WAN1_conn
Action=mark routing
New routing mark=to-WAN1
Check pass through

Add again for WAN3


Chain=prerouting
In.interface=Local
Connection mark=WAN3_conn
Action=mark routing
New routing mark=to-WAN3
Check pass through
Again add for WAN2
Chain=prerouting
In.interface=Local
Connection mark=WAN2_conn

Action=mark routing
New routing mark=to-WAN2
Check pass through
Your mangle rules should look like this.

PhewOur Mangle rules are over.


Now we will add gateways.
Click on IP> Routes
Click on red + sign.
Gateway= 192.168.1.1
Check gateway=ping (This is a fail over entry which will ping the gateway continuously,if
the gateway does not responds,it will disconnect that Line and put the load on the rest of the
lines.)
Routing Mark=to_wan1
Now add second route
Gateway= 192.168.2.1
Check gateway=ping (This is a fail over entry which will ping the gateway continuously,if
the gateway does not responds,it will disconnect that Line and put the load on the rest of the
lines.)
Routing Mark=to_wan3
Now the third one.
Gateway= pppoe1
Check gateway=ping (This is a fail over entry which will ping the gateway continuously,if
the gateway does not responds,it will disconnect that Line and put the load on the rest of the
lines.)
Routing Mark=to_wan2

Now add routes with distance.


Again click on red + sign
Gateway= 192.168.1.1
Check gateway=ping
Distance=1 (It tells the router which gateway to ping first)
Again for the second one.
Gateway= 192.168.2.1
Check gateway=ping
Routing Mark=to_wan3
Finally for the third one.
Gateway= ppp-out1
Check gateway=ping
Routing Mark=to_wan2

The Final steps:


Now we will add three NAT rules which will enable internet sharing.
Go to IP>Firewall >NAT
Click on red + sign
Chain=srcnat
Out interface=WAN 1
Action=marsquerade

Add for WAN3

Chain=srcnat
Out interface=WAN 3
Action=marsquerade
Finally for the WAN2
Chain=srcnat
Out interface=ppp-out1
Action=marsquerade
We have configured 2WAN 1evo/3g load balancing in mikrotik. Now put user load over
it.The more load you will put, the more better results you will get.
Check the results.