Hello all, I actually come to you with what I think is already a mostly working solution that I wanted to share with those that might have the same needs. But I would love to hear any suggested improvements since I felt a little out of my depths with some of the changes I had to make to this script
http://wiki.mikrotik.com/wiki/Improved_Load_Balancing_over_Multiple_Gateways
I have a client with 2 dynamic DSL connections and they wanted to do load balancing between the 2. Getting static IP’s over the DSL connection was not an option, so I had to find a way to modify the script to use the ppp interface 1 or 2 rather than this gateway and that gateway. That was challenge number 1, challenge number 2 was that the “Nth” field has changed since the creation of the Wiki entry, am NOT at all certain that I updated in the best way. Here is my relevant config:
/ip firewall mangle
add action=mark-connection chain=prerouting connection-state=new in-interface=Local new-connection-mark=odd nth=2,1
add action=mark-routing chain=prerouting connection-mark=odd in-interface=Local new-routing-mark=odd passthrough=no
add action=mark-connection chain=prerouting connection-state=new in-interface=Local new-connection-mark=even nth=2,2
add action=mark-routing chain=prerouting connection-mark=even in-interface=Local new-routing-mark=even passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat out-interface="pppoe Feed 1"
add action=masquerade chain=srcnat out-interface="pppoe Feed 2"
/ip route
add distance=1 gateway="pppoe Feed 1" routing-mark=odd
add distance=1 gateway="pppoe Feed 2" routing-mark=even
It would seem that according to this http://wiki.mikrotik.com/wiki/Nth they have gotten rid of the “counter” value. And when I tried nth=1,0 and nth=1,1 it says the value can’t be 0.
This modified script IS working, however I’ve noticed that significantly more data goes over Feed 1 than Feed 2, is this just happen stance, or did I screw up the “Nth” value wrong in some fashion?
Thanks in advance for any advice!
And I hope this will help others that need to load balance efficiently without static ip’s