Issue with Load Balancing

Hello! I’m not sure if this is the right place for this, but I have many questions.

So there’s a vendor I work with who evidently takes a MikroTik CRS326-24G-2S+RM and loads “custom firmware” to it. As a result, I’ve been told that the router can no longer load balance between two separate modems which share a Gateway IP address, even though they’re connected to two separate interfaces on the router.

The questions I’ll open with:

1.) Does the CRS326-24G-2S+RM Router possess the functionality to load balance between two modems that share a Gateway IP address? I read a forum post about specifying the Gateway by interface instead of IP, so I know that it’s possible in some MikroTik devices.
2.) If so, could a firmware change really remove/disable this functionality?
3.) If so, what reason would there be to remove this particular functionality? (Security? Bandwidth issue? Legitimately, just what kinds of problems could this functionality present?)

Really any information that could be provided would be intensely helpful. This vendor is insisting that they absolutely cannot have duplicate gateway IP addresses, and are requesting that we have the carrier change one of the modems to a different Gateway IP which I’m not even sure is possible.

  1. RouterOS has the same functionality on all devices (with just small exceptions, e.g. depending on HW features like switch model). And yes, two gateways with same IP address are possible (not the best setup to have, but it can work).
  2. If it’s really different firmware, it might be able to control usb connected coffee maker (if such thing exists) and not have half of feature that RouterOS has. In other words, anything is possible.
  3. Only your vendor knows. And “remove this functionality” might be wrong. They couldn’t start from RouterOS, because as far as I know, MikroTik does not share the source with anyone. And if they started with something completely different, perhaps it never had this functionality.

Wonderful!

Thank you for your response! Further question, what makes load balancing two modems with the same gateway worse than two different gateways?

It’s not like it would be really worse, either for performance or in a way that it wouldn’t allow you to do something. At least I can’t think about anything from top of my head. Anyone feel free to correct me.

But it’s a little unusual, because you’ll have overlapping subnets on your router. That’s generally bad thing, because it can be confusing for both router and user. But in this case, when you put each default route in different routing table and give hints to packets which one to use… I can’t think of any major downside.

It will be a little harder to access each modem’s configuration interface, because router will by default not know which one you want. But it’s nothing a few mangle/NAT rules couldn’t cure.

You can load balance not only between two ISP with diffrent Gateway IP address,but also with “interface".
Just like:
24 A S dst-address=0.0.0.0/0 gateway=pppoe-out2 gateway-status=pppoe-out2 reachable distance=2 scope=30 target-scope=10 routing-mark=200

PPPoE is special case, because it doesn’t care about gateway address. But it’s also possible to use gateway on specific interface with gateway=% (e.g. gateway=192.168.1.1%ether1 for one WAN and gateway=192.168.1.1%ether2 for another).

Thank you all for your replies!

The frustrating part for me is that our vendor is putting their foot down and saying that load-balancing between two identical gateways is impossible. They say “you are making invalid assumptions about our firmware”.

I asked this question to a colleague but I feel like I should ask here. Could different firmware on a MikroTik router change what kind of scripting the hardware accepts as a config? Or is there a more hard-coded (or software) section of the device that houses that information? I’ve browsed a bit on this site, I’ve seen configs that a few folks have for their MikroTik routers, and I’ve seen configs that our vendor uses on theirs. The language appears to be identical. For example, the main settings portion of the config is still called the ‘mangle’.

What exactly you know about this firmware?

See, first you have a hardware, it’s like when you buy a PC, except MikroTik has custom made devices and it’s different architecture than usual PC. Then there’s what MikroTik call firmware, and PC’s equivalent of that would be BIOS/UEFI. Most likely that’s not what your vendor touched.

Then there’s RouterOS, MikroTik’s default operating system for RouterBoards. It’s like Windows, Linux, *BSD, etc. on PC, there can be many different ones made by different people. It’s possible that your vendor replaced RouterOS by their custom operating system and call it firmware (it’s probably ok, no need for nitpicking). It’s what I assumed, and the answer still stands - anything is possible in this case.

Another possibility would be that they kept RouterOS and just prepared some complex configuration, or some template system that generates it. And simply didn’t prepare it for your requested scenario and don’t want to change it, because it would conflict with something else, it’s too much work, anything really.

This is all speculations, just some possibilies, because I haven’t seen the device. If you have more info, share it, maybe it will help.

Unfortunately, I don’t have access to one of their devices. If I did, I likely wouldn’t have had to post this thread as I could do testing with one of my colleagues to determine whether their equipment supports the load-balancing I referred to.

I do have a config dump from one of the units we have at one of the properties we manage, but I’m not sure if that would be of any value.

It should answer the question if it’s RouterOS or something else. If it’s in readable format (not some binary backup, which could contain something you don’t want to post publicly), you may try posting a sample.

This is an example from a site where Comcast is the provider. We have two modems onsite, one which is configured with 5 Static IPs and the other which is configured for DHCP., and they’re providing 50Mbps each. I’ve censored the IPs, but WAN1 is the static and WAN2 is the dynamic.

/ip firewall mangle
add action=mark-connection chain=prerouting comment="Tag WAN1 Inbound" in-interface="WAN1 Bridge" new-connection-mark=WAN1-INBOUND passthrough=no src-address-list=!PUBLIC-POOL
add action=mark-connection chain=prerouting comment="Tag WAN2 Inbound" in-interface=ether2 new-connection-mark=WAN2-INBOUND passthrough=no
add action=mark-connection chain=prerouting comment="Tag WAN1 IP Passthru" new-connection-mark=WAN1-PASSTHRU src-address-list=PUBLIC-POOL
add action=jump chain=prerouting comment=TRACKWAN1 connection-mark=WAN1-PASSTHRU jump-target=PASS-THRU
add action=jump chain=prerouting comment=TRACKWAN1 jump-target=NO-LB-PROTOCOLS-PORTS
add action=jump chain=prerouting comment="JUMP TO LOAD BALANCER" jump-target=MARK-LB
add action=jump chain=prerouting comment="JUMP TO MARK ROUTING" jump-target=MARK-ROUTING
add action=jump chain=PASS-THRU comment="NO LOAD SOURCES" jump-target=PIN-WAN1 src-address-list=NO-LOAD-BALANCE-SOURCES
add action=jump chain=PASS-THRU comment="NO LOAD DESTINATIONS" dst-address-list=NO-LOADBALANCE-DESTINATIONS jump-target=PIN-WAN1
add action=mark-connection chain=PASS-THRU connection-mark=WAN1-PASSTHRU new-connection-mark=no-mark
add action=return chain=PASS-THRU
add action=mark-connection chain=PIN-WAN1 new-connection-mark=WAN1-NOLOAD
add action=mark-routing chain=PIN-WAN1 new-routing-mark=WAN1 passthrough=no
add action=mark-connection chain=MARK-LB new-connection-mark=WAN1-LOADBALANCE per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-connection chain=MARK-LB new-connection-mark=WAN2-LOADBALANCE per-connection-classifier=both-addresses-and-ports:2/1
add action=return chain=MARK-LB
add action=mark-routing chain=MARK-ROUTING comment=TRACKWAN1 connection-mark=WAN1-LOADBALANCE new-routing-mark=WAN1 passthrough=no
add action=mark-routing chain=MARK-ROUTING comment=TRACKWAN2 connection-mark=WAN2-LOADBALANCE new-routing-mark=WAN2 passthrough=no
add action=return chain=MARK-ROUTING
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=443 jump-target=PIN-WAN1 protocol=tcp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=20 jump-target=PIN-WAN1 protocol=tcp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=21 jump-target=PIN-WAN1 protocol=tcp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=22 jump-target=PIN-WAN1 protocol=tcp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=8889 jump-target=PIN-WAN1 protocol=tcp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=4500 jump-target=PIN-WAN1 protocol=udp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=8080 jump-target=PIN-WAN1 protocol=udp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=500 jump-target=PIN-WAN1 protocol=udp
add action=jump chain=NO-LB-PROTOCOLS-PORTS jump-target=PIN-WAN1 protocol=gre
add action=jump chain=NO-LB-PROTOCOLS-PORTS jump-target=PIN-WAN1 protocol=ipsec-esp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=1723 jump-target=PIN-WAN1 protocol=tcp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=1723 jump-target=PIN-WAN1 protocol=udp
add action=jump chain=NO-LB-PROTOCOLS-PORTS dst-port=1701 jump-target=PIN-WAN1 protocol=udp
add action=return chain=NO-LB-PROTOCOLS-PORTS
add action=mark-routing chain=output dst-port=8082 new-routing-mark=WAN2 passthrough=no protocol=tcp
add action=mark-connection chain=output new-connection-mark=WAN1-GEN2OUTPUT src-address=XX.XX.XX.XX
add action=mark-connection chain=output new-connection-mark=WAN2-GEN2OUTPUT src-address=XX.XX.XX.XX
add action=mark-routing chain=output connection-mark=WAN1-GEN2OUTPUT new-routing-mark=WAN1 passthrough=no
add action=mark-routing chain=output connection-mark=WAN2-GEN2OUTPUT new-routing-mark=WAN2 passthrough=no

EDIT: For the record, this is just an excerpt, not the entire config.

It looks like RouterOS config.