MikroTik Tutorial 36 - Load balancing and failover with multiple gateways (2 WAN Links)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi in this tutorial I'm going to show you how to configure load balancing over multiple gateways the first thing we're going to do is to go to bridge unrig also going to I'm going to also open open interfaces because we are going to make changes in both areas all right so with the interfaces we are going to use Ethernet 1 and Ethernet 2 as or 1 interfaces so first thing is that ensure that you are connected to the last port of your router so I'm using are applied so i'm connected to port Ethernet for port 4 so try and connect to the last port because what happened during this configuration you lose connectivity and some other time depends depending on which port is configured first you you won't be able to get back in the rotor so always concentrate to connect to the last port and then configure from the top coming down so the first port that we are going to configure is Ethernet 3 and we're going to change Ethernet 3 the math support to say none then we're going to go into the bridge I'm going to put Ethernet 3 into the bridge then Ethernet for I'm going to set eternal for the mass support for Ethernet for to be Ethernet 3 so now each of the three is going to be the mass support fall on all the other ports click OK at this time that you will be disconnected because I'm connected to Ethernet for I'm so you can just give it a few seconds and then reconnect ok alright now I'm going to remove Ethernet 2 from the bridge and I'm now going to rename the interfaces I'm going to call this one the first one 1 1 and this is 1 - all right I'm going to go over to IP dhcp client and i'm going to configure the dhcp for each interface i'm going to remove this to say norm default wrote okay and i'm going to add a new interface which is one - I'm going to say no default wrote okay so now these are the two interfaces that we are going to use are the two gateways I can close this I cannot sleep again I'm going to leave that alright now we're going to go over to IP firewall and we're going to go for two manga I'm going to create some manga rules alright first one that we're going to create is going to set it the chain to pre route in the destination address so let me just put this over here so you can actually see what's happening here for reference you know the port's the interface is that I'm configuring so I'm configuring this would be Ethernet the first one interface and this is distant destination address is this and if the in interface is a bridge so in interfacial data bridge and the action is except fly then we're going to create another rule for the other interface like this so what I'm going to do is just copy this rule and I'm going to just change the destination IP address apply okay okay so I've created two two rules and add some more all right this rule is to mark the connections that are made through the interfaces so the interface would be the one double-o one the first one connection and the mark the pocket the connection mark would be no mark and the action we're going to create a new connection mark I'm going to call this one one underscore one for the first connection and then apply when you create a next one similar to this for for the second interface so far one two action just went to the stranger this so we have two rules so most things that we are going to do we are going to create two rules for each interface alright so there are two rules here for those interfaces going to add some more are this route this rule law is to just is to configure the the per connection classifier this will tell which interface the traffic is going over so the interface for this is the bridge connection mark none all right then we're going to go over to X arm advance and then the classifier the per connection classifier what I call PCC going to select both addresses and this one will put number two and then extra we're going to go to destination address I'm going to choose local and tick inverters in this rule will only work for traffic that is destinated that is not destined for the local network so this is what this this this rule is doing and then the action know is to mark the connection I'm going to mark this connection as the first one connection apply this copy this rule cuz we are going to create a next one and the only two things that we are going to change in extra Latin extra in advance we want to change this number to one to say the second interface and for the action when the mark the connection is one two and then okay okay all right weather some more rules to create this rule no is to mark is to put a marking on the road that the traffic is taken to the interface so this one will leave pre-wrote as the chain then the connection mark we're going to use the first one connection and in interface is a bridge and then we're going to add a mark but this time we're going to mark wrote in I'm going to call this 2 1 1 so this is all traffic going through to the first one interfere it's going to mark the road for that play just going to copy this rule again I'm going to make a change to for the second interface when the screen just is then okay so mostly edges as you else you may have noticed most of the things that we're doing know is really duplication for anything that we do for one into one of the interfaces we have to do it for the second interface all right so I've mark I've marked the road for that next one is that we're going to create another rule and this rule is going to be on the output chain and this is for traffic that is leaving at is leave in the rotor and we're going to mark this so the connection mark is for the first one connection and we're going to add action we're going to mark the road and the new road we're going to mark it with the same for the first one connection I'm going to copy this we're going to make a change to it I'm going to mark it for the second connection okay okay all right alright so we have finished creating the among the rules we are now going to create the masquerade we're going to add another masquerade are a source nut for the other interface so currently the default is for the first one connection and we're going to add another one so shortcut is just make a copy of the existing rule and change the interface the old interface to the second connection to the second one connection and click okay so we just duplicated this this rule all right we're going to go over to protein IP roads and we're going to create some roads so the first row that we're going to create is to first get to it so look um so the first get we is for the one first one connection and winter gateway check this ping so this will check to see if the Gateway is reachable and if it is dawn then it will choose to use that aguirre so that is all the load balance incoming where it is able to determine what another interface is up and use the other interface and all that based on latency and all of that so and then for the wrote in mark so we're going to look for traffic that as a particular mark and this is for the first one connection and we're going to apply that okay we're going to create a next one and this one would be for the second interface you want to check check the Gateway and also we're going to use the protein mark for that connection apply ok next we'll add another road and this one is destined for the first interface first one interference and going to check also but the distance you want to be one this distance is actually you can use this to determine your preferred wrote so the sort of one one is arm so the lower the number it's the more the rotor will prefer that wrote then other roads so you can play around with this - based on the speed of the connections you can adjust it far to use one wrote more than the other so grandly this put these two one okay and other next one I'm going to check this check this gateway and I'm going to use a distance of also one I said before you can change this number based on your needs alright so that we have just configured the load balancing over multiple kids we know we're going to do some tests and see all all the traffic flows over the connection are already you can see some traffic bounce into across both connections so I'm going to start up a a download and see can I get an appreciation or the traffic is um is used across both interfaces so right now it's using up the first interface more but you realize it it's locked to it in between the interfaces and realize it's using this interface more which is one one two the second one connection and the reason is is that this connection has a lower latency but the rotor will actually fluctuate between them so even so from 10 a time it will use both connections so you can see that rotor is no balancing the load across connections alright what I'm going to do I'm going to unplug one of the Ethernet cable for one of the interfaces so I'm going to unplug one of them no all right so I've unplug Ethernet - and you see in where the traffic is now going over this one interface I'm going to plug back that in and you see where the traffic start going over next one I'm going to plug out the next one no you see what happened so now the traffic is going over the next interface so you realize that the load balancing and failover is actually working so if you lose connectivity your your router will automatically switch over to the other interface so you won't lose connection so that is all your configure load balancing over multiple gateways hope you enjoy this video and please remember to give me a thumbs up and also if you haven't subscribed please remember to do so and if you have a comment please leave it and I will respond to you so thanks for watching you
Info
Channel: TKSJa
Views: 179,757
Rating: 4.9410429 out of 5
Keywords: Mikrotik, routeros, router os, router, wifi ap, network, network configuration, Mikrotic router configuration step by step, wifi configuration, mikrotik setup, routerboard, Winbox, routing, networking, security, ACL, CISCO network, WISP, QOS
Id: GeuuNE3EPBA
Channel Id: undefined
Length: 16min 18sec (978 seconds)
Published: Sat Jun 24 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.