Syed Jahanzaib Personnel Blog to Share Knowledge !

June 4, 2011

Mikrotik 4 WAN Load Balancing using PCC method. Complete Script ! by zaiB

Following is a complete script for Mikrotik to combine/Load Balance 4 WAN links OR DSL links , and the script idea is taken from
http://wiki.mikrotik.com/wiki/Manual:PCC#Example

In this example I have used MikrotikT RB750 5 ports router. 4 ports were connected with Four DSL Routers, and 5th port was connected with User LAN. All DSL lines have un-equal speed. Also don’t forget to rename the interface names accordingly.

In my personnel experience , If users request are directly hitting Mikrotik configured with PCC , then you will get good load balancing. Use src-address as classifier, this way you will get rid of problems like https/broken link, streaming issues etc. Load balancing using this PCC technique (src-address) will be effective and balanced approach when more and more connections (from clients) that occurred. I also recommend to use SQUID proxy server along with mikrotik , either parallel or in front or backend , for better response time and it will also increase good browsing experience to users.

If somehow you are not satisfied with the src-address approach,play with the PCC-Classifier,
Try both addresses and ports as the classifier. While this will randomize things the most and in theory give you the most fair allocation of bandwidth, BUT there is also a good chance that it will break certain things like banking web sites and some forums. This is because often times a HTTP requests will generate several connections, so there is a chance that some requests may go out a different route than the initial one, and that will break secure web sites. For that reason I usually stick with src-address PCC load balancing.

Result of this script is as follows on screenshots.
[Thanks to sam @ fastmesh for the screenshots :) ]

Syed Jahanzaib


/ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2
add address=192.168.3.2/24 network=192.168.3.0 broadcast=192.168.3.255 interface=WAN3
add address=192.168.4.2/24 network=192.168.4.0 broadcast=192.168.4.255 interface=WAN4

/ip firewall mangle
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn
add chain=input in-interface=WAN3 action=mark-connection new-connection-mark=WAN3_conn
add chain=input in-interface=WAN4 action=mark-connection new-connection-mark=WAN4_conn

add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
add chain=output connection-mark=WAN3_conn action=mark-routing new-routing-mark=to_WAN3
add chain=output connection-mark=WAN4_conn action=mark-routing new-routing-mark=to_WAN4

add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.4.0/24 action=accept in-interface=Local

add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/2 action=mark-connection new-connection-mark=WAN3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/3 action=mark-connection new-connection-mark=WAN4_conn passthrough=yes
add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2
add chain=prerouting connection-mark=WAN3_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN3
add chain=prerouting connection-mark=WAN4_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN4

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=to_WAN3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.1 routing-mark=to_WAN4 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.1 distance=4 check-gateway=ping

/ip firewall nat
add chain=srcnat out-interface=WAN1 action=masquerade
add chain=srcnat out-interface=WAN2 action=masquerade
add chain=srcnat out-interface=WAN3 action=masquerade
add chain=srcnat out-interface=WAN4 action=masquerade

Now Configure DNS server so users can resolve hostnames,

/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000KiB max-udp-packet-size=512 servers=221.132.112.8,8.8.8.8

All Done ! Now Test the link by putting user load, the more multiple users load you put on it, the better Load Balance result you will get :)

PCC WITH UN-EQUAL WAN LINKS

If you have Un-Equal WAN Links, for example WAN,1,2,3 are of 4MB and WAN,4 is of 8 Mb, and you want to force MT to use WAN4 link more then other because of its capacity, Then you have to Add more PCC rules assigning the same two marks to a specific link i.e WAN4 , something like

Code:

add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/2 action=mark-connection new-connection-mark=WAN3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/3 action=mark-connection new-connection-mark=WAN4_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/4 action=mark-connection new-connection-mark=WAN4_conn passthrough=yes

٩(●̮̮̃•̃)۶   ZaiB   ٩(●̮̮̃•̃)۶

302 Comments »

  1. thank ur shared

    Comment by omheru — June 18, 2011 @ 9:44 AM

  2. nice how 10 wan load balasing

    Comment by Aman Farooqi — June 19, 2011 @ 7:49 AM

    • Same as 4 WAN works, just add entries for as many dsl your system supports.

      Comment by aacable — June 23, 2011 @ 8:36 AM

  3. good info, how to check if the network using pppoe

    Comment by tq ur share — June 29, 2011 @ 5:43 PM

    • Try This one .

      Load Balance Mikrotik with PCC using PPPoe-Client connection

      First, make new mangle for mark connection, packet and routing :

      / ip firewall mangle
      add chain=input in-interface=internet1 action=mark-connection new-connection-mark=internet1_conn
      add chain=input in-interface=internet2 action=mark-connection new-connection-mark=internet2_conn
      add chain=output connection-mark=internet1_conn action=mark-routing new-routing-mark=to_internet1
      add chain=output connection-mark=internet2_conn action=mark-routing new-routing-mark=to_internet2
      add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses:2/0 \
      action=mark-connection new-connection-mark=internet1_conn passthrough=yes
      add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses:2/1 \
      action=mark-connection new-connection-mark=internet2_conn passthrough=yes
      add chain=prerouting connection-mark=internet1_conn in-interface=Local action=mark-routing new-routing-mark=to_internet1
      add chain=prerouting connection-mark=internet2_conn in-interface=Local action=mark-routing new-routing-mark=to_internet2

      Than set the default route and fail over gateway : (change the ips according to your network design)
      / ip route
      add dst-address=0.0.0.0/0 gateway=10.111.0.1 routing-mark=to_internet1 check-gateway=ping
      add dst-address=0.0.0.0/0 gateway=10.112.0.1 routing-mark=to_internet2 check-gateway=ping
      add dst-address=0.0.0.0/0 gateway=10.111.0.1 distance=1 check-gateway=ping
      add dst-address=0.0.0.0/0 gateway=10.112.0.1 distance=2 check-gateway=ping

      Last, set the NAT for local connection:
      / ip firewall nat
      add chain=srcnat out-interface=internet1 action=masquerade
      add chain=srcnat out-interface=internet2 action=masquerade

      That is simple script for Load Balance Mikrotik with PCC using PPPoe-Client connection.

      Comment by aacable — June 30, 2011 @ 5:51 AM

  4. So, to use this PPC script, i change the interface names to match my interface names and the ips to match my static ips?

    Then i am good to go?

    Thanks!

    Comment by sam — July 2, 2011 @ 11:32 PM

  5. hi, thanks for the reply!

    what is the purpose of these ping lines? are they necessary for the load balance to operate correctly on dsl?

    are they supposed to be 0.0.0.0 or am i to change them to something?

    /ip route
    add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=to_WAN3 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.4.1 routing-mark=to_WAN4 check-gateway=ping

    add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.4.1 distance=4 check-gateway=ping

    Comment by sam — July 4, 2011 @ 5:51 AM

    • check-gateway=ping is used in fail-over scenario. means if the gateway is not available mikrotik will not forward request to that link. its a fail-over feature.

      Comment by aacable — July 4, 2011 @ 5:59 AM

  6. great! so i change the 0.0.0.0 to the ip of where i wish to ping for checking link status/if im online on what wan?

    Comment by sam — July 4, 2011 @ 6:00 AM

    • 0.0.0.0/0 usually represents internet. or any other network that is not on your subnet.
      don’t mix this with check-gateway=ping syntax.

      Comment by aacable — July 4, 2011 @ 6:15 AM

  7. Ok. Got is, so for example i could use

    add dst-address=8.8.8.8/24 gateway=192.168.1.1 distance=1 check-gateway=ping

    add dst-address=4.2.2.2/24 gateway=192.168.2.1 distance=1 check-gateway=ping

    is the x.x.x.x/24 correct? or is 24 wrong?

    Comment by sam — July 4, 2011 @ 6:18 AM

    • this line “ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1″ means that it will route any data that is not on your same subnet , to gateway 192.168.1.1 (dsl)

      you don’t add command like this “add dst-address=8.8.8.8/24 gateway=192.168.1.1″ its wrong.
      use packet marking/mangling feature to route specific traffic to gateway of your choice. for example you can mark packets for youtube/fb and then in route you can decide that from which dsl/gateway should fb/youtube data go, (for load balancing) there are several types of load balancing available in mikrotik. Reat the wiki. use this example
      http://wiki.mikrotik.com/wiki/Per-Traffic_Load_Balancing
      http://wiki.mikrotik.com/wiki/Category:Routing

      Comment by aacable — July 4, 2011 @ 6:25 AM

  8. Hey, i really appreciate your help. I am new to mikrotik, but looking to understand it better. I have a 4 wan 450g to get working so i really appreciate your help!

    Thanks for explaining the ip route line to me. So i dont change anything there but my gateway ip in that line.

    Do you mind if i send you my draft of script and you let me know if everything is good once i have played around with it? I will only be on site for one day to actually test it, and if it doesnt work, im dead. but i have a week or so to play around.

    Thanks again!

    Comment by sam — July 4, 2011 @ 6:29 AM

    • send me a copy along with your network scenario , ip series or other possible detal on dsl.

      Comment by aacable — July 4, 2011 @ 6:36 AM

      • will do!
        i dont know the static ips until the tech comes in to install the dsl lines. BUT i can give you some other ips in place of them and i can easily change them out to the new ones.

        Thanks!

        Comment by sam — July 4, 2011 @ 6:45 AM

  9. Hey,
    I have a question you may be able to answer. I am trying to make it so the mikrotik router captures all DNS traffic and points it to opendns.

    Is it a mangle script that does this?
    We have the dns in the router for open dns, but i want to make sure people cant get around it.

    Do you know how to write this script for opendns? (this may make a popular blog entry ;)

    The OpenDNS nameservers are 208.67.222.222 and 208.67.220.220.

    ill post it in the opendns community too.

    Comment by sam — July 4, 2011 @ 7:11 PM

    • If you have a small lan, its better to use Mikrotik default dns server, and in mt dns forwarder, add opendns entries , this way all your users dns request will be fulfilled by opendns via mikrotik (you will be benefited with mikrotik dns cache facility)

      or else Following is just simple firewall rule which will force all Your users behind mikrotik to use DNS server which You will define.

      In /ip firewall filter nat

      add chain=dstnat action=dst-nat to-addresses=192.168.1.1 to-ports=53 protocol=tcp dst-port=53

      add chain=dstnat action=dst-nat to-addresses=192.168.1.1 to-ports=53 protocol=udp dst-port=53

      This rule will force all users with custom defined DNS server to use 192.168.1.1 as their DNS server, this rule will simply redirect all request sent to ANY-IP:53 to 192.168.1.1:53

      Comment by aacable — July 5, 2011 @ 5:47 AM

      • so i have a quite large LAN, so should i still use the mikrotik dns forwarder? or will the firewall rule acomplish the same thing?

        do you have a script for quickly configuring the dns server? (this is where the lan will get DNS info via DHCP? so their computers will read the mikrotik gateway as the dns?) or is it a different area where dns server is configured?

        With a very large and busy lan is it a good idea to have the mikrotik cache dns? (on a 450g)

        thanks!

        Comment by sam — July 8, 2011 @ 4:30 AM

      • Its generally not a good idea to use mikrotik as a dns server for really busy network. because mikrotik dns is not designed for heavy network load, however it works
        .
        If you have high load of users, its better to use another box preferably with linux as DHCP n DNS Server. Recevtly I done installation of relatively a large network with around 3000 Users, and I used UBUNTU linux as dhcp n dns server with DNS Cache service name DNSMASQ. Result was good, and it really reduce some load from mikrotik.
        Read my story at : http://aacable.wordpress.com/2011/07/05/a-network-design-glass-line-pvt-ltd-june-2011/

        Comment by aacable — July 8, 2011 @ 11:18 AM

      • and i take it 192.168.1.1 is the miktorik gateway lan ip address in this script?

        Comment by sam — July 8, 2011 @ 4:32 AM

  10. i read yr script
    but i need to know how it work my dsl router

    i hv 3 DSL {3 x (2Mb) = 6} connection i want to combine them together

    how i merge 3 modems (LAN) outputs

    plz help me

    Comment by UsmanGhani — July 8, 2011 @ 1:46 PM

    • You can get combined bandwidth only if your carrier /ISP offers MLPPP.

      to get near, you can use LOAD BALANCING method, including PCC,
      read the mikrotik wiki and you will get many ideas on how to achieve this.

      Comment by aacable — July 9, 2011 @ 9:24 AM

  11. > and i take it 192.168.1.1 is the miktorik gateway lan ip address in this script?
    > Comment by sam — July 8, 2011 @ 4:32 AM ”

    The very first post with the PCC setup have 192.168.0.1 as mikrotik LAN for users.
    but in the last post where I posted DNS server redirecting command, 192.168.1.1 is the LAN facing ethernet. it was an example. try to judge things by common sense :~) :P

    Comment by aacable — July 9, 2011 @ 5:43 AM

  12. dear zaib

    kia app teamviewer per mere router ki configration kr deen gay

    via winbox

    i hv 2 dsl connection

    Comment by usman — July 10, 2011 @ 9:52 AM

    • Yeah sure, contact me aacable at hotmail.com

      Comment by aacable — July 15, 2011 @ 7:41 AM

  13. add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-address:3/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-address:3/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-address:3/2 action=mark-connection new-connection-mark=WAN3_conn passthrough=yes

    I CANT UNDERSTAND ABOVE

    PLZ EXPLANE dst-address-type=!local

    WHATS MEANS >>>>>> !local <<<<<<<<<

    Comment by usman — July 10, 2011 @ 10:22 AM

    • As per Mikrotik Wiki explains:
      “The first line means “produce the output of the hash function given the packet’s source IP address and port, divide it by 3 and if the remainder is 0, perform the action of marking the connection as 1st_conn”. The second line means “produce the output of the hash function given the packet’s source IP address and port, divide it by 3 and if the remainder is 1, perform the action of marking the connection as 2nd_conn”. And correspondingly the third line means “produce the output of the hash function given the packet’s source IP address and port, divide it by 3 and if the remainder is 2, perform the action of marking the connection as 3rd_conn”.

      Read this link thoroughly and you will understand the voodoo ;)
      http://wiki.mikrotik.com/wiki/How_PCC_works_%28beginner%29

      Comment by aacable — July 10, 2011 @ 11:53 AM

  14. [admin@MikroTik] /ip firewall mangle> add chain=prerouting dst-address-type=!
    local in-interface=Local per-connection-classifier=src-addresses:3/2 action=mark
    -connection new-connection-mark=WAN3_conn passthrough=yes
    syntax error (line 1 column 42)

    Comment by usman — July 10, 2011 @ 10:24 AM

    • There was some mistake in the post. Please change src-address from per-connection-classifier=src-addresses TO

      per-connection-classifier=src-address:4/0 [or vise versa]

      Comment by aacable — July 10, 2011 @ 12:02 PM

      • Hey,
        I finally got my scripts all setup, and i started plugging them in to my 450g. (i reset config, and chose not to have the default start up script)
        Everything i had was accepted fine, but this portion is giving me a syntax error right at the “src-addresses” portion. I am looking at another 450g that has the same setup, and in winbox it has the Local per-connection-classifier set to “both” I did not set that up, so i dont know what it really means.

        Any tips?

        /ip firewall mangle

        add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-addresses:4/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
        add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-addresses:4/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
        add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-addresses:4/2 action=mark-connection new-connection-mark=WAN3_conn passthrough=yes
        add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-addresses:4/3 action=mark-connection new-connection-mark=WAN4_conn passthrough=yes

        Comment by sam — July 13, 2011 @ 10:17 PM

    • “/ip firewall mangle> add chain=prerouting dst-address-type=!
      local in-interface=Local per-connection-classifier=src-addresses:3/2 action=mark
      -connection new-connection-mark=WAN3_conn passthrough=yes
      syntax error (line 1 column 42)”

      There was some mistake in the post. Please change src-address from per-connection-classifier=src-addresses TO

      per-connection-classifier=src-address

      Comment by aacable — July 15, 2011 @ 8:27 AM

  15. dear sir i want share internet fron VPN so plz if u give me some script

    Comment by malik — July 13, 2011 @ 6:13 PM

  16. i used ur sripts very nice work very fine but it allow all users directly i want to allow internet by vpn

    Comment by malik — July 13, 2011 @ 6:16 PM

  17. l like this post but please can i have your contact number so i can contact you clear some of my questions

    Comment by owais — July 14, 2011 @ 7:12 AM

  18. dear sir pls give me some script i have 4 dsl line or ur contact

    Comment by malik — July 25, 2011 @ 8:27 PM

    • You can get the script in this post, just read it fully n will find what u r looking for.
      or contact me at aacable [at] hotmail.com

      Comment by Pinochio / zaib — July 26, 2011 @ 6:05 AM

  19. Nice work you doing zaib.
    i am new about mikrotik. i am using mikrotik router os (on pc) v.2.2.10 is it possible to make it 4xWan (dsl link bind or load balancing) and 1Xlan
    and what is pcc i dont know about it will you share link or abrevation of pcc

    Comment by waqas — July 29, 2011 @ 12:26 PM

  20. hi !
    Very nice article. I am trying to implement something similar but with a big difference. I don’t have multiple gateways. I have multiple dynamic ips given by my internet provider and I want my routerboard to “split” the traffic on these different interfaces (based on traffic type). To simplify let’s say that I have two wan interfaces wan1 and wan2 directly connected to internet with external ips and same gw (obtained thru dhcp). How could I adapt your script to load balance these two interfaces ?
    thanks in advance !

    Comment by ashmodai — August 8, 2011 @ 3:28 PM

  21. Thanks for your very quick answer ! but what about the pre routing ones ?
    add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
    Since I don’t have two subnets ?

    Comment by ashmodai — August 9, 2011 @ 11:07 AM

  22. oops sorry I am stupid :-) forget my question and thanks again !

    Comment by ashmodai — August 9, 2011 @ 11:15 AM

  23. Oups … it does work fine but I am facing a strange side effect. The fetch tool used for dyndns on my router does not return any result any more ?

    Comment by ashmodai — August 9, 2011 @ 2:29 PM

  24. Yes actually the script I use is very similar. It was working fine until I activate the second wan interface. It looks almost like since the connection is originating from the router itself it is not marked and therefore not routed anywhere. Possible ?

    Comment by ashmodai — August 9, 2011 @ 2:42 PM

  25. Actually to complement my message the part of the script having issue is the “fetch” command which is never returning any value if i have the two wan interfaces active

    Comment by ashmodai — August 10, 2011 @ 9:01 PM

  26. I made some trials yesterday and I can confirm that the issue is with the ip routing. Deleting the new routes solve the issue …

    Comment by ashmodai — August 11, 2011 @ 5:15 PM

  27. Great stuff! It works like a charm. Any idea what this will do to VPN services on the WAN1 side of things?

    Comment by Matthew Adam Byrd — August 17, 2011 @ 8:03 PM

    • Unable to understand what you meant by ‘VPN services on the WAN1 side of things?’
      Can you please describe more briefly.

      Comment by Pinochio / zaib — August 18, 2011 @ 10:55 AM

      • I’ve got the load balancing side working. Now I’m going to add PPTP/L2TP services to the WAN1 and WAN2 interface. Will the load balancing interfere with the PPTP/L2TP services?

        Comment by Matthew Adam Byrd — August 18, 2011 @ 5:16 PM

  28. I have never tested it in LB scenario. But I am sure it will work fine. Please test and share your experience :)

    However I personally not recommend to do so due to the load balancing inter-connectivity with the WAN interfaces.

    Comment by Pinochio / zaib — August 18, 2011 @ 6:24 PM

    • It doesn’t work with PPTP services… I’m still checking the Mikrotik forum for a workaround but so far no such luck.

      Comment by Matthew Adam Byrd — August 23, 2011 @ 1:32 AM

      • I may have just fixed the PPTP services with PCC… I created an address list and on the mangle rules I did a src-address-list=!pptpusers and dst-address-list=!pptpusers

        Comment by Matthew Adam Byrd — August 23, 2011 @ 1:51 AM

      • With your exclusion address list I get better results but mixed. I will need to test from an outside wifi since I don’t know if the issue is coming from my mobile network provider. Sounds promising ! Thanks for sharing !

        Comment by ashmodai — August 23, 2011 @ 2:25 AM

  29. I have the same issue. Since i implemented load balancing VPN is not working :-( if you find a solution please share it here ! Thanks !

    Comment by Asmodai — August 23, 2011 @ 1:38 AM

    • You may try Matthew Adam Byrd suggestion.

      Just create an address list and on the mangle rules exclude them , e.g src-address-list=!pptpusers and dst-address-list=!pptpusers

      Comment by Matthew Adam Byrd — August 23, 2011 @ 1:51 AM | Edit This

      Comment by Pinochio / zaib — August 23, 2011 @ 10:54 AM

  30. Thanks a lot to all ! I finally got it working but adding this exclude list AND add to it not only the pptp users dedicated addresses but also the two external wan ips … by the way this also solved my dyndns scripts that were not working either anymore since I implemented load balancing.

    Comment by ashmodai — August 24, 2011 @ 3:29 AM

  31. Looks like the cfg i’ve been using for over a year, nice to see the info on how to do it is now easier to find!!
    One thing I’m trying to figure out is how to do fail over, we’ve got a few DSL lines that you can ping up to the gateway, but after that, nothing gets out. and it seems after the line dies, we lose net access entirely off the Mikrotik 493AH unless we reboot the modem, or remove it from the PCC list. Have you come across a way to do that via script?

    Comment by Drew — August 30, 2011 @ 1:11 AM

    • Maybe this will help you.


      :local i 0; {:do {:set i ($i + 1)} while (($i < 3) && ([/ping 8.8.8.8 interval=2 routing-table=ISP1-Test count=3]<=1))};
      :local x 0; {:do {:set x ($x + 1)} while (($x < 3) && ([/ping 8.8.8.8 interval=2 routing-table=ISP1-Test count=3]<=1))};
      :local y 0; {:do {:set y ($y + 1)} while (($y < 3) && ([/ping 8.8.8.8 interval=2 routing-table=ISP1-Test count=3]=3 && $x>=3 && $y>=3) do={
      :log info "ISP1 Down";
      /ip address disable [find comment="ISP1 One-To-One NAT"];
      /ip address enable [find comment="ISP2 One-To-One NAT"];
      /ip firewall nat disable [find comment="ISP1 One-To-One NAT"];
      /ip firewall nat enable [find comment="ISP2 One-To-One NAT"];
      /ip route disable [find comment=ISP1];
      } else { :log info "ISP1 UP";
      /ip address enable [find comment="ISP1 One-To-One NAT"];
      /ip address disable [find comment="ISP2 One-To-One NAT"];
      /ip firewall nat enable [find comment="ISP1 One-To-One NAT"];
      /ip firewall nat disable [find comment="ISP2 One-To-One NAT"];
      /ip route enable [find comment=ISP1];
      }

      Also in order for this to work properly you need to disable the check-gateway function inside of “/ip routes”. The reason for this is because it will disable any of the same route if one of them has check-gateway enabled.

      Also read the following.
      http://forum.mikrotik.com/viewtopic.php?f=3&t=38023

      But personally I have never tested it or integrate it with pcc in any setup. If you find its working solution to integrate failover with pcc, do let me know :)

      Comment by Pinochio / zaib — August 30, 2011 @ 10:52 AM

  32. Sir,

    we have started cablenet & Hotspot service. currently we are using Mikrotik 3.20 ver with Wifi Card & Single NIC, i have 2 ISPs connected with Switch and used on tht single NetworkCard. one is on PPPOE Dialer another with Static IP.. i dont knwo howto utalize both links with single End User.

    Comment by Fast Net — September 2, 2011 @ 3:36 PM

    • 3.20 ?? I am sure it must be the cracked version :) I cannot really provide your any better support in this version.

      I suggest you to BUY the Licensed version which is 5.6 at a moment. Which have very nice load balancing method known as PCC (Per Connection Classifier) which can combine multiple WAN links at very best and with multiple methods available.

      Provide me some info first,
      Currently Are you doing any kind of load balancing using both links ? if yes, what method you are using ?

      Comment by Pinochio / zaib — September 2, 2011 @ 5:45 PM

      • Dear , we are currently using linux based indian software (and want to switch to MT). for this purpose i just shared the both connections to Hotspot and LAN users using mark-routing . we upgraded MT to 5.6 but wifi clients were having disconnection problem.

        Comment by Fast Net — September 4, 2011 @ 1:02 AM

  33. Hi,
    Is it possible with Mikrotik to load balancing fail over but checking not the gateway, but other ip behind the gateway. To be sure that there’s reachability after the gateway. Because the gateway can be reachable and that gateway itself don’t have reacheability and checking the gateway will always tell you that all is ok.
    You know like IP SLA on Cisco routers. Is it an script on MIKROTIK to check reachability behind the gateway?

    Germain

    Comment by Germain — September 15, 2011 @ 9:58 PM

    • I am not aware of the method,
      However it can be done by customized netwatch scripts that can work with PCC

      Comment by Pinochio~:) — October 10, 2011 @ 3:23 PM

  34. Salaam,
    Can you please upload/or send a link in which it shows the configuration of mikrotik pcc load balancing. Also which ips do i need to change in this configuration?

    Comment by Nouman Aziz — October 13, 2011 @ 4:42 AM

  35. http://aacable.wordpress.com/2011/06/04/mikrotik-4-wan-load-balance-pcc-complete-script-by-zaib/

    You have to change dsl modems ips to match with the examples given in this article. OR change the ips in the script as it suites you. Its easier to change the modem ips.

    Comment by Pinochio~:) — October 13, 2011 @ 10:36 AM

  36. So I just canage ip’s as below? Correct me if Im wrong

    192.168.1.2 = WAN1
    192.168.2.2 = WAN2
    192.168.3.2 = WAN3
    192.168.4.2 = WAN4

    Also I have configured it. But the loging page didn’t came on. So I typed in ip address, then loged into mikrotik but internet did not came on! Tell me what I might be doing wrong?

    Thank you

    Comment by Nouman Aziz — October 14, 2011 @ 12:57 PM

  37. What exactly “loggin page” is? This script does not create any hotspot type login page. This is just to load balance 4 wan links. This is fully tested in many networks and working good.

    Comment by Pinochio~:) — October 14, 2011 @ 2:00 PM

  38. sorry leave hotspot page. My mistake just answer first question.

    Do I just change modem ip’s to the listed above?

    Comment by Nouman Aziz — October 14, 2011 @ 4:28 PM

  39. I’m starting to think that 5.7 has broken the setup. I don’t seem to have fault tolerance anymore. Are any of you guys still using this with 5.7?

    Comment by Matthew Adam Byrd — October 20, 2011 @ 6:29 PM

  40. Hi, this is really nice but I have different case. My scenario is to use 2x WAN and 3x LAN (same network, DHCP Server on all three). When I come to lines with following “mangle” rules:

    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    ….. etc

    do I have to create all possibilities in my scenario because I have wan1, wan2, lan1, lan2 and lan3 interfaces? Should I enter something like following:

    add chain=prerouting dst-address-type=!local in-interface=lan1 per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=lan1 per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes

    add chain=prerouting dst-address-type=!local in-interface=lan2 per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=lan2 per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes

    add chain=prerouting dst-address-type=!local in-interface=lan3 per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=lan3 per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes

    Comment by Jovan P — October 21, 2011 @ 6:10 PM

    • I guess you have already been replied on the mikrotik forum, you have pasted the same thread in the forum too.

      Comment by Pinochio~:) — October 22, 2011 @ 2:35 PM

      • Yes, I found solution but I was waiting and was unpatient :) Thanks, anyhow!

        Comment by Jovan P — October 22, 2011 @ 5:06 PM

  41. I have router IP as
    192.168.8.254 WAN1
    192.168.6.254 WAN2
    And out Interface is 192.168.9.1 as out ip address.

    so where do i change address and how because i have changed your script but no internet out off mikrotik kindly help me because i don’t want to change router ip address .

    Naveed
    naveed.innocent@yahoo.com

    Comment by Naveed Akhter — October 24, 2011 @ 3:24 PM

    • Find along with attachment is Mikrotik PCC script, customized according to your requirement.
      It may work fine. If not please do some googling.

      /ip address
      add address=192.168.9.1/24 network=192.168.9.0 broadcast=192.168.9.255 interface=Local
      add address=192.168.8.254/24 network=192.168.8.0 broadcast=192.168.8.255 interface=WAN1
      add address=192.168.6.254/24 network=192.168.6.0 broadcast=192.168.6.255 interface=WAN2

      /ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000KiB max-udp-packet-size=512 servers=221.132.112.8,8.8.8.8

      /ip firewall mangle
      add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
      add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn

      add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
      add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2

      add chain=prerouting dst-address=192.168.8.0/24 action=accept in-interface=Local
      add chain=prerouting dst-address=192.168.6.0/24 action=accept in-interface=Local

      add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
      add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes

      add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
      add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2

      /ip route
      add dst-address=0.0.0.0/0 gateway=192.168.8.254 routing-mark=to_WAN1 check-gateway=ping
      add dst-address=0.0.0.0/0 gateway=192.168.6.254 routing-mark=to_WAN2 check-gateway=ping

      add dst-address=0.0.0.0/0 gateway=192.168.8.254 distance=1 check-gateway=ping
      add dst-address=0.0.0.0/0 gateway=192.168.6.254 distance=2 check-gateway=ping

      /ip firewall nat
      add chain=srcnat out-interface=WAN1 action=masquerade
      add chain=srcnat out-interface=WAN2 action=masquerade

      Comment by Pinochio~:) — October 25, 2011 @ 3:36 PM

      • It,s not working , when i write 192.168.6.254 to open modem through mozilla it opens configuration panel of mikrotik webconfig and also on 192.168.9.1 when i disconnect modem 192.168.6.254 form mikrotik it still pings it in terminal..kindly help..

        Comment by naveed akhter — November 4, 2011 @ 10:30 AM

      • There are few ways you can do it.

        if you use PCC than you know the result of PCC classifier in your mangle creates two different packet or connection markers. Each of these are than the source for two different policy routing rules.

        Now all you need to do is to make sure that the destination addresses of the two modem is not passed through the PCC process but get a dedicated set packer or connection marker which as result give them the proper routing mark and route to reach the right destination.

        So what you do is set a packet or connection marker rule BEFORE the PCC rules where traffic coming from (src address classifier) your PC and going TO (dst address classifier) (and for instance tcp protocol on port 80) get their own mark.
        Upon this manually assigned mark the traffic hits the designed routing marker rule and gets the desired route.

        Or just accept the traffic in those rules before PCC. That way the traffic is exempted from PCC and the normal routing table is used.

        The following solution will surely work for you I m sure.

        Create following rules and move the /ip firewall mangle TOP in the mangle rules, above all rules.

        /ip firewall address-list
        add list=exempt-from-pcc address=192.168.6.254/32
        /ip firewall mangle
        add chain=prerouting dst-address-list=exempt-from-pcc action=accept

        (make sure this rule is above all other rules.)

        Comment by Pinochio~:) — November 14, 2011 @ 10:53 AM

  42. Hello sir,….
    I have tried to apply this way, at 10 WAN but not run properly, about what obstacles I experienced? thank you

    Comment by Linambaran Faradha Qisthas — November 2, 2011 @ 3:01 AM

    • It depends on what rules you have added accordingly for 10 WAN.
      Email me your complete PCC script that you are using for 10 WAN and I will see what could be possibly wrong in it.

      Comment by Pinochio~:) — November 2, 2011 @ 10:49 AM

    • It depends on what rules you have added accordingly for 10 WAN.
      Email me your complete script and I will see what could be possibly wrong in it.

      Comment by Pinochio~:) — November 2, 2011 @ 10:50 AM

  43. if you allow and favor, I beg permission, to put this blog link on my blog, thanks

    Comment by Linambaran Faradha Qisthas — November 2, 2011 @ 3:07 AM

  44. I have posted on this forum,
    http://forum.mikrotik.com/viewtopic.php?f=2&t=56315
    please help me solve the problem. and thank for your allowing to put your blog link.
    warm regards

    HP Tio

    Comment by Linambaran Faradha Qisthas — November 2, 2011 @ 1:00 PM

  45. I have posted on the forum below
    http://forum.mikrotik.com/viewtopic.php?f=2&t=57001
    so Can any one help me
    thanks

    Comment by saly — November 27, 2011 @ 3:10 PM

    • What exactly is your requirement ?
      is load balancing not working ?
      or script not working ?

      Comment by Pinochio~:) — November 28, 2011 @ 11:07 AM

      • I deployed your script but I want Internet Download Manager to use both line wan1 and wan2 at the same time so download speed will be doubled.
        My current status is as much users browsing the loadbalance be better.
        In real I use this script in Internet Cafe so I want my customers see the speed in the internet download manager program increasing

        thanks a lot

        Comment by saly — November 28, 2011 @ 11:41 AM

      • Sir i have done loadbalancing using pcc method .my problem is when i plug second wan link …routerboard hanged .and hotsopt stop working ….my local ip is 172.16.0.1….wan 1 is 4 mb and wan 2 is 2 mb …..plz advise …

        Regards

        Comment by faisalmirzapk — April 10, 2012 @ 12:11 AM

      • I don’t understand why its hanging. have you configured the pcc rules accordingly to 2 wan? Also hotspot with pcc doesn’t work, you have to create addition rule for it.
        http://aacable.wordpress.com/2012/02/12/mikrotik-pcc-with-hotspot/

        Comment by Syed Jahanzaib / Pinochio~:) — April 10, 2012 @ 8:54 AM

      • yes sir i have configure pcc rules …my lan ip is 172.16.0.1/16 ? wan networks are : 192.168.1.0,192.168.2.0/24…?

        Comment by faisalmirzapk — April 10, 2012 @ 5:48 PM

      • Thanks …now working after adding rule.

        Comment by faisalmirzapk — April 12, 2012 @ 12:46 AM

  46. If you use per-connection-classifier = both-addresses-and-ports
    Then It will use all wan links and you will see speed increment in IDM downloads.

    Comment by Pinochio~:) — November 28, 2011 @ 3:51 PM

  47. This is the Best Site i ever Seen .. Thanks a Lot Bro.. you r the genious ……….

    Comment by Tanz — November 30, 2011 @ 1:21 AM

  48. Dear Bro can u pls teach us how to merge 12 hours(2 mbps only 21:00 to 8 AM) Bandwidth with 24 Hours 1 Mbps Load balance
    Like 15 ADSL 512k/1024k with 512k/2048 Bandwidth

    Comment by Tanz — November 30, 2011 @ 1:24 AM

  49. Dear Sir,

    I attached 750 with my system. I am getting follow error on 750 router board which I got from log file :

    Buffer memory
    Topics
    dhcp
    error
    Message dhcp-client on WAN1 failed to add IP address 192.168.1.2: already have such address (6)

    Kindly help me .

    Thank you.

    Muhammad Fawad

    Comment by Muhammad Fawad — December 1, 2011 @ 10:37 AM

  50. Hello Bro
    I used :
    per-connection-classifier=both-addresses-and-ports:2/0
    per-connection-classifier=both-addresses-and-ports:2/1
    As your script mentioned
    So can we alter this to obtain double speed in Internet Download Manager
    thanks a lot

    Comment by saly — December 1, 2011 @ 5:48 PM

  51. JAZAKALLAH bahi sahib …. Really thankful to u for this post but need some assistance please explain

    1). i have only 3 wan (4+4+2 mb) . Trying to modified. Is this Right WAN1 =4MB WAN2=4MB WAN3=2MB,,,,,, ;)
    /ip address
    add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
    add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1
    add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2
    add address=192.168.3.2/24 network=192.168.3.0 broadcast=192.168.3.255 interface=WAN3

    /ip firewall mangle
    add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
    add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn
    add chain=input in-interface=WAN3 action=mark-connection new-connection-mark=WAN3_conn

    add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
    add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
    add chain=output connection-mark=WAN3_conn action=mark-routing new-routing-mark=to_WAN3

    add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
    add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Local
    add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=Local

    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:5/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:5/1 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:5/2 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:5/3 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:5/4 action=mark-connection new-connection-mark=WAN3_conn passthrough=yes

    add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
    add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2
    add chain=prerouting connection-mark=WAN3_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN3

    /ip route
    add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=to_WAN3 check-gateway=ping

    add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping

    /ip firewall nat
    add chain=srcnat out-interface=WAN1 action=masquerade
    add chain=srcnat out-interface=WAN2 action=masquerade
    add chain=srcnat out-interface=WAN3 action=masquerade

    REGARDS
    WAQAS AHMAD

    Comment by WAQAS AHMAD — December 6, 2011 @ 7:07 PM

    • Seems fine to me :) Go ahead and test
      But remember, you can’t get 100% even result, but anything near even 60-70% will be considered fine.

      Comment by Pinochio~:) — December 7, 2011 @ 1:33 PM

    • sir lan merge script give me my email addr: nasir_rahman86@yahoo.com
      plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

      Comment by zeeshan — December 14, 2011 @ 10:05 AM

  52. Dear Jhanzaib Bhai

    Assalam O Allaykum

    muje 190 users run karne hai rb450g pe with pppoe (maximum active clients 80)
    aur 4mb ke 4 (4+4+4+4) line hai yani 16mb total
    aur per user 3pm-3am 512kbit aur 3am-3pm unlimited speed deni hai

    to mere liye load combiner compatible rahega ya load balance

    PLEASE TELL ME ????

    I AM WAITING ………………

    Comment by zohaib — December 7, 2011 @ 1:15 PM

    • Both will work fine.
      Mikrotik base Load balancer have added benefit that you can use src-address as classifier. using this technique you will be safe from broken links, broken download, streaming freezing etc which is very common in every load balancer. IF you want to get combined bandwidth from all Links, then use both-address-and-ports

      But again its up to you to test which method is best suited as per your network users habit. Its all about research and testing.

      Comment by Pinochio~:) — December 7, 2011 @ 1:30 PM

  53. This load balancing merge all link into 1 or not ?
    like if i have 4mb 4 dsl & when i download any file it show 16mb or not ?

    Comment by sunny — December 15, 2011 @ 12:40 PM

  54. Hi everyone, nice post! I want to use load balancing on mikrotik for two wans. But I wanted ask you a question before implement it:
    - The load balancing above described don’t make problem about voip connections and https website? Or it is possible say to mikrotik that all connections about voip and https must go out through only one wan?

    Thank you in advance!
    Gio

    Comment by Giovanni Piemontese — December 15, 2011 @ 3:32 PM

    • If you want to use VOIP / HTTPS , its better to use SRC_ADDRESS as your classifier.
      This way you wont be able to get combined bandwidth of both link but There will be no connection resetting / broken links problem.

      Or you can use traffic base routing and set your desired gateway for your makred traffic.,

      Comment by Pinochio~:) — December 15, 2011 @ 4:02 PM

      • Thank you for your quickly reply. I prefer get combined bandwith avoiding connection resetting / broken links problem. So I think that the second implementation is better but i need to understand too how to implement it. For setting desidered gateway for marked traffic (voip, https, streaming etc…), I have to do it in nat section or direclty in mangle rules? Can u make please a short example for me?

        Thank u very much for your time!

        Best Regards,
        gio

        Comment by Giovanni Piemontese — December 15, 2011 @ 4:23 PM

      • So you want to go with Traffic base routing. (Which I will recommend you because some services/apps requires dedicated connection) , Please read the following article which describes very well on howto classify traffic and route them to various links.

        http://wiki.mikrotik.com/wiki/Per-Traffic_Load_Balancing

        Comment by Pinochio~:) — December 16, 2011 @ 10:50 AM

  55. Yes it will merge /load balance all the WAN to give you combined bandwidth. (If you are using both-address-and-ports as your classifier as mentioned in this post)

    Comment by Pinochio~:) — December 15, 2011 @ 3:35 PM

  56. Hi, I need help, a make this script to my MK 5.7 but not working!
    My WAN lines are form dhcp servers form ISPs
    One of te routing add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping showed in blue color and not doing trafic!!

    Another problem that I have, I have question about DNS, two ISP- have diferent DNS, have can I balanc the DNS???

    Comment by Elhem — December 16, 2011 @ 10:36 PM

    • If a route is showing in blue color, it’s just inactive. Finger it.

      Regarding DNS, It’s not much important to use Both ISp’s DNS.
      Make sure your clients are using MIKROTIk as there primary dns server.
      On mikrotik server, use primary/secondary dns pointing to ISP-1 and ISP-2 respectively.

      Comment by Pinochio~:) — December 19, 2011 @ 10:49 AM

      • Zaib thanks man, I trying to change distance in my dynamic route but is inposible, I tryting to set 0 distance to my static ruote but is unaceptable!Any helpe please!

        Comment by Elhem — December 20, 2011 @ 3:56 AM

      • Hmm its strange. I told one of my friend to check this script at his setup (who is already using this script at his setup to load balance 4 wan links) and he informed me that it’s working fine.
        Do one thing , Simply reset all configuration, and re-configure it and check it again.

        One More Guess, Are you using any pppoe server on the same mikrotik?

        Comment by Pinochio~:) — December 20, 2011 @ 12:56 PM

      • Bro Zaib, Im not using any ppoe-server in my MK, I using two routers to get internet connection (IP dimaic) in my MK from two ISP, because if I use PPOE-Client I can not change the IP route (ISP gives it to by default).

        Comment by Elhem — December 20, 2011 @ 4:33 PM

    • Zaib is OK now, is working, reconfigure all script and now working, anytime I have some problems with http, and with Youtube, any solution??!

      Comment by Elhem — December 20, 2011 @ 9:39 PM

      • You have to try several classifier to sort out http/s+streaming breaking issue. Start with src-address
        using src-address, user will be stick to the specific link, his wan link will not be load balance, he will always use the same wan link at which PCC bind with it.

        Comment by Pinochio~:) — December 21, 2011 @ 10:47 AM

      • Zaib god bless you man, man like you are very special, I wish you a long and happy life! thanks for heping.If you can post any script (example) for this solution!?

        Comment by Elhem — December 22, 2011 @ 6:29 AM

      • unable to understand what solution you are asking?

        Comment by Pinochio~:) — December 22, 2011 @ 11:05 AM

      • Zaib I think about this:several classifier to sort out http/s+streaming breaking issue. Start with src-address, If you can post exaple (scrip). thnks

        Comment by Elhem — December 22, 2011 @ 12:40 PM

      • Just replace both-addressess-and-ports with src-address in all lines . Example.

        add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=src-address:4/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes

        Comment by Pinochio~:) — December 22, 2011 @ 12:52 PM

      • Yes Bro I make this change, but now when I test download bandwith, only one of two lines geting me speed (ps.10 mb) another line not doing nothing!

        Comment by Elhem — December 22, 2011 @ 4:34 PM

      • Zaib is OK now, I Just replace both-addressess-and-ports with src-address in all line and working soo good! THANKS MAN!

        Comment by Elhem — December 22, 2011 @ 9:06 PM

  57. http://img23.imageshack.us/img23/1725/39548980.jpg
    http://img40.imageshack.us/img40/3329/20102589.jpg
    http://img856.imageshack.us/img856/485/97630252.jpg

    Bro Zaib I upload the printscr, please take e look and see my problem, Im waiting for your help. pls….

    Comment by Elhem — December 17, 2011 @ 4:14 AM

    • Hi, I don’t know if this is normal or a problem of route configuration. I have the same situation and mikrotik routes all traffic on wan1. Can anyone help us?

      Thanks in advance.
      Gio

      Comment by Giovanni Piemontese — December 18, 2011 @ 7:34 PM

      • FOCUS on ‘distance’ value.
        The dynamic route has a distance of 0, and your static route has a distance of 1. The lower distance wins.
        Make all route’s distance same i.e 1.

        Comment by Pinochio~:) — December 19, 2011 @ 10:50 AM

      • Focus on DISTANCE value.
        The dynamic route has a distance of 0, and your static route has a distance of 1. The lower distance wins.
        Try to make ‘distance’ value 0 or 1 for all routes.

        Comment by Pinochio~:) — December 19, 2011 @ 10:51 AM

      • Hi, I have set all routes to distance 1 as you suggested but now all traffic use only wan2 and wan1 is blue become. Here a screenshoot of ip route on mikrotik:

        http://img843.imageshack.us/img843/9922/schermatakr.png

        Thanks in advance.

        Gio

        Comment by Giovanni Piemontese — December 19, 2011 @ 4:00 PM

      • Sir, can u help me please? As before all traffic of pppoe clients go out through only one wan (the active route). Why? Now all routes have the same distance but one reamain always blue. Thank u in advance.

        Comment by Giovanni Piemontese — December 19, 2011 @ 11:28 PM

      • If you have PPPoE Server on the Same mikrotik where PCC is also configured.
        Then use the following Link.
        http://aacable.wordpress.com/2011/08/29/mikrotik-4-wan-load-balancing-using-pcc-with-pppoe-server-complete-script/

        Comment by Pinochio~:) — December 20, 2011 @ 1:36 PM

      • Hi Sir, I have already followed this tutorial with pppoe server but it doesn’t work.. I have pppoe server with dhcp configured and then the rest is the same as this post/tutorial. So I don’t understand why one route remain always blue and traffic go out only one interface. There is a method so u can see my configuration?

        Thank u in advance.
        Gio

        Comment by Giovanni Piemontese — December 20, 2011 @ 3:21 PM

  58. Giovanni is not a normal, I think a problem is on OS 5.7, I waiting for Zaib help, hi is expert.

    Comment by Elhem — December 19, 2011 @ 4:10 AM

  59. Bro I can’t change it. I trying in my Ip route but, still showing 0 distance ip route of my ISP!?

    Comment by Elhem — December 20, 2011 @ 3:20 AM

  60. Thanks Alot bro your script work for me …………….. great job

    Comment by waqar hameed — January 2, 2012 @ 12:16 PM

  61. thank u so much bro….. Very Appreciated work … spread the knowledge

    Comment by Mobeen Ahmad — January 4, 2012 @ 2:07 PM

  62. good evening bro
    and assalamualaikum (if you moslem)
    your tutor is really great….
    but i have problem in loadbalancing PCC…
    i have try all PCC method..
    but when i change server for texas holdem poker…
    its always reconect…

    i use RB 750 with mt v5.11

    big thanks for helping bro…

    Comment by iamspailham — January 11, 2012 @ 2:15 PM

    • Wa Alaekum Assalam,

      Use src-address as your classifier. It will solve your problem.

      Or dedicate this web site ip to always go through dedicated wan link.

      Comment by Syed Jahanzaib / Pinochio~:) — January 11, 2012 @ 2:19 PM

  63. thanks for you reply….
    but it still reconect….
    i have use src-address..
    but stil reconect bro…

    i also use external proxy for caching
    this is my mangle

    [admin@MUTIARA.NET] > ip fi mangle pr
    Flags: X – disabled, I – invalid, D – dynamic
    0 ;;; PROXY-HIT
    chain=prerouting action=mark-packet new-packet-mark=PROXY-HIT
    passthrough=no dscp=12

    1 ;;; LOADBALANCING SPEEDY
    chain=input action=mark-connection new-connection-mark=internet1_conn
    passthrough=yes in-interface=modem-1-dial

    2 chain=input action=mark-connection new-connection-mark=internet2_conn
    passthrough=yes in-interface=modem-2-dial

    3 chain=output action=mark-routing new-routing-mark=to_internet1
    passthrough=yes connection-mark=internet1_conn

    4 chain=output action=mark-routing new-routing-mark=to_internet2
    passthrough=yes connection-mark=internet2_conn

    5 ;;; LOKAL
    chain=prerouting action=mark-connection new-connection-mark=lokal1_conn
    passthrough=yes protocol=tcp dst-address-type=!local in-interface=lokal
    dst-port=!80,81,8080,3128,21 per-connection-classifier=src-address:2/0

    6 chain=prerouting action=mark-connection new-connection-mark=lokal2_conn
    passthrough=yes protocol=tcp dst-address-type=!local in-interface=lokal
    dst-port=!80,81,8080,3128,21 per-connection-classifier=src-address:2/1

    7 chain=prerouting action=mark-routing new-routing-mark=lokal1_route
    passthrough=yes in-interface=lokal connection-mark=lokal1_conn

    8 chain=prerouting action=mark-routing new-routing-mark=lokal2_route
    passthrough=yes in-interface=lokal connection-mark=lokal2_conn

    9 ;;; PROXY
    chain=prerouting action=mark-connection new-connection-mark=proxy1_conn
    passthrough=yes protocol=tcp dst-address-type=!local in-interface=PROXY
    dst-port=80,81,8080,3128,21 per-connection-classifier=src-address:2/0

    10 chain=prerouting action=mark-connection new-connection-mark=proxy2_conn
    passthrough=yes protocol=tcp dst-address-type=!local in-interface=PROXY
    dst-port=80,81,8080,3128,21 per-connection-classifier=src-address:2/1

    11 chain=prerouting action=mark-routing new-routing-mark=proxy1_route
    passthrough=yes in-interface=PROXY connection-mark=proxy1_conn

    12 chain=prerouting action=mark-routing new-routing-mark=proxy2_route
    passthrough=yes in-interface=PROXY connection-mark=proxy2_conn

    and this is my route

    # DST-ADDRESS PREF-SRC GATEWAY DISTANCE
    0 A S ;;; PCC LOKAL
    0.0.0.0/0 modem-1-dial 1
    1 A S 0.0.0.0/0 modem-2-dial 1
    2 A S ;;; PCC PROXY
    0.0.0.0/0 modem-1-dial 1
    3 A S 0.0.0.0/0 modem-2-dial 1
    5 A S ;;; DEFAULT GATEWAY….
    0.0.0.0/0 modem-1-dial 1

    thank you my brother….

    Comment by iamspailham — January 11, 2012 @ 4:10 PM

  64. Assalaam o Alekom

    sir……i have a 4 dsl lines on birdge mode and i wan’t to connect mikrotik routerOS with pcc load balance.
    how to configure this senerio can you help me?

    Thanks!

    Comment by M,Salman — January 14, 2012 @ 4:25 AM

  65. salam sir

    sir plz mikrotik 3.30 per 4wan pcc load balancing with hotspot server ka script de dain shuktia

    Comment by noshad — January 15, 2012 @ 10:33 PM

    • Search the forums. Hotspots don’t work out of the box with PCC. Several threads contain workarounds. On the same box the workarounds are fairly complicated. The simplest option is to buy a RB750 or comparable router or add another mikrotik PC and use it for PCC, and to put the Hotspot server behind it

      However following is some working configuration posted by Fewi. You can modify it according to your need.

      http://forum.mikrotik.com/viewtopic.php?p=175525#p175525

      Comment by Syed Jahanzaib / Pinochio~:) — January 15, 2012 @ 11:10 PM

  66. Assalam o Alekom
    Thanks
    sir………they are working…..! but sir……that is pppoe-client failover senerio 1st down then 2nd up, i want to merge with pcc loadbalancing on bridge mode 4 adsl line.

    Comment by M,Salman — January 16, 2012 @ 5:28 AM

  67. sir ye mikrotik ki products pakistan me kahan se hasil ki ja sakti hain

    Comment by noshad — January 16, 2012 @ 10:00 AM

  68. Assalam o Alekom
    Thanks
    sir………they are working…..! but sir……that is pppoe-client failover senerio 1st down then 2nd up, i want to merge with pcc loadbalancing on bridge mode 4 adsl line.

    Comment by M,Salman — January 17, 2012 @ 3:46 AM

  69. Sir pcc load balancing aur hotspot server ke liya koon koon sa router board kharid loon

    Comment by noshad — January 17, 2012 @ 5:38 PM

  70. sir kia aik hi he kharidoon ya do le loon (hotspot with pcc load balancing)

    Comment by noshad — January 18, 2012 @ 11:39 AM

  71. sory sory sir likhna ye tha k

    hotspot server & pcc load balancing dono ke liye aik hi RB450 kafi ho ga ya do alag alag lene honge

    thanks

    Comment by noshad — January 18, 2012 @ 1:02 PM

  72. acha sir wireless pe pppoe aur hotspot dono me kia behtar he ya agar koi aur mashwara he to wo de dain

    thanks

    Comment by noshad — January 18, 2012 @ 1:16 PM

    • pppoe is much secure then hotspot.
      both services have there positive and negatives, however pppoe wins in many aspects, go for it.

      A HOTSPOT is way to provide internet access to subscribers by means of an easy to use login interface as it does not require any client software/driver/dialer at user end. To log in, users may use almost any web browser , so they are not required to install additional software.It is also possible to allow users to access some web pages without authentication using Walled Garden feature.

      In my personnel opinion, Hotspot is best suited for ad hoc situations, where you cannot control how the client has their machines configured. This is generally useful in Conference Rooms, Hotels, Cafe’s , Restaurants and likewise since people will come and go and you have few permanent users.

      One big advantage of using hotspot is that HotSpot does not require any client software/driver/dialer. One disadvantage of using HotSpot is that its usually requires your client to open up his browser to log in before he can use your service . So users wanting to connect to your service using a router or some kind usually have a problem (as routers usually don’t support logging in via HTTP).

      Comment by Syed Jahanzaib / Pinochio~:) — January 18, 2012 @ 5:39 PM

  73. sir aap ka ye aik bohat acha qadam he Allah aap ko jaza de

    Comment by noshad — January 18, 2012 @ 1:18 PM

  74. salam sir

    poochna ye tha ke hotspot server with pcc load balancing ke liye aik hi RB450 kafi ho ga ya do alag alag lene honge ?

    Comment by noshad — January 18, 2012 @ 9:50 PM

    • 1 RB450 is enough, Try it.
      Usually its not recommended to run both services (pcc+hotspot) on same router due to its complexity.
      However you can try it on single RB if you have some budget related issues.

      Comment by Syed Jahanzaib / Pinochio~:) — January 18, 2012 @ 11:16 PM

  75. SALAM SIR

    related with comment no 74

    so sir plz give me the script (hotspot with pcc)

    advice me can i try it on pc first

    i am already using ubnt bullet 2hp with 12dbi dlink omni and behind this i am using pcc with ppoe server on a single pc

    i observed when the number of connected clients exceeded more then almost ten the system not worked properly sending and receiving data become very low i think the bullet can handle only 25 or 25 ips at a time

    therefore i want to try hotspot server what is your opinion about that matter plz guide me

    thank u very much
    Allah hafiz

    Comment by noshad — January 19, 2012 @ 10:32 AM

    • Dear I have never tested or worked with PCC+HOTSPOT on same Mikrotik.
      It is not recommended to use hotspot and pcc on same mikrotik, BUT still you can make it work.

      there are few workarounds for it,

      Just add
      hotspot=auth
      in all pcc rules.

      Search the mikrotik forums and you will find few working scripts for it.

      Comment by Syed Jahanzaib / Pinochio~:) — January 19, 2012 @ 11:16 AM

  76. IN TAMAM KHUDA TARSIYOUN AUR MEHERBANIYOUN KA SHUKRIA

    Comment by noshad — January 19, 2012 @ 10:56 AM

  77. hello i use the script from first post and it works fine for outgoing connections.
    but portforward from wan1 to network cam port 80 in local net didn’t work (in connection table i see network-cam connections marked with to_wan3).
    when i forward from wan3 it works. how can i tell the pcc that incoming connections goes out through the same interface as they come in

    Comment by vectrum — January 20, 2012 @ 4:50 PM

    • no reply for me?

      Comment by vectrum — January 24, 2012 @ 1:54 AM

      • What was your question?
        I have to answers several threads per day, so its possible that Your thread left un-answered.
        Please post your query again.

        Comment by Syed Jahanzaib / Pinochio~:) — January 24, 2012 @ 11:26 AM

  78. Asslam-o-aikum, sir!
    Please correct the mistake bellow, i`m to much tried but fail.

    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes

    Thanks in advance

    Comment by smn4all — January 21, 2012 @ 9:45 PM

    • What’s the error you are getting

      Comment by Syed Jahanzaib / Pinochio~:) — January 22, 2012 @ 12:19 PM

      • per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes

        This one , when i past it into new terminal the it say “syntax error (line 1 column 42)” ( per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection )

        Comment by smn4all — January 22, 2012 @ 12:28 PM

  79. @ smn4all,

    You must Mikrotik version 3.30 or above.

    IF you are using older version, UPGRADE or buy licensed version.

    Comment by Syed Jahanzaib / Pinochio~:) — January 22, 2012 @ 5:26 PM

    • Sir!
      I`m using Mikrotik 3.9 version, but it is not working script .

      per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes

      This one , when i past it into new terminal the it say “syntax error (line 1 column 42)” ( per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection )

      Comment by smn4all — January 22, 2012 @ 7:00 PM

      • First learn howto copy paste rules in mikrotik. You must be aware of some basic while dealing with mikrotik.

        Try posting this line. This is complete one line.

        /ip firewall mangle add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes

        If it works, modify your rules

        Comment by Syed Jahanzaib / Pinochio~:) — January 23, 2012 @ 11:45 AM

  80. Asslam-o-alaikum, bhai! i`ve checked your given lines but it is not working again ERROR is
    ” bad argument name per-connection-classifier (line 1 column 85) “

    Comment by smn4all — January 23, 2012 @ 4:05 PM

    • Only two possibilities.

      1# You are using older version then 3.30
      2# You are not pasting rules correctly, try typing them and see at which exact wording its giving error , Then sort it out.

      # Also try to use some common logic’s.

      Comment by Syed Jahanzaib / Pinochio~:) — January 24, 2012 @ 11:16 AM

  81. my question again:

    i use the script from first post and it works fine for outgoing connections.
    but portforward/dstnat from wan1 to a network cam port or other devices in local net didn’t work smoothly (in connection table i see network-cam connections marked with to_wan3).
    when i forward from wan3 it works. how can i tell the pcc that incoming dstnat connections goes out through the same wan interface as they come in?

    Comment by vectrum — January 25, 2012 @ 4:46 AM

  82. salam bhai

    kia aisa ho sakta he k pcc loadbalancing server ka aik ya akik se ziada modem internet dena band kar dain lekin powered on hoon to mikrotik un ko request bhejna band kar de

    shukria

    Comment by noshad — January 29, 2012 @ 9:29 PM

  83. related with 82 (Yes its possible through some modified scripting integrated with the pcc.)

    salam

    to sir plz help kar dain

    Comment by noshad — January 30, 2012 @ 1:59 PM

  84. salam sir
    sir main ne 2 dsl lagaye hain load balancing ki script sahi tarah kam nahi kar rahi chalte chalte net ruk jati hai aur thori der bad khud chalna start ho jathi hai dono dsl main plz rep the solution

    Comment by umer — February 1, 2012 @ 8:38 AM

  85. as salaam alaikum

    4 DSL lines, but all load goes to only 1 DSL meri pass ye peroblam horahi hai iam new planes help me

    Comment by ALi — February 2, 2012 @ 12:19 AM

  86. thank for your response meri problem solv hogiy hai, one more question 4 MB ka 4 dsl combine speed deasakte hai
    aur ek bate is Script mine hotspot aad kia hai login page nahi show kereta dns name typ kerna perta hai, thanks

    Comment by ALi — February 3, 2012 @ 2:19 AM

    • you can combine as many wan links you like. just use the script with both-address-and-ports and it will combine the badnwidth.

      for hotspot with pcc, Just add
      hotspot=auth
      in all pcc rules.

      Comment by Syed Jahanzaib / Pinochio~:) — February 3, 2012 @ 6:54 PM

    • How you manage to solve “all loads goes to single WAN only” issue?

      Comment by Syed Jahanzaib / Pinochio~:) — February 3, 2012 @ 6:54 PM

  87. hello jahanzaib sir
    sir app na pcc load balancing ki script di usa ma na used ki magr us ma ak problem ai ha ka ak getaway add hua magr dusra nahi sir plz helo me

    Comment by shail2234 — February 3, 2012 @ 11:38 PM

    • reset all settings, and then configure it again, this time line by line,so that you can track at which point , the script is giving you error, note that error and fix it on appropriate section.

      Comment by Syed Jahanzaib / Pinochio~:) — February 4, 2012 @ 9:34 AM

  88. ma mikrotik 3.30 used kar raha with pppoe server

    Comment by shail2234 — February 3, 2012 @ 11:40 PM

  89. salaam Syed Jahanzaib
    i m from karachi.
    i want contact u to configure for my network plz contact
    my number +92-300-2496909
    thanx
    best regard
    shahbaz usman.

    Comment by shahbaz usman — February 4, 2012 @ 11:05 PM

  90. Asslam-o-laikum, bhai!
    Mikrotik 4 WAN Load Balancing using PCC method. Complete Script ! only work on MIkrotik 4.0 and above versions of mikrotik. Now please give me solution for mikrotik 3.xx versions
    Thanks

    Comment by smn4all — February 10, 2012 @ 1:18 PM

  91. Asslam-o-alaikum, bhai!
    Mikrotik 4 WAN Load Balancing using PCC method. Complete Script ! only work on MIkrotik 4.0 and above versions of mikrotik. Now please give me solution for mikrotik 3.xx versions
    Thanks

    Comment by smn4all — February 10, 2012 @ 1:20 PM

    • This works on Mikrotik 3.30 and above.
      So if you have 3.30 it can work fine. Its tested

      Comment by Syed Jahanzaib / Pinochio~:) — February 10, 2012 @ 2:59 PM

      • Bhai!
        Main ne bhot dafa test kia hai lakin ya mikrotik 4 plus version pe chalta hai 3.3 plus pe nai chalta …….

        Comment by smn4all — February 10, 2012 @ 3:47 PM

      • I won’t argue with you.
        But it do works with mirkotik ver 3.30 and above.
        3.30 (not 3.3)

        Comment by Syed Jahanzaib / Pinochio~:) — February 10, 2012 @ 4:45 PM

  92. asalam-o-alikum sir mare pass broadcast ho rahi ha ,
    To sir is ka kohi rule ha broadcast rokna ka
    plz sir help me

    Comment by shail2234 — February 12, 2012 @ 11:10 PM

  93. salaam \
    plz tell me and help me
    i am useing mikrotik 3.30 MY LOAD BALASING IS PCC BUT MY PROBLAM IS WEBPROXY IS NOT WORK WITH PPPOE SERVER
    JAB PROXY PAR LAGTA HOO TO NET DISABILE HO JATA HAI KIA KARO

    Comment by MANI — February 14, 2012 @ 12:42 PM

    • Web proxy usually don’t work with PCC. You have to create some extra rules in order to make it work.
      It’s more simpler if you add external proxy server along with mikrotik to make things simpler and more efficient and easy to troubleshoot.

      Comment by Syed Jahanzaib / Pinochio~:) — February 14, 2012 @ 7:03 PM

  94. Slam bhai!
    User-manager is working in Mikrotik 3.30, please give me any solution ….

    Comment by smn4all — February 14, 2012 @ 3:44 PM

  95. Slam bhai!
    User-manager is not working in Mikrotik 3.30, please give me any solution …

    Comment by smn4all — February 14, 2012 @ 3:45 PM

  96. Dear Sir,

    I am using RB750 for load balancing and x86 system for mikrotik hotspot. I am suing two PTCL DSL lines for load balancing. I am unable to access winbox via port forwarding. I have already sent you both scripts for guidance. Please help me in this regard.

    Thank you.

    Muhammad Fawad

    Comment by Muhammad Fawad — February 15, 2012 @ 10:24 AM

  97. Selam Zaib, I have one problem with dns, on my clients pc-s I have configured this dns primary 80.80.160.8 and sec 80.80.160.9!
    Now I change ISP and the dns of new ISP are 213.163.97.5 and 213.163.97.10 in my mikrotik I make this configuration:
    chain=dstnat action=dst-nat to-addresses=213.163.97.5 dst-address=80.80.160.8
    chain=dstnat action=dst-nat to-addresses=213.163.97.10 dst-address=80.80.160.9
    But I have problem with msn messenger, msn closed avery 3-4 minuts and open again!!
    I haved the same problem when I make the load balancin PCC the two diferent ISP not worked bicouse this was a problem MSN!!!
    Please any help bro?

    Comment by Ahmet — February 16, 2012 @ 3:01 AM

    • The first thing is Don’t provide public DNS server directly to your user,
      Use your mikrotik internal ip as there primary dns server. and in mikrotik DNS, use your ISP or standard DNS servers like google 8.8.8.8

      Second, You can forcefully route client DNS request to your mikrotik DNS server, this way no matter what dns server client have in there network settings, they will be routed to your mikrotik.

      maybe it can work for you

      http://forum.mikrotik.com/viewtopic.php?f=2&t=54300

      /ip firewall nat add protocol=udp dst-port=53 action=redirect to-ports=53
      /ip firewall nat add protocol=tcp dst-port=53 action=redirect to-ports=53

      Comment by Syed Jahanzaib / Pinochio~:) — February 16, 2012 @ 9:22 AM

  98. Aslam o alikum

    Bro. will this pcc script will result like this…

    1mbps + 1mbps + 1mbps + 1mbps = 4mbps internet connection downstream on single file over single client in LAN…

    or this will provide 4 files 1 mbps that is about ~128 kbps transfer rate…. as all normal routers do.

    i am basically have virtually privding internet to my firends and relitives in my area via W LAN

    about 40 users.

    will this combine bandwidht to single file or as normal tp-link load balancers do…

    provides 1 mbps speed max to single file …. 4 files can have benefit of 4 mb.

    sory for bad english as i am just 16 year old ….
    i hope i have eleborated my point well.
    thanks.

    Comment by Billy — February 18, 2012 @ 3:43 AM

    • PCC doesn’t combine bandwidth. Its possible only if MLPP or by any method your ISP allows/provide on some extra charge.

      PCC only load balance user request among multiple WAN Links.

      If you will using any IDM type application, a single client can use the whole bandwidth because of multiple HTTP request request fetched from multiple mirror downloads location.

      If a single client is download single file via normal browser , it will be using only one link.

      The more load you put on it, the better chances would be to get good load balancing.

      Its also depends on your classifier. Focus on it

      Comment by Syed Jahanzaib / Pinochio~:) — February 18, 2012 @ 12:53 PM

  99. You have done a really nice work by sharing a knowledge BUT dealing with Soooooo many reaplies its BRILLIANT :) Keep it up

    Comment by Sohail — February 19, 2012 @ 1:29 AM

  100. Dear sir,,

    how teo set contention ratio for user in mikrotik 5.8

    Comment by Muhammad kazim — February 20, 2012 @ 10:28 AM

  101. Dear sir,,
    how to set contention ratio for user in mikrotik 5.8

    Comment by Muhammad kazim — February 20, 2012 @ 10:29 AM

    • What you exactly meant by “contention ratio” ?

      Comment by Syed Jahanzaib / Pinochio~:) — February 20, 2012 @ 11:08 AM

      • dear sir

        I am working in isp at kabul.I am using Mikrotik 5.8.I ahve 5 interfaces.In each interface have different address connected with rocket M5 ubiquiti.I have some clients in CIR and some 1:2 to shared so what can i do in this sacuation.

        Comment by Muhammad kazim — February 20, 2012 @ 1:22 PM

      • You haven’t mentioned your query clearly. What’s the goal ?

        Comment by Syed Jahanzaib / Pinochio~:) — February 20, 2012 @ 2:14 PM

  102. salam jahanzaib bhai i need ur skype id so please tell me here my cell phone number is +92-332-2222-320 and i need ur help for load balancing

    Comment by Syed Muhammad Hamza Naushahi — February 20, 2012 @ 11:10 AM

  103. Thanks bro….
    all i wanted now is cracked makrotik version which can do PCC i have downloaded from your friend urdu tutorial but a got error bad package 0,0

    or error cddrive is crupted.

    can i have a link please.

    is there any system requirements ?

    all i want to do is PCC load balancing i have system with 1 Ghz process 8o GB baracoda HDD with 7200 rpm and 512Mhz RAM.

    with 1 built in lan on mmother borad and.

    5 pci LAN adapters.

    your help is precious.

    Comment by billy — February 21, 2012 @ 12:26 AM

  104. aslam o alikum i m back again with another problem…

    i have installed makrotik ROS 3.3 and cracked it with level 6 license..

    i have configured it as u have mentioned…

    but now i want to confugre its hotspot i have tried about 100 plus times …

    using winbox

    /ip hotspot

    added server on local interface with ip range 192.168.0.2/24 – 192.168.0.254/24

    dns server ip 192.168.0.1
    dns server name http://www.billynet.com

    added user admin with admin password

    but when user or client opens any webpage …..

    its not redirecting them to any page….

    only an error is displayed

    this page is not available…

    but when user types…

    192.168.0.1/login

    or

    http://www.billynet.com/login

    a login page is displayed.

    whereas 192.168.0.1 is ip of local interface and ip of dns server as defined in

    /ip dns

    dns server ip 192.168.0.1
    dns server name http://www.billynet.com

    please help me :(

    Comment by billy — February 23, 2012 @ 1:33 AM

    • IS you rmikrotik hotspot server properly connected to internet ? can you able to ping any web site from terminal ?
      make sure it is connected.

      From client end, open command prompt, and try to ping any web site
      like
      ping google.com
      Client must be able to resolve ip address of google.com , otherwise he will not be able to see the login page.

      Comment by Syed Jahanzaib / Pinochio~:) — February 23, 2012 @ 9:08 AM

  105. i have connected dsl router to wan 1

    dsl router ip 192.168.1.1

    when i directly connect to my dsl router net is working…

    but when i contect through local port of MT ROS.

    i cant access internet

    while pinging router gateway 192.168.0.1

    ping result is destination net unreachable

    while pinging google.com

    ping is blank

    and after manually opening hotspot login page and after providing login and user name.

    the ping result is as following

    ping 192.168.0.1 result <1ms

    and ping google.com

    ping is blank.

    any suggestion.

    when i am directly connected to my dsl router i can ping google as well as other website.

    Comment by billy — February 23, 2012 @ 1:52 PM

  106. when i ping via winbox

    tools ping option
    ping google.com

    is blank

    ping 8.8.8.8

    result is inbetween 280ms to 317ms

    i am confused :(

    will u please check my settings via teamviewer.

    please:(

    Comment by billy — February 23, 2012 @ 2:08 PM

  107. i just reinstalled and then cracked makrotik 3.3 with level 6

    then via console of makrotik i typed each and every command as it as same sequence and same parameters.

    i have re configured each and every bit of setting…. result is same.
    with gateway as
    192.168.0.1

    and dns as 192.168.0.1

    no browsing no download :(

    please help. :(

    Comment by billy — February 23, 2012 @ 10:37 PM

  108. Can i use this method + hotspot on RB750GL?
    i use the latest version 5.14
    it work without hotspot , there anything i can do?
    Thanks in advance.

    Comment by Ahmed Fathi — February 24, 2012 @ 8:22 AM

  109. hey does this work with hotspot cuz i tried the NTH way it worked but when i add the hotspot it dosn’t work .. ty

    Comment by Aladdin — February 24, 2012 @ 8:30 AM

  110. Hi,

    First off , awesome sharing of knowledge which is much appreciated.

    I’d like your thoughts on something I’m trying to do. I’m trying to load balance voip only over 2 adsl links, preferably each session going over a different adsl line, source ip is always the same, destination ip is always the same , just ports change per call.

    Any assistance is greatly appreciated

    Comment by Nitrious — February 25, 2012 @ 1:29 AM

  111. salam
    sir mujhe ppptp main 4 wan ki load balancing ki script chahiye for example 4 dsl jin ka gateway same hai

    Comment by umer — February 25, 2012 @ 3:28 PM

  112. Dear Jhanzaib,
    i am running mikrotik 5.11 hotspot but problem is that if customer use skype call then it disconnect after 5 to 10 mins.please help me

    Comment by mubashir — February 27, 2012 @ 5:01 PM

  113. hi i have RB1100 AH and i wanted to loadbalance 4xE1 lines is your scrip applicable? im not use to scrip can i configure this using webfig (User Interface). I want to activate ehter6 as LAN output and Ether7-10 as WAN input.

    Comment by Raymond — February 28, 2012 @ 11:34 AM

  114. hey,
    i have 3 adsl lines working together with the PCC but i would like to know if there any way i could make a Specific user uses only the data from wan3 for example not the 3 lines , im trying to do this so i don’t have ping conflicts while playing online games . thanks

    Comment by Aladdin — February 29, 2012 @ 3:19 AM

    • Create an address list, and exempt this list from pcc rules.
      Also then you can mark packets for specific address list, and then in route define route for these marked packets to go through your desired wan link.

      Comment by Syed Jahanzaib / Pinochio~:) — February 29, 2012 @ 12:05 PM

  115. Slam bhai! main 3wan loadblancing ke hai lakin wo kam he nai ker rahi main ne apki config post ker di hai plzzz help me to correct it ….

    /ip address
    add address=192.168.125.2/24 network=192.168.125.0 broadcast=192.168.125.255 interface=Local
    add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1
    add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2
    add address=192.168.3.2/24 network=192.168.3.0 broadcast=192.168.3.255 interface=WAN3

    /ip firewall mangle
    add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
    add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn
    add chain=input in-interface=WAN3 action=mark-connection new-connection-mark=WAN3_conn

    add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
    add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
    add chain=output connection-mark=WAN3_conn action=mark-routing new-routing-mark=to_WAN3

    add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
    add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Local
    add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=Local

    add chain=prerouting dst-address-type=!local hotspot=auth in-interface=Local per-connection-classifier=both-addresses-and-ports:3/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
    add chain=prerouting dst-address-type=!local hotspot=auth in-interface=Local per-connection-classifier=both-addresses-and-ports:3/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
    add chain=prerouting dst-address-type=!local hotspot=auth in-interface=Local per-connection-classifier=both-addresses-and-ports:3/2 action=mark-connection new-connection-mark=WAN3_conn passthrough=yes
    add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
    add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2
    add chain=prerouting connection-mark=WAN3_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN3

    /ip route
    add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=to_WAN3 check-gateway=ping

    add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping

    /ip firewall nat
    add chain=srcnat out-interface=WAN1 action=masquerade
    add chain=srcnat out-interface=WAN2 action=masquerade
    add chain=srcnat out-interface=WAN3 action=masquerade

    Comment by smn4all — March 3, 2012 @ 10:49 AM

  116. AOA sir i am running a small ISP. i have started HFS server. i want that all(512kb, 1mb, 2mb) clients get access to HFS server with unlimited speed.
    how can we do this. ?

    Comment by Suleman — March 6, 2012 @ 10:53 PM

  117. hi, i have a complecated network in my office. i have RB750 and PC mikrotik, can u give me suggest mikrotik setting. i’ll appreciate ur help !

    Comment by Ahmad Zulfa — March 15, 2012 @ 6:36 AM

  118. sir i have 2 Wan and 2 Lan i want that Wan1 route to Lan1 and Wan2 route to Lan2 plz sir post script

    Comment by Owais Malik — March 15, 2012 @ 8:42 PM

  119. Sir yay ptcl nay jo 300 gb bandwidth limit lagae hai, Is ka koi solution hai…

    Comment by Owais Malik — March 16, 2012 @ 7:08 PM

  120. sir licence kahan say purchase hota hai or yay kitnay ka hota hai

    Comment by Owais Malik — March 16, 2012 @ 7:09 PM

  121. Dear Sir,

    I hope that you will fine and ok.I want to further subnet my /28 public ip pool in mikrotik. I have five interfaces in mikrotik and i want subent into two /29 subnets.One pool is for
    my WAN and the 2nd pool to provide a customer.I shall be very thankful to you.

    Comment by Muhammad kazim — March 22, 2012 @ 3:03 PM

    • using a subnet calculator for instance, http://www.subnet-calculator.com/ you can divide your ip’s quite easily.

      for instance, RB750 using port 2 (wan) and 3-5(Cust). RB750G one can use 1(Wan) and 2-5(Cust).

      (RB750G example) Then depending on one’s setup, make 2 master, 3,4,5 slaves to port 2. Then setup dhcp to port 2 with clients /29. pretty much the default RB75X setup but with your IP’s not mikrotiks default ones. Perhaps even 1:1 nat can be added if needed, unlikely but an option.

      Then add the ips to port 1 as its /29 and your done. You’ll need to have a gateway, ie 10.2.0.1/29 then 10.2.0.2/29 will be port 1′s (wan) ip. mikrotik dns will also be your gateway IP. Dont forget to have nat with mascerading.

      Hope it helps, but as always, its what the customer wants and usually many ways to achieve the same goals.

      Lastly, awesome site, always enjoy the insights to be had here.

      Comment by Nitrious — March 23, 2012 @ 11:36 PM

      • Thaanks A lot sir

        Comment by muhammad kazim — March 24, 2012 @ 12:21 PM

  122. salam jahanzaib bhai,,i hope ap bil kul thek thak hon gay…jahanzaib bhai mujhy ap sy thoei help chaye thi..k mikrotik main VPN kis trha bna sktay hain ..main hotspot use kerta hn…kia vpn k liye static ip ka hna zaorori hai…?i mean how to creat vpn for monitring our network thrw winbox…

    Comment by ALi haider — March 26, 2012 @ 6:15 PM

    • Hmm actually you dont VPN just to monitor your Mikrotik BOX, you can use simple port forward rule for it, and Yes you will be needing static IP for it to connect remotely, (There is a service called DYNADNS but I dunt have any idea about it, in this service you dont need static ip, domain name will be binded with the link and you will connect to it using dns name)

      on the other hand, if you want to connect to your network from outside world to monitor the whole network, access any pc/server on your lan from outside world, then YES you will be needing VPN Server, which can be configured on Mikrotik.

      Comment by Syed Jahanzaib / Pinochio~:) — March 27, 2012 @ 10:37 PM

  123. i mean kisi b dsl sy hm jst apna vpn host name winbox y enter kerain aur winbox hmain hmare server pay lay jaye…plzzz help me i ll b very thnkfull to u…

    Comment by ALi haider — March 26, 2012 @ 6:17 PM

  124. Asalam o alikum

    Jahanzib bhai i am Najam from karachi,pakistan i am using MICROTIK RB750GL and i have 3 ADSL and i want to configure Router lan port in to load balancing can you help me somebuddy told me about script so what kind of script that and how to configure my email address is frankenstene@hotmail.com and my cell number is +92 321 2346 223 .

    Comment by Najam — March 27, 2012 @ 1:28 AM

    • The above script does the same that you want to achieve. Just read them thoroughly.

      Nobody will do it for you, You have to earn it

      Read, Read, Read , Practice, Practice and Practice , and you wins :)

      There is no elevator for success, you have to use Stairs , step by step :)

      Comment by Syed Jahanzaib / Pinochio~:) — March 27, 2012 @ 10:33 PM

  125. Hello,

    First, thank you for sharing such great info and tutorials!

    Next, I got a question regarding my scenario:

    I have three WANs where each of them has the same IP of 10.0.0.2 because until now I have been using them by connecting only WAN to the main switch physically, if that connection was down I just unplugged one CAT5 cable and plugged the other one, this is why all three WANs have same IP 10.0.0.2 (so I don’t need to reconfigure all computers IPs every time I unplug provider)

    What would be the necessary changes to your script if my addresses are the same? I can get up to here so far:

    add dst-address=0.0.0.0/0 gateway=10.0.0.2 routing-mark=to_WAN1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=10.0.0.2 routing-mark=to_WAN2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=10.0.0.2 routing-mark=to_WAN3 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=10.0.0.2 routing-mark=to_WAN4 check-gateway=ping

    Thanks for your help and your time…

    Comment by gereqi — March 27, 2012 @ 2:08 PM

  126. Thanks a lot
    it works for me
    I have used in a Vmware machine

    Comment by masud — March 29, 2012 @ 1:45 AM

  127. Greetings, I wonder my settings for the static routing + 4wan loadbalancing to two hotspot network, the result of the modifications you have the ‘right guns’ .. We are input, thank you
    Salam-Indonesia-Amirudin

    /ip firewall mangle
    add action=mark-connection chain=input comment=New_inbound_connection_wan connection-state=new disabled=no in-interface=vlan3-id101-wintel new-connection-mark=wan1_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=new disabled=no in-interface=wan2-speedy-3mb new-connection-mark=wan2_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=new disabled=no in-interface=wan3-speedy-2mb new-connection-mark=wan3_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=new disabled=no in-interface=wan4-speedy-2mb new-connection-mark=wan4_in_conn passthrough=yes

    add action=mark-connection chain=input comment=Established_inbound_connection_wan connection-state=established disabled=no in-interface=vlan3-id101-wintel new-connection-mark=wan1_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=established disabled=no in-interface=wan2-speedy-3mb new-connection-mark=wan2_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=established disabled=no in-interface=wan3-speedy-2mb new-connection-mark=wan3_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=established disabled=no in-interface=wan4-speedy-2mb new-connection-mark=wan4_in_conn passthrough=yes

    add action=mark-connection chain=input comment=Related_inbound_connection_wan connection-state=related disabled=no in-interface=vlan3-id101-wintel new-connection-mark=wan1_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=related disabled=no in-interface=wan2-speedy-3mb new-connection-mark=wan2_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=related disabled=no in-interface=wan3-speedy-2mb new-connection-mark=wan3_in_conn passthrough=yes
    add action=mark-connection chain=input connection-state=related disabled=no in-interface=wan4-speedy-2mb new-connection-mark=wan4_in_conn passthrough=yes

    add action=mark-routing chain=output comment=Mark-new-inbound-route-static-wan connection-mark=wan1_in_conn disabled=no new-routing-mark=static-wan1 passthrough=no
    add action=mark-routing chain=output connection-mark=wan2_in_conn disabled=no new-routing-mark=static-wan2 passthrough=no
    add action=mark-routing chain=output connection-mark=wan3_in_conn disabled=no new-routing-mark=static-wan3 passthrough=no
    add action=mark-routing chain=output connection-mark=wan4_in_conn disabled=no new-routing-mark=static-wan4 passthrough=no

    add action=mark-connection chain=prerouting comment=”Mark-traffic-that-isn’t-local-with-PCC-jamsostek” connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan1_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/0
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan1_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/1
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan2_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/2
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan3_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/3
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan4_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/4

    add action=mark-connection chain=prerouting comment=”Mark Established Traffic That Isn’t Local with PCC-jamsostek” connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan1_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/0
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan1_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/1
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan2_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/2
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan3_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/3
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan4_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/4

    add action=mark-connection chain=prerouting comment=”Mark related traffic thatisn’t local with PCC – Jamsostek” connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan1_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/0
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan1_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/1
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan2_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/2
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan3_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/3
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eoip-tunnel1-id100-Hotspot-Jamsostek new-connection-mark=wan4_pcc_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:4/4

    add action=mark-routing chain=prerouting comment=MarkroutingforPCCmark-option-JAMSOSTEK connection-mark=wan1_pcc_conn disabled=no new-routing-mark=wan1 passthrough=yes
    add action=mark-routing chain=prerouting connection-mark=wan2_pcc_conn disabled=no new-routing-mark=wan2 passthrough=yes
    add action=mark-routing chain=prerouting connection-mark=wan3_pcc_conn disabled=no new-routing-mark=wan3 passthrough=yes
    add action=mark-routing chain=prerouting connection-mark=wan4_pcc_conn disabled=no new-routing-mark=wan4 passthrough=yes

    add action=mark-connection chain=prerouting comment=”—-Mark-traffic-that-isn’t-local-with-PCC-mark-rand-(2-possibilities)-option-bida” connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan1_pcc_connA passthrough=yes per-connection-classifier=both-addresses-and-ports:4/0
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan1_pcc_connA passthrough=yes per-connection-classifier=both-addresses-and-ports:4/1
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan2_pcc_connB passthrough=yes per-connection-classifier=both-addresses-and-ports:4/2
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan3_pcc_connC passthrough=yes per-connection-classifier=both-addresses-and-ports:4/3
    add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan4_pcc_connD passthrough=yes per-connection-classifier=both-addresses-and-ports:4/4

    add action=mark-connection chain=prerouting comment=”MarkestablishedTrafficThatIsn’tLocalwithPCCmarkrand(2possibilities)-option-bida” connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan1_pcc_connA passthrough=yes per-connection-classifier=both-addresses-and-ports:4/0
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan1_pcc_connA passthrough=yes per-connection-classifier=both-addresses-and-ports:4/1
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan2_pcc_connB passthrough=yes per-connection-classifier=both-addresses-and-ports:4/2
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan3_pcc_connC passthrough=yes per-connection-classifier=both-addresses-and-ports:4/3
    add action=mark-connection chain=prerouting connection-state=established disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan4_pcc_connD passthrough=yes per-connection-classifier=both-addresses-and-ports:4/4

    add action=mark-connection chain=prerouting comment=”Markrelatedtrafficthatisn’tlocalwithPCCmarkrand(2possibilities)-option1″ connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan1_pcc_connA passthrough=yes per-connection-classifier=both-addresses-and-ports:4/0
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan1_pcc_connA passthrough=yes per-connection-classifier=both-addresses-and-ports:4/1
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan2_pcc_connB passthrough=yes per-connection-classifier=both-addresses-and-ports:4/2
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan3_pcc_connC passthrough=yes per-connection-classifier=both-addresses-and-ports:4/3
    add action=mark-connection chain=prerouting connection-state=related disabled=no dst-address-type=!local hotspot=auth in-interface=eth5.hotspot-bida new-connection-mark=wan4_pcc_connD passthrough=yes per-connection-classifier=both-addresses-and-ports:4/4

    add action=mark-routing chain=prerouting comment=MarkroutingforPCCmark-option-BIDA connection-mark=wan1_pcc_connA disabled=no new-routing-mark=wan1 passthrough=yes
    add action=mark-routing chain=prerouting connection-mark=wan2_pcc_connB disabled=no new-routing-mark=wan2 passthrough=yes
    add action=mark-routing chain=prerouting connection-mark=wan2_pcc_connC disabled=no new-routing-mark=wan2 passthrough=yes
    add action=mark-routing chain=prerouting connection-mark=wan2_pcc_connD disabled=no new-routing-mark=wan2 passthrough=yes

    /ip route
    add check-gateway=ping comment=StaticRoute-WAN disabled=no distance=1 dst-address=0.0.0.0/0 gateway=vlan3-id101-wintel routing-mark=static-wan1 scope=30 target-scope=10

    add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan2-speedy-3mb routing-mark=static-wan2 scope=30 target-scope=10
    add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan3-speedy-2mb routing-mark=static-wan3 scope=30 target-scope=10
    add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan4-speedy-2mb routing-mark=static-wan4 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=1 dst-address=0.0.0.0/0 gateway=vlan3-id101-wintel routing-mark=wan1 scope=30 target-scope=10

    add check-gateway=arp disabled=no distance=2 dst-address=0.0.0.0/0 gateway=wan2-speedy-3mb routing-mark=wan1 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=3 dst-address=0.0.0.0/0 gateway=wan3-speedy-2mb routing-mark=wan1 scope=30 target-scope=10
    add check-gateway=arp comment=WAN1-Distance1 disabled=no distance=4 dst-address=0.0.0.0/0 gateway=wan4-speedy-2mb routing-mark=wan1 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan2-speedy-3mb routing-mark=wan2 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=2 dst-address=0.0.0.0/0 gateway=vlan3-id101-wintel routing-mark=wan2 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=3 dst-address=0.0.0.0/0 gateway=wan3-speedy-2mb routing-mark=wan2 scope=30 target-scope=10
    add check-gateway=arp comment=WAN2-Distance1 disabled=no distance=4 dst-address=0.0.0.0/0 gateway=wan4-speedy-2mb routing-mark=wan2 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan3-speedy-2mb routing-mark=wan3 scope=30 target-scope=10
    add check-gateway=arp comment=WAN3-Distance1 disabled=no distance=2 dst-address=0.0.0.0/0 gateway=wan4-speedy-2mb routing-mark=wan3 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=3 dst-address=0.0.0.0/0 gateway=vlan3-id101-wintel routing-mark=wan3 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=4 dst-address=0.0.0.0/0 gateway=wan2-speedy-3mb routing-mark=wan3 scope=30 target-scope=10
    add check-gateway=arp comment=WAN4-Distance1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan4-speedy-2mb routing-mark=wan4 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=2 dst-address=0.0.0.0/0 gateway=vlan3-id101-wintel routing-mark=wan4 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=3 dst-address=0.0.0.0/0 gateway=wan2-speedy-3mb routing-mark=wan4 scope=30 target-scope=10
    add check-gateway=arp disabled=no distance=4 dst-address=0.0.0.0/0 gateway=wan3-speedy-2mb routing-mark=wan4 scope=30 target-scope=10
    add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan4-speedy-2mb routing-mark=link-youtube scope=30 target-scope=10

    add check-gateway=ping comment=”WAN3 link for the NEWS WEB” disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan3-speedy-2mb routing-mark=link-news scope=30 target-scope=10

    add disabled=no distance=120 dst-address=192.168.100.4/30 gateway=192.168.100.2 scope=30 target-scope=10

    add comment=”load balancing the DNS requests” disabled=no distance=10 dst-address=202.87.248.1/32 gateway=119.2.68.213 pref-src=119.2.68.214 scope=30 target-scope=10
    add disabled=no distance=10 dst-address=202.134.0.155/32 gateway=wan2-speedy-3mb,wan3-speedy-2mb,wan4-speedy-2mb scope=30 target-scope=10
    add disabled=no distance=10 dst-address=203.130.193.74/32 gateway=wan2-speedy-3mb,wan3-speedy-2mb,wan4-speedy-2mb scope=30 target-scope=10

    /ip route rule
    add action=lookup disabled=no routing-mark=wan3 table=wan3
    add action=lookup disabled=no routing-mark=wan4 table=wan4
    add action=lookup disabled=no dst-address=74.125.236.100/32 table=link-youtube
    add action=lookup disabled=no dst-address=74.125.236.105/32 table=link-youtube
    add action=lookup disabled=no dst-address=74.125.236.111/32 table=link-youtube
    add action=lookup disabled=no dst-address=202.134.0.0/16 table=link-youtube
    add action=lookup disabled=no dst-address=208.117.0.0/16 table=link-youtube
    add action=lookup disabled=no dst-address=208.65.0.0/16 table=link-youtube
    add action=lookup comment=kompas disabled=no dst-address=202.146.4.100/32 table=link-news
    add action=lookup comment=detik disabled=no dst-address=203.190.241.43/32 table=link-news
    add action=lookup comment=detik disabled=no dst-address=203.190.241.44/32 table=link-news
    add action=lookup comment=detik disabled=no dst-address=203.190.241.69/32 table=link-news
    add action=lookup comment=detik disabled=no dst-address=203.190.242.69/32 table=link-news
    add action=lookup comment=detik disabled=no dst-address=203.190.243.69/32 table=link-news

    Comment by amirudin — March 30, 2012 @ 10:50 PM

  128. Hallo ,Sellam Al.

    i have one problem on my rb with 2 isp provider, download working fine but upload maximum its 768 kb/s ,but i have this speed :

    Now where is problem .

    ISP1 WLAN1 —-20mb/s download ,, upload 768 kb/s ether1
    ISP2 WLAN2 —-50mb/s Download ,, upload 50mb/s ether2
    Local ether3

    Download the speedtest is ok 68-70 mb/s but the upload never goes more than 768 kb/s
    which is used to upload the ISP1.
    My configuration :

    /ip address
    add address=172.16.88.1/24 broadcast=172.16.88.255 comment=”" disabled=no interface=Local network=172.16.88.0
    add address=10.10.10.188/24 broadcast=10.10.10.255 comment=”" disabled=no interface=WAN2 network=10.10.10.0
    add address=10.0.20.105/24 broadcast=10.0.20.255 comment=”" disabled=no interface=WAN1 network=10.0.20.0

    admin@MikroTik] > ip firewall mangle print
    Flags: X – disabled, I – invalid, D – dynamic
    0 chain=input action=mark-connection new-connection-mark=WAN1_conn passthrough=yes in-interface=WAN1

    1 chain=input action=mark-connection new-connection-mark=WAN2_conn passthrough=yes in-interface=WAN2

    2 chain=output action=mark-routing new-routing-mark=to_WAN1 passthrough=yes connection-mark=WAN1_conn

    3 chain=output action=mark-routing new-routing-mark=to_WAN2 passthrough=yes connection-mark=WAN2_conn

    4 chain=prerouting action=accept dst-address=10.0.20.0/24 in-interface=Local

    5 chain=prerouting action=accept dst-address=10.10.10.0/24 in-interface=Local

    6 ;;; 2/0 PCC
    chain=prerouting action=mark-connection new-connection-mark=WAN1_conn passthrough=yes dst-address-type=!local in-interface=Local
    per-connection-classifier=both-addresses-and-ports:2/0

    7 ;;; 2/1 PCC
    chain=prerouting action=mark-connection new-connection-mark=WAN2_conn passthrough=yes dst-address-type=!local in-interface=Local
    per-connection-classifier=both-addresses-and-ports:2/1

    8 chain=prerouting action=mark-routing new-routing-mark=to_WAN1 passthrough=yes in-interface=Local connection-mark=WAN1_conn

    9 chain=prerouting action=mark-routing new-routing-mark=to_WAN2 passthrough=yes in-interface=Local connection-mark=WAN2_conn

    / ip route

    0 A S dst-address=0.0.0.0/0 gateway=10.0.20.1 gateway-status=10.0.20.1 reachable WAN1 check-gateway=ping distance=1 scope=30 target-scope=10 routing-mark=to_WAN1

    1 A S dst-address=0.0.0.0/0 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable WAN2 check-gateway=ping distance=1 scope=30 target-scope=10 routing-mark=to_WAN2

    2 A S dst-address=0.0.0.0/0 gateway=10.0.20.1 gateway-status=10.0.20.1 reachable WAN1 check-gateway=ping distance=1 scope=30 target-scope=10

    3 S dst-address=0.0.0.0/0 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable WAN2 check-gateway=ping distance=2 scope=30 target-scope=10

    4 ADC dst-address=10.0.20.0/24 pref-src=10.0.20.105 gateway=WAN1 gateway-status=WAN1 reachable distance=0 scope=10

    please help to finis my problem ..thanky

    / ip firewall nat

    0 chain=srcnat action=masquerade out-interface=WAN1

    1 chain=srcnat action=masquerade out-interface=WAN2

    5 ADC dst-address=10.10.10.0/24 pref-src=10.10.10.188 gateway=WAN2 gateway-status=WAN2 reachable distance=0 scope=10

    6 ADC dst-address=172.16.88.0/24 pref-src=172.16.88.1 gateway=Local gateway-status=Local reachable distance=0 scope=10

    Comment by askopz — April 8, 2012 @ 5:22 AM

    • please reply my problem thx. a.s

      Comment by askopz — April 14, 2012 @ 9:44 PM

    • please fix my probbb ….

      Comment by askopz — April 21, 2012 @ 6:56 AM

      • Mikrotik merge download speed only…… upload speed take from default DSL wan….

        Comment by smn4all — April 21, 2012 @ 1:16 PM

  129. Syed, u ar a genius

    Comment by JP — April 9, 2012 @ 5:12 PM

  130. sir i am using RB750 and using your given load balancing which works great when i m using with hotspot but when i m using PPPOE server then my user can only use wan 1 please help out.

    Comment by fizzi khan — April 14, 2012 @ 4:49 PM

    • Things are handled differently when it comes to PPPoE clients because pppoe client create there own interface on mikrtik after connected.
      You can use the following method (designed to work PCC with PPPoE client)

      http://aacable.wordpress.com/2011/08/29/mikrotik-4-wan-load-balancing-using-pcc-with-pppoe-server-complete-script/

      A quick search on Google , is the best way to dig thing quickly,

      Comment by Syed Jahanzaib / Pinochio~:) — April 14, 2012 @ 7:40 PM

      • ASSLAM O ALIKUM WAA RAHMATULLAH.

        Sir i have one more question abt RB750. Sir can we use this small mikrotik board for 200 users ? is it will work perfect including load balancing and pppoe and hotspot both users ? achully i m running both services at same time. your quick response is really appreciated.

        Comment by fizzi khan — April 14, 2012 @ 10:19 PM

  131. please you have any results for 2 isp , 2 isp both download one isp only upload

    Comment by askopz — April 14, 2012 @ 11:26 PM

  132. ASSLAM O ALIKUM

    jahanzaib sir i have applied mikrotik-4-wan-load-balancing-using-pcc-with-pppoe-server- PPPOE is working perfectly but now my hotspot on same device isn’t work first of all the client lan is not geting default gateway so hotspot page isn’t open please help me how i can edit or change some rules for hotspot ?

    Jaza kumula Khairan.

    Comment by fizzi khan — April 15, 2012 @ 2:10 AM

  133. Dear Bro. how can we use User Manager and manage users and their accounting on v3.3 with level4 license. if their some solution please tell me how can i do it.

    Comment by Junaid — April 16, 2012 @ 3:06 PM

  134. Assalamu alikum Bro Syed Jahanzaid. This is Nahid from Bangladesh. Thanks a lot for your sharing knowledge. Now I can marge bandwidth with mikrotik router. I have learn everything from your post. But now I am facing new problem. I have two Internet connection where Gateway are same Like : 192.168.3.1 another one also like this. So my load Blanching not working properly. What I should do in this situation. Please give me necessary advice. May Allah always keep you well…..

    Comment by GSB NAHID — April 19, 2012 @ 11:10 AM

    • You must have different Gateways for Proper load balancing.

      One workaround is to add any cheap router like tplink or any on one link, so you will get different gateway. For example

      Mikrotik PCC
      >> WAN1 ==> DSL1 >>> INTERNET
      >> WAN2 ==> Router >> DSL2 >> INTERNET

      This way your pcc will work.

      Comment by Syed Jahanzaib / Pinochio~:) — April 19, 2012 @ 1:02 PM

      • Hi,

        The way I did load balancing/aggregation with pcc was to simply put the adsl account on the adsl modem, and give each modem a different ip on a different subnet. Each of these is then put on their own ethernet on the mikrotik.

        It doesnt work for me if you use pppoe client on the mikrotik directly and the adsl modem in bridge mode.

        so the following works nicely (IPs included for example purposes, can also use /30 subnets)

        >>ETHER1 >> DSL1 >> INTERNET
        10.1.0.2/29 10.1.0.1/29
        >>ETHER2 >> DSL2>>INTERNET
        10.1.0.9/29 10.1.0.10/29

        Then 8.8.8.8 for DNS.

        Comment by Nitrious — April 21, 2012 @ 4:25 PM

      • Assalamu alikum Bro…Thanks a lot for your replay. Now my pcc working excellent.

        Comment by GSB NAHID — April 23, 2012 @ 9:28 AM

      • Assalamu alikum Syed Bro.. This is Nahid. I am facing a new problem in Mikrotik Queues. I am using ip 192.168.3.254 to 253>252 …..Like this for user. And using Simple Queues for user Bandwidth control individually like 512KBs or 256KBs . After ip 192.168.3.200 , I want to control all ip in one Queue like 265KBs. How i will make this queues. I am waiting for your replay..

        Comment by GSB NAHID — April 24, 2012 @ 9:26 AM

      • Use PCQ.
        Use the below method / logic and modify it as per your requirement.

        http://wiki.mikrotik.com/wiki/Cable_setup

        Comment by Syed Jahanzaib / Pinochio~:) — April 25, 2012 @ 10:59 AM

  135. Bro My main problem is…I am using Mac Binding and Static ip for users so that anyone cant get connection without my permission. But someone taking access without mac and using any ip after my Queue list and getting full Bandwidth speed. I can just watch him with Torch function. Please help me how can I stop his access.

    Comment by GSB NAHID — April 24, 2012 @ 9:52 AM

    • There must be some security weakness in your firewall.
      I recommend you to move on to pppoe base authentication and use ip less scenario.
      This way you will be saved from many problems and security weakness.

      Comment by Syed Jahanzaib / Pinochio~:) — April 25, 2012 @ 11:03 AM

  136. Hallo ,Sellam Al.
    i have one problem on my rb with 2 isp provider, download working fine but upload maximum its 768 kb/s ,but i have this speed :
    Now where is problem .
    ISP1 WLAN1 —-20mb/s download ,, upload 768 kb/s ether1
    ISP2 WLAN2 —-50mb/s Download ,, upload 50mb/s ether2
    Local ether3
    Download the speedtest is ok 68-70 mb/s but the upload never goes more than 768 kb/s
    which is used to upload the ISP1.
    My configuration :
    /ip address
    add address=172.16.88.1/24 broadcast=172.16.88.255 comment=”” disabled=no interface=Local network=172.16.88.0
    add address=10.10.10.188/24 broadcast=10.10.10.255 comment=”” disabled=no interface=WAN2 network=10.10.10.0
    add address=10.0.20.105/24 broadcast=10.0.20.255 comment=”” disabled=no interface=WAN1 network=10.0.20.0
    admin@MikroTik] > ip firewall mangle print
    Flags: X – disabled, I – invalid, D – dynamic
    0 chain=input action=mark-connection new-connection-mark=WAN1_conn passthrough=yes in-interface=WAN1
    1 chain=input action=mark-connection new-connection-mark=WAN2_conn passthrough=yes in-interface=WAN2
    2 chain=output action=mark-routing new-routing-mark=to_WAN1 passthrough=yes connection-mark=WAN1_conn
    3 chain=output action=mark-routing new-routing-mark=to_WAN2 passthrough=yes connection-mark=WAN2_conn
    4 chain=prerouting action=accept dst-address=10.0.20.0/24 in-interface=Local
    5 chain=prerouting action=accept dst-address=10.10.10.0/24 in-interface=Local
    6 ;;; 2/0 PCC
    chain=prerouting action=mark-connection new-connection-mark=WAN1_conn passthrough=yes dst-address-type=!local in-interface=Local
    per-connection-classifier=both-addresses-and-ports:2/0
    7 ;;; 2/1 PCC
    chain=prerouting action=mark-connection new-connection-mark=WAN2_conn passthrough=yes dst-address-type=!local in-interface=Local
    per-connection-classifier=both-addresses-and-ports:2/1
    8 chain=prerouting action=mark-routing new-routing-mark=to_WAN1 passthrough=yes in-interface=Local connection-mark=WAN1_conn
    9 chain=prerouting action=mark-routing new-routing-mark=to_WAN2 passthrough=yes in-interface=Local connection-mark=WAN2_conn
    / ip route
    0 A S dst-address=0.0.0.0/0 gateway=10.0.20.1 gateway-status=10.0.20.1 reachable WAN1 check-gateway=ping distance=1 scope=30 target-scope=10 routing-mark=to_WAN1
    1 A S dst-address=0.0.0.0/0 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable WAN2 check-gateway=ping distance=1 scope=30 target-scope=10 routing-mark=to_WAN2
    2 A S dst-address=0.0.0.0/0 gateway=10.0.20.1 gateway-status=10.0.20.1 reachable WAN1 check-gateway=ping distance=1 scope=30 target-scope=10
    3 S dst-address=0.0.0.0/0 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable WAN2 check-gateway=ping distance=2 scope=30 target-scope=10
    4 ADC dst-address=10.0.20.0/24 pref-src=10.0.20.105 gateway=WAN1 gateway-status=WAN1 reachable distance=0 scope=10
    please help to finis my problem ..thanky
    / ip firewall nat
    0 chain=srcnat action=masquerade out-interface=WAN1
    1 chain=srcnat action=masquerade out-interface=WAN2
    5 ADC dst-address=10.10.10.0/24 pref-src=10.10.10.188 gateway=WAN2 gateway-status=WAN2 reachable distance=0 scope=10
    6 ADC dst-address=172.16.88.0/24 pref-src=172.16.88.1 gateway=Local gateway-status=Local reachable distance=0 scope=10

    Comment by askopz — April 25, 2012 @ 2:11 PM

    • Brother! Mikrotik is not merge multi WAN upload speed . this only merge Download Speed. Understand it , don`t try more and more

      Comment by smn4all — April 25, 2012 @ 3:15 PM

  137. Dear Jahanzaib Bhai, My pcc with pppoe server is working fine with 2 WANS. I want to enable proxy as well what to do as pcc is not supporting the webproxy. Kindly guide with anyother solution if there it is
    thanks

    Comment by khalid Iqbal — April 27, 2012 @ 11:13 PM

    • Its better to use external proxy like squid or other, rather then fighting with Mikrotik’s internal web proxy to make it work.
      If you still want it, search the mikrotik forum, there are lot of posts regarding this issue and its solution.

      Comment by Syed Jahanzaib / Pinochio~:) — April 28, 2012 @ 4:19 PM

  138. Dear Syed Jahanzaib

    I have RB1100 and i want create Load balancer with 8 WAN input with pcc, and each bandwidth wan not same, please help me, thanks alot for your help

    Comment by yovi — April 28, 2012 @ 2:27 AM

  139. / ip address
    add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=LAN
    add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=ISP1
    add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=ISP2

    / ip firewall mangle
    add chain=prerouting dst-address=10.111.0.0/24 action=accept in-interface=LAN
    add chain=prerouting dst-address=10.112.0.0/24 action=accept in-interface=LAN
    add chain=prerouting in-interface=ISP1 connection-mark=no-mark action=mark-connection \
    new-connection-mark=ISP1_conn
    add chain=prerouting in-interface=ISP2 connection-mark=no-mark action=mark-connection \
    new-connection-mark=ISP2_conn
    add chain=prerouting in-interface=LAN connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=ISP1_conn
    add chain=prerouting in-interface=LAN connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=ISP2_conn
    add chain=prerouting connection-mark=ISP1_conn in-interface=LAN action=mark-routing \
    new-routing-mark=to_ISP1
    add chain=prerouting connection-mark=ISP2_conn in-interface=LAN action=mark-routing \
    new-routing-mark=to_ISP2
    add chain=output connection-mark=ISP1_conn action=mark-routing new-routing-mark=to_ISP1
    add chain=output connection-mark=ISP2_conn action=mark-routing new-routing-mark=to_ISP2

    / ip route
    add dst-address=0.0.0.0/0 gateway=10.111.0.1 routing-mark=to_ISP1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=10.112.0.1 routing-mark=to_ISP2 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=10.111.0.1 distance=1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=10.112.0.1 distance=2 check-gateway=ping

    / ip firewall nat
    add chain=srcnat out-interface=ISP1 action=masquerade
    add chain=srcnat out-interface=ISP2 action=masquerade

    salaam yaar yeh new pcc mikrotik ki load balasing yeh chal nahi rahi is main kia problam hai

    Comment by mani — May 8, 2012 @ 4:53 PM

  140. i need this router i have 8 line , all line adsl 20 mb but i get only 400 kb but when i use download excelator i get near about 2 mb download , can u help me and if i used 4 wan router its helpme or not. i am in ksa. how much cost mikrotik 4 wan load balancer.

    Comment by raja bazal aslam — May 11, 2012 @ 6:00 PM

  141. if i use rb750 for load balancing and rb750gl as a hotspot in front of rb750 then what would be the result ???? Good, better or best ?

    Comment by SHAFQAT FARHAN — May 14, 2012 @ 11:06 AM

  142. Salam sir
    sir mere pas 2 mb or 4 mb connection hy mje merging karni hy one lan speed double kiya ap mje configure kardegany ap ka bohat Shukar Guzar raho ga mje mikrotik bikul ni ata or mere pas machine dell 670 server hy sir ap
    thodi help kr dain thnx 4
    friendsalman@hotmail.com

    Comment by syed salman — May 14, 2012 @ 7:12 PM

  143. team viewer ky zariya or kb time de gain plz thnx 4

    Comment by syed salman — May 14, 2012 @ 7:13 PM

  144. mikrotik rb750gl kitne ki hai aaj kl ?

    Comment by ali zaib — May 16, 2012 @ 9:02 PM

  145. sir can you tell me how to crack mikrotik 4.17

    Comment by obaid — May 19, 2012 @ 6:53 PM

    • It is not possible to crack MT4.xx or above
      http://www.smn4all.tk

      Comment by smn4all — May 19, 2012 @ 6:55 PM

      • just pay for it, its not exactly huge amounts of cash, then you can update easily etc. Actually has anyone found an advantage of pc’s over say 1100ah ?

        Comment by Nitrious — May 20, 2012 @ 12:33 PM

      • 1100AH is an excellent piece of Mikrotik RouterOS. Once configured, you won’t have to worry about it.
        I have found it very good and stable , it’s also rack supported which makes it comparable with other vendors appliances.

        PC have one added advantage that you can increase its capacity in terms of storage and speed by adding more storage or processor/board.

        Comment by Syed Jahanzaib / Pinochio~:) — May 20, 2012 @ 8:14 PM


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 250 other followers