Community discussions

MikroTik App
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.

/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

/ip firewall mangle

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

/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: Bing [Bot], paulct and 41 guests