I have a RouterBoard RB450G, with connections from two ISPs, one is an ADSL connection which uses PPPoE and the other is a cable connection which uses DHCP.
I have already configured the interfaces, ADSL modem is connected to ether1-wan1 and uses pppoe-out1 as the reachable interface. Cable modem connects to ether2-wan2 which is also the reachable interface.
All that works ok, and I can get internet access successfully from one connection or the other.
However I’ve been trying to set up load balancing as per the tutorial in the MikroTik wiki (http://wiki.mikrotik.com/wiki/Per-Traffic_Load_Balancing). I’ve been messing around with it for weeks and am still unable to get it to work. As soon as I add the routing rules everything goes dead, no applications can access the internet at all. It’s not a DNS issue.
Ideally what I’d like to do is this:
-server at 192.168.1.150 TCP ports 27080-27149 forwarded and going through cable (ether2-wan2), all other traffic through ADSL (pppoe-out1)
-all other computers TCP ports 80, 21, 22, 27014-27050 through cable, everything else through ADSL
-automatic failover in the event either connection goes down, all traffic pushed down the connection that is still up
How would I go about setting this up to work correctly and effectively? Any help greatly appreciated.
Here are the relevant configurations. Just for testing purposes thus far I only added two mangle rules. I can see that traffic is being marked correctly, however as soon as I enable the associated route, complete loss of connectivity occurs for any traffic that is marked for that route.
I must be doing something wrong here but I can’t figure out what.
1.) You’re marking routing without marking connections. It may be doable that way, but I think you’re probably asking for problems.
2.) You don’t have any routes that don’t have a routing mark, so if nothing gets a routing mark, it’s not going to be able to route anything out to the internet. You’re going to want a route for each ISP without any routing mark listed to cover fail-over situations.
How would I do it the other way? I just followed what the wiki said to do.
2.) You don’t have any routes that don’t have a routing mark, so if nothing gets a routing mark, it’s not going to be able to route anything out to the internet. You’re going to want a route for each ISP without any routing mark listed to cover fail-over situations.
There are the default routes for each of the gateways/wan interfaces, which are not shown in the configuration dump since they are automatically added by “add-default-route=yes”.
if you set gateway=ether2-wan2, it means that the whole internet is directly on that port, and not beyond some gateway. you should specify here IP address of gateway obtained via DHCP
Not totally sure what you mean by that. That port is connected to the cable modem which is just a modem. Unless you mean the ISP’s gateway/network is beyond that?
Aside from the load balancing routes, everything else works with gateway=ether2-wan2 and gateway=pppoe-out1.
And I can’t set that to an IP address anyways as it is dynamic.
I can have traffic on either one (by enabling/disabling the default routes so only one is active), but not both (one always takes precedence over the other when I enable both, but that is probably expected behavior).
The problem comes when I enable the following (notice they are disabled right now):
If I enable the route for routing-mark=“steam download”, then all steam download traffic fails.
If I enable the route for routing-mark=“other traffic”, everything but steam download traffic fails to work (assuming the steam download route is disabled).
Both enabled, nothing comes through to the internet.