I am trying to setup a load balancing to accomplish the following:
- PCs in 192.168.0.8 - 192.168.0.191 range -> Go out through ISP2 (Claro)
- PCs in 192.168.0.192 - 192.168.0.254 range -> Go out through ISP1 (Fibertel)
At the end I will attach the code
I have 4 default routes (2 considering marks and 2 without marks), I mean routes to 0.0.0.0/0
- When the default route (whithout mark) is ISP1 (With less distance), machines which go out through ISP1 works fine but machines which go out through ISP2 works with "issues"
- When the default route (whithout mark) is ISP2 (With less distance), machines which go out through ISP2 works fine but machines which go out through ISP1 works with "issues"
The "issues" are the following:
I can navigate to Internet and I can see all pages but all pages take a long time to appear (10-20 seconds to be fully loaded)
Without any mark, all machines go out through the same ISP, and they works fine, in both cases, with ISP1 and ISP2
This is the code:
Code: Select all
/ip firewall mangle
add action=accept chain=prerouting dst-address=Isp1Network in-interface=bridge
add action=accept chain=prerouting dst-address=Isp2Network in-interface=bridge
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether1-wan1 new-connection-mark=Fibertel_con passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether2-wan2 new-connection-mark=Claro_con passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address=!192.168.0.0/24 new-connection-mark=Celulares_con passthrough=yes src-address=192.168.0.9-192.168.0.191
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address=!192.168.0.0/24 new-connection-mark=Libre_con passthrough=yes src-address=192.168.0.192/26
add action=mark-routing chain=prerouting connection-mark=Fibertel_con new-routing-mark=A_Fibertel passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting connection-mark=Claro_con new-routing-mark=A_Claro passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting connection-mark=Libre_con new-routing-mark=A_Fibertel passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting connection-mark=Celulares_con new-routing-mark=A_Claro passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=output connection-mark=Fibertel_con new-routing-mark=A_Fibertel passthrough=yes
add action=mark-routing chain=output connection-mark=Claro_con new-routing-mark=A_Claro passthrough=yes
add action=mark-packet chain=prerouting connection-mark=Celulares_con new-packet-mark=Celulares passthrough=yes
add action=mark-packet chain=prerouting connection-mark=Restringido_con new-packet-mark=Restringido passthrough=yes
/ip route
add comment=Fibertel disabled=yes distance=1 gateway=ISP1GW routing-mark=A_Fibertel
add comment=Claro disabled=yes distance=1 gateway=ISP2GW routing-mark=A_Claro
add check-gateway=ping distance=15 gateway=ISP2GW
The other route is dinamyc, because of this, it does not appear in the export.
Any idea why is the problem?
Thanks in advance.
Regards
Damián