Hey. I have a wireguard road warrior configuration (WG is running on a VM outside Mikrotik) on a couple of mobile devices. When connected my vehicle’s CarPlay, the carplay network overlaps all of my subnets, including all my site-to-site routes. The carplay is 10.0.0.0**/16**, I have subnets 10.0.2.0/24, 10.0.3.0/24, 10.0.4.0/24, 10.0.5.0/24, 10.0.6.0/24, 10.0.7.0/24 scattered across various sites. I don’t know why they picked a /16, it makes no sense for a point-to-point link.
I’ve solved this by using nat and connection tracking to remap the subnet, then updating the apps to use this remapped address.
This works both on a wg connection, and when my phone is back on my home wifi.
I have only done this for a 3 hosts locally on the router’s lan as proof of concept, and it works fine.
The problem is, Is there a way to map an entire /24 to another /24? Having to make a srcnat+dstnat entry for every host on every network seems like the wrong thing to do. This could end up being 1500+ nat rules. I then have to duplicate these rules onto the other sites for the same behavior
Or is there a better way in general to do this?
[admin@MikroTik] > ip/firewall/mangle/ print
Flags: X - disabled, I - invalid; D - dynamic
0 D ;;; special dummy rule to show fasttrack counters
chain=prerouting action=passthrough
1 D ;;; special dummy rule to show fasttrack counters
chain=forward action=passthrough
2 D ;;; special dummy rule to show fasttrack counters
chain=postrouting action=passthrough
3 ;;; Track Carplay connections
chain=prerouting action=mark-connection new-connection-mark=carplay passthrough=yes dst-address=10.4.4.0/24 log=no log-prefix=""
[admin@MikroTik] > ip/firewall/nat/ print
Flags: X - disabled, I - invalid; D - dynamic
0 chain=srcnat action=masquerade out-interface=wan_quantum log=no log-prefix=""
1 ;;; RoadWarrior phone to VM
chain=dstnat action=dst-nat to-addresses=10.0.4.16 to-ports=51820 protocol=udp in-interface-list=wans dst-port=51820 log=no log-prefix=""
2 ;;; carplay-homeassistant-dst
chain=dstnat action=dst-nat to-addresses=10.0.4.11 dst-address=10.4.4.11 connection-mark=carplay log=no log-prefix=""
3 ;;; carplay-homeassistant-src
chain=srcnat action=src-nat to-addresses=10.4.4.11 dst-address=10.0.4.11 connection-mark=carplay log=no log-prefix=""
4 chain=dstnat action=dst-nat to-addresses=10.0.4.41 dst-address=10.4.4.41 connection-mark=carplay log=no log-prefix=""
5 chain=srcnat action=src-nat to-addresses=10.4.4.41 dst-address=10.0.4.41 connection-mark=carplay log=no log-prefix=""
6 chain=dstnat action=dst-nat to-addresses=10.0.4.43 dst-address=10.4.4.43 connection-mark=carplay log=no log-prefix=""
7 chain=srcnat action=src-nat to-addresses=10.4.4.43 dst-address=10.0.4.43 connection-mark=carplay log=no log-prefix=""