Community discussions

MikroTik App
 
User avatar
Nevon
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Thu Sep 05, 2013 6:06 pm
Location: Sweden
Contact:

Force Netwatch thru WAN1?

Sat Jun 16, 2018 10:44 am

I try to setup a dual ISP failover with netwatch as the "checker" of internet on WAN1.
WAN1 and WAN2 is DHCP-client.

My config is:
/interface ethernet
set [ find default-name=ether1 ] comment=WAN1
set [ find default-name=ether2 ] comment=WAN2
/ip dhcp-client
add comment=WAN1 dhcp-options=hostname,clientid disabled=no interface=ether1
add comment=WAN2 default-route-distance=2 dhcp-options=hostname,clientid disabled=no interface=ether2
/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=google passthrough=yes protocol=icmp src-address=8.8.4.4
add action=mark-routing chain=output new-routing-mark=google passthrough=yes protocol=icmp src-address=8.8.4.4
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
/ip route
add distance=1 dst-address=8.8.4.4/32 gateway=ether1 routing-mark=google
/tool netwatch
add down-script="/ip dhcp-client set [ find comment=WAN1] default-route-distance=10\r\
\n/tool e-mail send to=\"**\" subject=\"\$[/system identity get name] ISP1 Down\"\r\
\n" host=8.8.4.4 interval=5s up-script="/ip dhcp-client set [ find comment=WAN1] default-route-distance=1\r\
\n/tool e-mail send to=\"***\" subject=\"\$[/system identity get name] ISP1 Up\""

Everything is working great but the netwatch flaps.. some how when I test to block 8.8.4.4 on WAN1 it says down in some seconds and then UP och some seconds later DOWN... and so on...

Help plz.
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Force Netwatch thru WAN1?

Wed Jul 25, 2018 5:41 pm

explain your plan more
fail-over based on ping or check gateway or what?
 
User avatar
AlainCasault
Trainer
Trainer
Posts: 632
Joined: Fri Apr 30, 2010 3:25 pm
Location: Prévost, QC, Canada
Contact:

Re: Force Netwatch thru WAN1?

Wed Jul 25, 2018 6:00 pm

If you want automatic failover, I wrote something. Please check here (https://alaincasault.com/ca/posts/) and look for "Redundant WAN links ".

It should do the trick.

Regards,




Sent from Tapatalk

Who is online

Users browsing this forum: No registered users and 29 guests