It’s not actually the same subnets being the main problem, it’s DHCP on WAN, because it might be a little unpredictable. You don’t really care about whole /24 (most likely) on WAN, only about ISP’s gateway and the address you get from DHCP. You can’t use those two on your LAN, but anything else is fine, nobody (purists excluded) cares if it overlaps. If you could be sure that both these addresses are static (ISP does not change gateway address and there’s DHCP reservation for your address), then it’s probably doable (it works, I tested it, but not extensively).
Lets start with WAN config:
/ip dhcp-client
add interface=ether1-wan
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-wan
Assume the gateway is 192.168.1.1 and DHCP gives you 192.168.1.61, those can’t be used in LAN, some other address is needed there (note the mask):
/ip address
add address=192.168.1.254/32 interface=ether3-lan
Add standard DHCP server:
/ip pool
add name=dhcp_pool1 ranges=192.168.1.100-192.168.1.150
/ip dhcp-server
add address-pool=dhcp_pool1 interface=ether3-lan name=dhcp1
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.1.254 gateway=192.168.1.254
And finally fix the routing:
/ip route
add dst-address=192.168.1.0/24 gateway=ether3-lan routing-mark=my-lan
/ip route rule
add action=lookup-only-in-table dst-address=192.168.1.1/32 table=main
add action=lookup-only-in-table dst-address=192.168.1.0/24 table=my-lan
/ip arp
add address=192.168.1.1 interface=ether3-lan published=yes
As I wrote, everything seems to work fine here. But remember, it’s more hack than a proper solution. The main problem remains to be DHCP on WAN. If it’s really dynamic and can hand out any address from /24, it’s just a matter of time before it conflicts with same address on LAN. So once more: don’t do it. And for the record, in my defense, it sounded like fun thing to try. 