Community discussions

MikroTik App
 
prosgarz35
just joined
Topic Author
Posts: 1
Joined: Mon Oct 05, 2020 7:21 pm

ECMP,NTH, Route Rules any Improvements?

Mon Oct 05, 2020 7:28 pm

Hi there, i am New to Mikrotik and RouterOS. There my code and i want ask about how it can be improved with route rules... idk any other things.
I still dont get idea of balancing of route rules fully and want to understand how use lookup only for one ISP if i connect on it from outside? I use ECMP and sometimes cannot connect cuz going on another route choosed by ECMP.

================================ECMP======================================
/ip firewall mangle

add action=mark-connection chain=forward connection-mark=no-mark new-connection-mark=con-WAN1 out-interface=WAN1 passthrough=yes
add action=mark-connection chain=forward connection-mark=no-mark new-connection-mark=con-WAN2 out-interface=WAN2 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=con-WAN1 in-interface-list=!WAN new-routing-mark=WAN1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=con-WAN2 in-interface-list=!WAN new-routing-mark=WAN2 passthrough=yes

/ip route

add distance=1 gateway=XXXX routing-mark=WAN1
add distance=1 gateway=YYYY routing-mark=WAN2
add distance=1 gateway=XXXX,YYYY
add check-gateway=ping distance=100 gateway=YYYY
add check-gateway=ping distance=100 gateway=XXXX


I am also try to use NTH but some sites like youtube work incorrect with em


================================NTH=======================================
/ip firewall mangle

add action=mark-connection chain=prerouting connection-state=new new-connection-mark=line1 nth=2,1 passthrough=yes src-address=192.168.35.0/24
add action=mark-connection chain=prerouting connection-state=new new-connection-mark=line2 nth=2,2 passthrough=yes src-address=192.168.35.0/24
add action=mark-routing chain=prerouting connection-mark=line1 new-routing-mark=line1 passthrough=yes src-address=192.168.35.0/24
add action=mark-routing chain=prerouting connection-mark=line2 new-routing-mark=line2 passthrough=yes src-address=192.168.35.0/24

/ip route

add check-gateway=ping distance=1 gateway=XXXX routing-mark=line1
add check-gateway=ping distance=1 gateway=YYYY routing-mark=line2
add check-gateway=ping distance=1 gateway=XXXX
add check-gateway=ping distance=2 gateway=YYYY

Who is online

Users browsing this forum: No registered users and 48 guests