Hello everyone, I have a problem with how RouterOS handles the dynamic address my ISP gives to my Mikrotik routerboard.
The problem is that the address from DHCP is something like 96.2.3.4/8 and the default gateway from the same DHCP is like 213.4.5.6. As you can see, the default gateway is outside of the IP address network given by the same DHCP.
This seems to be a fairly common issue with some ISP, and I have found a rather dirty workaround: I added a static default route to 96.1.1.1 (a random IP in the assigned network) and configured dhcp-client in order to not add the gateway provided by DHCP. This works because the cable modem reports the same MAC address for the real gateway and the bogus one.
This workaround is very weak: it only works if the ISP always assign addresses from 96.0.0.0/8 network (because of the static route).
I know that some routers have the same problem (for example Tp-link) but some others handle this situation without an hiccup. It would be great if Mikrotik could implement a fix, or suggest a better workaround.
GW is acquired via DHCP (that’s the default for dhcp-client configuration), the script only manages the missing direct route between dynamic IP and GW that are on different networks.
Linux has an option when adding a route, “onlink”, to skip the check that the gateway is to be within the subnet.
Unfortunately it does not appear in the options available when setting a route via the MikroTik user interface.
They probably have good reasons for this, maybe there is some conflict with other functionality that MikroTik
have built on top of the existing Linux mechanisms (e.g. VRF), but sometimes it is inconvenient.
This issue is also apparent when trying to build a multipoint VPN…