The 2 gateways issue.

Hi there. After reading the all the foruns related with this issue, none worked for me.
I use a RB532 with 2 internet connectios. On ether1 i connect to the lan (10.0.1.1) on ether2 (192.168.1.2) i connect it to an adsl router A(192.168.1.1) and the ether3 (192.168.0.2) i connect it to another adsl router B (192.168.0.1)

I tried adding the gateways to 2:1 (repeating the gateway ips), but the traffic always goes out throw ether2. Ether3 is almost dead.

I tried this solution How to use Transparent Web Proxy with 2 Internet Connections

and the odd / even packet solution, but the damn gateway that reaches the internet is the adsl router A ip.

My configurations:

[admin@MikroTik] ip route> print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf

DST-ADDRESS PREF-SRC G GATEWAY DISTANCE INTERFACE

0 ADC 10.0.1.0/24 10.0.1.1 ether1
1 ADC 192.168.0.0/24 192.168.0.3 ether3
2 ADC 192.168.1.0/24 192.168.1.3 ether2
3 A S 0.0.0.0/0 r 192.168.1.1 ether2
4 A S 0.0.0.0/0 r 192.168.0.1 ether3
5 A S 0.0.0.0/0 r 192.168.1.1 ether2

[admin@MikroTik] ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic
0 X ;;; masquerade hotspot network
chain=srcnat src-address=10.0.1.0/24 action=masquerade

1 chain=srcnat connection-mark=odd action=src-nat to-addresses=192.168.1.1 to-ports=0-65535
2 chain=srcnat connection-mark=even action=src-nat to-addresses=192.168.0.1 to-ports=0-65535

[admin@MikroTik] > ip route print
0 chain=prerouting in-interface=ether1 src-address-list=odd
action=mark-connection new-connection-mark=odd passthrough=yes
1 chain=prerouting in-interface=ether1 src-address-list=odd
action=mark-routing new-routing-mark=odd passthrough=yes
2 chain=prerouting in-interface=ether1 src-address-list=even
action=mark-connection new-connection-mark=even passthrough=yes
3 chain=prerouting in-interface=ether1 src-address-list=even
action=mark-routing new-routing-mark=even passthrough=yes
4 chain=prerouting in-interface=ether1 connection-state=new nth=1,1,0
action=mark-connection new-connection-mark=odd passthrough=yes
5 chain=prerouting in-interface=ether1 connection-mark=odd
action=add-src-to-address-list address-list=odd address-list-timeout=1d
6 chain=prerouting in-interface=ether1 connection-mark=odd
action=mark-routing new-routing-mark=odd passthrough=no
7 chain=prerouting in-interface=ether1 connection-state=new nth=1,1,1
action=mark-connection new-connection-mark=even passthrough=yes
8 chain=prerouting in-interface=ether1 connection-mark=even
action=add-src-to-address-list address-list=even address-list-timeout=1d
9 chain=prerouting in-interface=ether1 connection-mark=even
action=mark-routing new-routing-mark=even passthrough=no

I checked all the wiki info in RouterOS - RouterOS - MikroTik Documentation and nothing worked. The routers are regular adsl routers with dynamic public ip and a chosen local ip. I´m using hotspot too.

Any help would be apreciated.

Hi there,

Can anyone shed light on this, I also have tried the all examples given in the Wiki, even the connection tracking. Problem is, any LAN ip can gain both “odd” and “even” marks, from there its square one. Broken SSL sessions etc. same for nth packet marking.

Is ROS v3 intending to have a specific function for dual wan?

Cheers

You could route 0.0.0.0/1 via one connection and 0.0.0.0/0 through the other connection for some crude outgoing balancing. And setup a higher metric 0.0.0.0/0 for the other connection as a backup.

can you be little more clear…

I am also facing the same problem

http://wiki.mikrotik.com/wiki/Load_Balancing

This would be your best place to start. By what it sounds like you are trying to do load balancing between two separate internet sources correct?

yes i have internet from 2 different sources…

I was looking over your config print above - looks like your rules are all out of order - the order of the rules is just as important as the rules. Next - you have ‘passthrough’ on a few that shouldn’t and nth - it’s important to get the numbers ‘right’ otherwise the rules get processed incorrectly.

I have to assume that you are using this URL: http://wiki.mikrotik.com/wiki/Load_Balancing_Persistent

To write the above config (this one looks the closest), for you to use one of the gateways twice just add a whole segment of rules (based on the URL above) - I use the tags - one , two, three - but you can of course use anything you want for the tags - just be consistant.

Thom