fbpx

Does MikroTik allow you to have 2 providers without losing the connection?

Each router interface is independent, so you can have “N” numbers of providers on the router and they can be managed independently in such a way that redundancy can be established in providers or a balancer can be used to take advantage of everyone's bandwidth. the providers configured on the router.

MikroTik RouterOS allows you to configure multiple Internet Service Providers (ISPs) on a single device, allowing you not to lose your connection if one of the providers fails. This functionality is commonly known as “Failover” and “Load Balancing”.

Failover

Failover allows you to have a backup connection in case your primary Internet connection fails. With MikroTik, you can configure your two ISP connections in such a way that if the main one stops working, traffic automatically begins to pass through the second connection, thus ensuring continuity of Internet access.

Load balancing

Load balancing distributes network traffic between the two ISP connections according to defined rules, which can maximize the use of available network resources and improve redundancy. With this setup, both Internet links are actively used, and in the event that one fails, the other can take over all traffic, minimizing the possibility of a service interruption.

Basic Configuration for Failover

To configure a basic failover on RouterOS, you need to perform the following general steps:

  1. Define the Interfaces: Make sure that the network interfaces for both Internet Service Providers are correctly configured on your MikroTik device.
  2. Configure Static Routes: You must configure static routes in RouterOS for both ISPs, assigning a lower route distance to the primary connection and a higher distance to the backup connection.
  3. Configure Check Gateway: MikroTik RouterOS allows you to configure a check gateway for each route. This functionality verifies the availability of the Internet connection through each ISP. If the primary connection's check gateway fails, traffic is automatically redirected to the backup connection.

Additional Tools

RouterOS also provides advanced tools for managing multiple ISP connections, such as mangle rules to mark traffic and use routing policies based on those marks, and scripts to automate failure detection and recovery.

Security Considerations

When setting up multiple ISPs, it is crucial to pay attention to network security, ensuring that both connections are protected by appropriate firewalls and security policies to prevent unauthorized access and other security risks.

Configuring your MikroTik device to use multiple ISPs for failover and load balancing can be a technical process that requires careful planning and understanding of networks. It is recommended to consult the official MikroTik documentation and consider professional assistance if you are not familiar with these advanced settings.

There are no tags for this post.
Did this content help you?
Facebook
Twitter
LinkedIn
WhatsApp
Telegram

Other documents in this category

10 comments on “Does MikroTik allow you to have 2 providers without losing the connection?”

  1. I have 2 public ips configured on a mikrotik router, but only one goes outside, that is, I can only ping one from the outside

    1. Kevin Moran

      Dear Leonel,
      I assume that you have two internet providers and that your question is related to why you cannot reach the public of the second provider and you can only reach the public of the first provider. This happens because you only have a single default route which surely points to provider one, then when you want to ping the second public, the router, upon receiving this request, receives it through one and obviously that is not the gateway of provider two, so you cannot ping the public of the two providers, this is not wanted. To say that it does not work, you can do a basic test which would be to disable provider one and the secondary route that would be that of provider two will surely be activated so you will be able to see that the roles will be reversed, you will now see that it responds to the public of provider two and it does not the public of supplier one will respond. Well, although it is true that you cannot ping both publics, this does not mean that you cannot use your two providers, and that is why there is a load balancing process which will allow you to use your two providers and thus take advantage of the bandwidth from your two providers.

      Regards,

  2. Hello, good afternoon.
    I am new to Mikrotik. And I need to know how to configure two internet providers (I have the public ips of each one and their mask)
    Provider 1: 500mb dedicated per fiber (World)
    Provider 2: 100 dedicated wireless (Entel)
    And what I want is to configure the two providers to be used simultaneously, something like that, like saying: I want to use the 600MB in total, and for the officials not to notice the difference.
    And if one of the services goes down, and it is most likely that the one on fiber will go down. May the service that is wireless continue working without changes.
    I don't know if I knew how to explain myself well.

    I am currently with Mundo on Ethernet port 7, but I was not able to make Ethernet port 6 work with Entel.

    Greetings.

    1. Greetings Dear,
      In order to use both providers at the same time you have to use the configuration called Load Balancing, in MikroTik you have 3 options which are ECMP, PCC and NTH.
      The simplest is ECMP where you just have to create a default route and configure both gateways on the same route, for example:

      /ip route add dat-address=0.0.0.0/0 gateway=192.168.0.1,192.168.1.1 check-gateway=ping

      (where 192.168.0.1 is the first provider gateway and 192.168.1.1 is the second provider) as is your case you have 500MB in the provider provider and in the other 100MB you have to give higher priority to the first provider, leaving something like this.

      /ip route add dat-address=0.0.0.0/0 gateway=192.168.0.1,192.168.0.1,192.168.0.1,192.168.1.1 check-gateway=ping

      It is the simplest method of balancing, do not forget to configure the NAT rules for each provider. Balancing methods like PCC are more recommended for when handling a large traffic flow as in your case, only the configurations are more complex, so you have to use Mangle, NAT, recursive routes, etc, etc.

  3. Which of these alternatives is better in version 7 (since currently the most basic one is configured when one provider fails, the other does not browse, what do you recommend?

    1. Darwin Gabriel Barzola Abad

      Greetings dear,
      1. What I would recommend is to implement PCC Load Balancing in the event that you want to use both providers at the same time, in this case the network users would leave through any of the providers dynamically.

      2. Another option is that you can also create Mangle rules so that you can put certain network range going out to internet by one of the providers and other client network range by the other provider and have redundancy as well.

      Whether solution 1 or 2 you use always configure recursion for failover to work.

  4. good
    a query
    I have 2 internet providers and the service is through dhcp and both have the same dynamic IP range, how to ensure that there is no conflict in microtik when raising the wan?

    1. Mauro Escalante

      You can follow the following steps using advanced routing features and firewall settings.

      1. Interface Assignment
      First, make sure each Internet connection is connected to a separate interface on your MikroTik device.

      2. IP configuration
      Since both DHCP connections offer the same address range, you need to create two different routing tables for each WAN. This is done to avoid routing conflicts.

      3. Create Routing Marks
      Using route markings allows you to direct specific traffic through a particular routing table. You can configure this in the MikroTik with the following commands in the terminal:

      /ip route add dst-address=0.0.0.0/0 gateway=[GW-IP-WAN1] routing-mark=wan1
      /ip route add dst-address=0.0.0.0/0 gateway=[GW-IP-WAN2] routing-mark=wan2

      Where [GW-IP-WAN1] and [GW-IP-WAN2] are the default gateways for each WAN provided by DHCP.

      4. Mangle Rules Configuration
      To effectively use route marking, configure rules in the 'mangle' section of the firewall to mark packets based on their origin or some other criteria:

      /ip firewall mangle add action=mark-routing chain=prerouting in-interface=[WAN1-INTERFACE] new-routing-mark=wan1 passthrough=yes
      /ip firewall mangle add action=mark-routing chain=prerouting in-interface=[WAN2-INTERFACE] new-routing-mark=wan2 passthrough=yes

      5. Use of VRF (Virtual Routing and Forwarding)
      For more complete isolation, you can configure VRFs that allow routing tables to be completely independent of each other:

      /ip route vrf add routing-mark=wan1 interfaces=[WAN1-INTERFACE]
      /ip route vrf add routing-mark=wan2 interfaces=[WAN2-INTERFACE]

      6. NAT Settings
      Don't forget to configure NAT for each connection so that outgoing traffic can be correctly translated to the assigned public IP addresses:

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

      7. Testing and Monitoring
      After configuring everything, it is crucial to test the configuration to ensure that each WAN is handling traffic as expected. Use tools like traceroute and ping from the MikroTik or connected devices to verify correct routing.

      This setup helps handle two Internet connections from the same IP range without conflicts, using MikroTik's advanced routing capabilities.

  5. Hello, a question… I have two locations that are joined with mikrotik antennas but they are transparent everything is the same network to router 1 that you have a PCC balancing of 2 fiber wan…. They just installed fiber on point 2 as well, so I want to place a secondary router on point 2, but is there a way to connect that fiber to the main network as well?… I thought about connecting via Vlan to a third wan on router 1…. but I don't think it's efficient... what do you recommend I read or do?

    1. Darwin Gabriel Barzola Abad

      Regards,

      By placing a router at point 2, it will have to perform routing, so each point will now be independent. Through this PTP link from Point 1 to 2, you will be able to send clients from point 1 to go out to the Internet through point 2, creating routing and route markings. But to achieve this, you have to have the network well segmented such that each point 1 and 2 have their own distinct network segments so that you can apply routing.

Leave your comment

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

Tutorials available at MikroLABs

No Courses Found!

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

17%

all MikroTik OnLine courses

CW23-AX

30%

all Academy courses

CW23-LIB

25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

22%

all MikroTik OnLine courses

BF23-AX

35%

all Academy courses

BF23-LIB

30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011