@ahmet82, assuming it is not a completely other setup than the one you deal with in
your other topic, you'll have to resolve a conflict between the scriptless failover based on recursive next-hop search and the setup recommended by @bpwl where same gateway IP is used on two WANs so you have to configure the routes' gateways as
ip.add.re.ss%interface: the recursive next-hop search doesn't work with any routes whose gateways are other than just IP addresses.
I assume that you cannot change the settings of the ISP-provided modem/router devices, so you cannot follow @DarkNate's suggestion - if you could configure those devices, you would be able to change their LAN IP subnet, so this topic would not exist.
Now a bit of theory.
When a route with an IP address indicated as
gateway is used, RouterOS takes the IP address of the gateway, finds the smallest one of all the local subnets to which that IP address fits, and chooses the interface to which that subnet is attached as the out-interface. Next, it looks for an ARP record associated to that interface for the gateway's IP address; if no such record is found, it sends an ARP request from that interface, asking whoever has the IP address of the gateway to respond with its MAC address. And lastly, it sends the actual packet from the chosen interface to the MAC address of the gateway. The result of the ARP response is cached for tens of seconds, so the ARP request need not be sent for every packet. So if there already is a record in the "ARP table", the ARP query is not sent, and the record is used immediately.
If the same subnet is attached to two distinct interfaces, the choice of one of them cannot be affected, except by setting the
ip.add.re.ss%interface notation, which we cannot use for the reasons above.
The above is the basis for a dirty trick which can be used to make RouterOS select the proper one of the two interfaces although the actual IP address of the modem/router devices is the same in both (i.e. even if you couldn't change even the routers' own addresses).
The starting point is that you have a DHCP client attached to both WANs, A and B, both with
add-default-route=no. Enable both clients. Use
:put [/ip dhcp-client get [find interface=wan-A-name] gateway]
to show the IP address of the gateway provided by A, and
:put [/ip dhcp-client get [find interface=wan-B-name] gateway]
to show the one provided by B. I assume both will show the same value,
192.168.1.1, but do check that. Then, disable the dhcp-client for A, and keep the one for B enabled.
Now ping the gateway address shown for B, and then show the ARP record for it:
/ip arp print where address=192.168.1.x
It should return a single row with 0 in the leftmost column. Add a static ARP record for an alias IP address, attached to B:
/ip arp add copy-from=0 address=192.168.1.254.
Now disable also the DHCP client for B, and manually assign addresses from different halves of 192.168.1.0/24 to each of the two interfaces:
/ip address add address=192.168.1.10/25 interface=A
/ip address add address=192.168.1.210/25 interface=B
Add manually the routes for the two WANs as needed; for routes that should use A, set the 192.168.1.1 as
gateway; for routes that should use B, set the 192.168.1.254.
That's all. Routes with 192.168.1.254 as
gateway will match the 192.168.1.128/25 subnet attached to B, and as the ARP record for the gateway is a static one, they will use it to find the MAC address of the gateway without sending any ARP request. Routes with 192.168.1.1 as
gateway will match the 192.168.1.0/25 subnet attached to A, and will use ARP to translate 192.168.1.1 into a MAC address.