I have two separate networks, each with its own non-Mtik gateway.
Network 1 (N1) is 192.168.0.0/24
Network 2 (N2) is 10.178.99.0/24
I want to configure hap AC so clients from N1 can access N2 and vice versa. Also, clients from N1 accessing servers on N2 should look/have IP like they are from N2 and also vice versa.
I guess I should create both networks on Mtik and assign each to a port with free IP from each range. Which rules should I create to achieve the rest?
Yes, it can be done. But there are a few things to be done also on your existing routers.
However, the whole thing has a lot to do with general networking (you’re supposed to know before attempting the task at hand) and very little with ROS specifics. This will sound rude, but MT forum IMO is not the right forum to teach/learn networking basics.
Not rude at all
I know that I need to set static route on existing networks to use assigned other network IP as gateway IP and routes between networks on ROS. I was more interested if my PoC was OK and maybe some hints about how to set masquerade.
If you properly configure routing on existing routers (and it may be necessary to slightly tweak firewall settings), then no NAT is necessary. N1 devices will (explicitly) target N2 addresses and main router will know to use hAP ac2 as next hop device. And vice-versa from N2 towards N1.
If it turns out that you actually do need NAT, then it will become tricky. You wrote that you want to make N1 devices to appear as if they were part of N2. Which then means you need to use a (large) part of N2 IP address space for that (and configure netmap). In addition, you’ll have to configure hAP ac2 to perform proxy arp for those addresses (or set all of them as rourer’s own addresses). Etc. And similarly in the other direction.
The other NAT possibility is to perform “usual” port forwarding … but this completely obfuscates the network behind router. Which may be OK, but the way you described wanted result in opening post this solution doesn’t seem to fit because it only allows you to offer a few select services from one network in the other network, perhaps on non-standard ports even.