RouterOs 6.25: how to manage 2 different ADSL

Hi guys, this is my first post here, so hi to all!
I’m using for the first time a RouterBox with RouterOs 6.25.
This is the configuration that I have:
Port 1: WAN with PPoE connection
Port2: LAN with dhcp enable
Port3: 2nd WAN for ADSL (connected to an external modem).

Now my LAN uses the port 1 for the internet.
My goal is to configure the board in order to balance the traffic between the port 1 and 3 in order to have a better performance and to have one internet connection working in case one of them is down.

Honestly speaking I don’t know how to start…

Obviously I don’t want a step by step guide, but I need only some suggestions to start.

Thanks in advance!

Go for PCC configuration.

I have it running with multiple ADSL lines for almost 2 years now and is working great.

http://wiki.mikrotik.com/wiki/Manual:PCC

Hi Rudios,
thanks for the suggestion!
I’ll try it and I’ll come here in case of doubts or problems!

There is only a doubt.
I should have understood what PCC is and it basically marks the traffic dividing it in 2 different groups and for these groups 2 different routes exist.

I don’t understand what is the criteria to move the traffic from 1 adsl to another one.
In case of failure, I have option check ping, but when both are up and running, how it chooses the WAN to use?

Moreover, how to troubleshoot PCC?

Theoretical the traffic will be divided into two groups, marked with routing-mark.
These routing-marks will be used by the routing-table in order to route the traffic outside over 1 of the available ADSL lines.
I have PCC configured for 3 ADSL lines and I have 9 routing rules.
3 for each ADSL line, each with incrementing distance. If check-gateway=ping will be used each routing rule will be in-active if the gateway is not reachable, when a lower distance route will be inactive, the next routing rule will be used, so over a different gateway.

Can you make me an example of your routing rules?

This because I’ve followed the step by step configuration described in PCC wiki page but something is not working and I cannot reach internet…

Hello,

I’ve been reading the PCC example and though I could understand the basics and the functionality, I’ve became a bit curious about the complexity of the rules.

Firstly, couldn’t I change all those mangle rules to add routing marks directly on rules related to PCC, like this:

/ 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=LAN per-connection-classifier=both-addresses:2/0 \
    action=mark-routing new-routing-mark=to_ISP1
add chain=prerouting in-interface=LAN per-connection-classifier=both-addresses:2/1 \
    action=mark-routing new-routing-mark=to_ISP2

Why won’t it work ?

In the other hand, considering the configuration in the example, I don’t understand why there are rules on the output chaing to add routing marks after they have been already applied on the prerouting chain. I have some dificulties understanding the chains.

If someone could explain in more details, this case would greatly help me understand those stuff. The lines explaining the example are very general.

Thanks everyone in advance, for your great jobs, your kindness in helping people out and to be as beautifull as you all are.

marking each packet with a routing mark directly will probably work, but will require all packets to traverse the selection criteria. This takes more resources than first tag the connection and then, depending the connection mark with routing mark. On the other hand I guess it also to overcome the issue that a connection (session) to a certain destination is traversing over 2 different paths which could cause connection problems.

Regarding the rules on the output chain I have the same doubts as you have.
I have it fully running as desired when devices are connected behind the RouterBoard handling the PCC mechanism but I still haven’t found a proper way of handling connections from the RouterBoard itself.
The thing I found strange is that in case a packet is generated at the router, the first thing that will happen is routing-decision (seen on the flowchart). But if there are no routes without any routing-mark selection, there is no route available for that packet and it will vanish into nothing because there is no way to route it.
I would think that when a packet is created by the router it first traverses the prerouting chain which will let you mark the packet(s)

Hmm, I find it very hard to understand that traffic flow. When you say that all packets have to traverse the selection criteria, you mean that they would have to go through all the rules in mangle? Wouldn’t that be true in the example on wiki for PCC?

When I look to that chart of traffic flow, I can’t, for some reason, make much logic out of it.
I’ll have to find some more writen material about that on google, I think. Do you know of any good material to study?

I attended this presentation back in 2012, and it was a very good explanation for such things as this.

http://mum.mikrotik.com/presentations/US12/tomas.pdf

Thanks ZeroByte, that was helpful. I will also look for some more material to understand chains a little better, to understand the traffic flow in a more logical way.

I actually will come up with another scenario, for the same problem with 2 diferent lines, but this time, they use same remote ip address…

Let’s say I have 2 bridged modens connected to a routerboard, one on ether1 and other on ether2. Then I create 2 pppoe cliente interfaces, one for each interface. After pppoe client interfaces are configured and I connect the cabes to modens, both will connect to remote pppoe server, 2 routes will be created, one for each interface. The problem is, both pppoe cliente interfaces willl have the same remote ip address.

Is there a way to redirect traffic to a chosen pppoe cliente interface? So I can load balance the traffic as I would like?

Hi to all, I’ve configured the ROS in order to use PCC as it is described in PCC wiki page.

I’ve one problem, because it won’t work with ROS transparent proxy, but at this moment it is not important.

The most important is to understand what I’ve done.

I read the presentation linked above and I’ve not configured the traffic monitor.

So the first question is: it is required?
If I don’t configure it, what is the rule to switch between the 2 WANs?

The second question belongs the failover. I’ve tested if it is working unplugging the cable of a connection and it works. But, reading the pdf fo ZeroByte I understand that it is not a real failover. I mean, if the GW is reachable, but internet is not working because the connection between the GW and internet is broken the failover will not work.
Is it true?

If yes, should I change the routes with marks to an external ip (in example google) instead of the GW?

This is true. It means the gateway is reachable. It does not mean the gateway is not isolated from the Internet.
In stead of pinging the gateway, you do this:
static /32 route to test_site_1 via ISP1 default GW.
static /32 route to test_site_2 via ISP2 default GW.
ping tests to test_site_1 and test_site_2 should now be forced over ISP1 and ISP2. Make the default GW statements in your failover configuration use the TEST_SITE_X addresses and not default GW addresses.
Make sure that when ISP1 fails, that test-site-1 is NOT ABLE TO BE PINGED until ISP1 is restored.


For this, you can change the gateway= in your various default GW routes to be pppoe1 and pppoe2 (use the interface names). PPP sessions are not a broadcast medium, so it is perfectly valid to use them as next hop destinations.