Hello everybody. Faced with the strange behavior of Mikrotik and now I’m wondering - it’s a bug.
The behavior is as follows: there is a hEX with iOS 4.7. and two uplinks. Using the netwatch mechanism, monitor ip 8.8.8.8 to check the availability of the channel. The idea is usual - to switch to the reserve when the main channel falls. And I noticed that by running ping on 8.8.8.8 with a live main channel, I get a normal response. When the main channel is disconnected, ping disappears and does not resume, although the routing table changes.
If the ping command is not reset and started again, then it will continue to ping unsuccessfully. But if you restart it, then everything will pass. The question is - a bug or a feature?
It is probably not caused by the netwatch ping itself but by connection and packet marking and routing selection you made elsewhere to make your dual-uplink work.
It’s not clear from what you wrote whether you are pinging 8.8.8.8 from the Mikrotik itself or from a device on a LAN. I suppose the latter, in that case, the explanation is how the NAT works. The sequence of ping requests and responses is handled by the firewall as any other tracked connection, so the firewall chooses the public IP to be used for all packets of that connection when processing the first one of them, and doesn’t change it even if the interface to which the address is attached fails - it wouldn’t make sense for “normal” connections (TCP, UDP) as the server identifies the connection by the client address, so the connection would fail anyway. In case of ping, this wouldn’t be a problem, but the firewall doesn’t have a special NAT treatment for ping.
Well, there is a netwatch running on the router itself…
Maybe the ping used by netwatch determines the source address only one time, I do not know. I would not expect it.
I suspect you are doing a continues pin from a device in the LAN?
No, not a bug.
The route has been cached, hence the symptoms. If you prefer, you can disable route cache in ip settings, but this can have negative performance impact
Hi, sindy.
I am pinging 8.8.8.8 from my LAN ip on the device itself. Link on LAN interface of course ON.
Yes, i also think that NAT could makes some influent. Ooooh, so behavior of my Mikrotik concerns only ICMP? Good? good. I will test it.
That’s right, i make continues ping from a device in the LAN. And i disabled my route cache, because i thougth that it may be the reason of this strange behavior. But with desabled route cache the problem still exists.
Recursive routing also pings the reference IPs every 10 seconds (so no improvement in the reaction on the interface going down) and the same issue will remain.
If you ping from the LAN IP of the Mikrotik itself, your action=masquerade rule, which matches on the whole subnet as src-address, also changes the source IP of the connection to the one of the WAN through which the first ping request packet is sent out. Without that masquerade rule, the packets would be leaving with the private address unchanged, so either the ISP would not let them through or the responses would never reach your device.
No, you’ve understood me inversely - ICMP echo is handled the same way like UDP, TCP etc. although it could be handled differently due to different properties of the protocol. But it would be too much coding for too little benefit.
But did you already try using recursive routing with route check? As shown in examples.
And also get rid of the bonding interface and try in with a plain ethernet port, maybe there is some difference there too.