Script:
/ip address
add address=192.168.168.1/24 interface=bridge-LAN network=192.168.168.0
add address=103.28.0.254/30 interface=WAN2 network=103.28.0.252
add address=103.28.2.254/30 interface=WAN1 network=103.28.2.252
/ip dns
set servers=8.8.8.8,8.8.4.4
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
/ip route
add check-gateway=ping distance=1 gateway=103.28.0.253,103.28.2.253
Ref: http://wiki.mikrotik.com/wiki/ECMP_load_balancing_with_masquerade
Other Config
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
/ip firewall mangle
add action=mark-connection chain=input in-interface=WAN1 new-connection-mark=\
WAN1_Conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN2 new-connection-mark=\
WAN2_Conn passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1_Conn \
new-routing-mark=WAN1_Conn passthrough=no
add action=mark-routing chain=output connection-mark=WAN2_Conn \
new-routing-mark=WAN2_Conn passthrough=no
/ip route
add distance=1 gateway=103.28.2.253 routing-mark=WAN1_Conn
add distance=1 gateway=103.28.0.253 routing-mark=WAN2_Conn
add check-gateway=ping distance=1 gateway=103.28.0.253,103.28.2.253
5 comments
Write commentsI have 1 question. I have wan1 is ezecom and wan2 is opennet, i use ezecom as pppoe and opennet none.i use it as load sharing and no any condition just when want1 is loss wan2 will share internet on my lan.but i forward my telephone system ip to wan1 with public ip that i got from ezecom. but the problem mikrotik refresh load sharing every 10 minutes and my telephone system is sometime redirect to wan2 that make confuse connection with my ip phnone from my branch from another province that point to my system at PP. so how can i make my ip of my telephone system always use wan1 path only not redirect to wan2 path that have no public ip. anymore detail can contact me : nareachkr@gmail.com. thanks hope you can help me.
ReplyHi Phalla
ReplyWhat do you mean "Other Config"?
Did you mean There are 2 ways in ECMP Method? If so What is the best?
what is the diferennce between both of them ?
ReplyI tried without the mangle rules and it woks fine but I want to know why in some tutorials the mangle rule is added , just like you have indicated here as other config
Replyplease, can you post or send the complete configuration?
ReplyEmoticonEmoticon