Unfortunetely after making this settings 192.168.50.21(SiteB) loses access to Internet.
It still has access to hosts on Site A.
I tried making alternative gateway to specific hosts in Internet (i.e 8.8.8. on the side of Wireguard tunnel
by adding simple route rule on main routing table and forwarding traffic on firewall
but still with no success
Now in terms of Router B and forcing the one IP address out a table, you are almost there…
Table looks good!
/ip route looks good except for one small change
add dst-address=0.0.0.0/0 gateway**=wireguardB** routing-table=gle
Note: Are you sure you never want that device to use the local WAN even if wireguard tunnel is down? If so keep the action as is, if not the local wan should be a backup then change action just to “lookup”.
(2) Get rid of sourcenat rule nonsense. There is no purpose or need to do this.
The device will reach Router A, and then go out the sourcenatting of Router A to the internet.
Since you have define the necessary IP route on RA, the router is aware of the .50 subnet and knows where to send any return traffic from the net.
Assumes you have the wireguardA interface as part of the LAN interface list of course.
Most probably its not the right place for making this question, but I hope you can give me the best answer.
Why should I put wireguard interface name in /ip/route for remote subnets instead of remote wireguard IP, like
/ip route
add dst-address=192.168.2.0/24 gateway=wg1
add dst-address=192.168.3.0/24 gateway=wg1
add dst-address=192.168.4.0/24 gateway=wg1
All the answers are in the article I posted.
Its also a matter of understanding how interfaces work on MT routers.
If there is local interface and the wireguard is one of them, then the router creates automatic routes for them.
Go to winbox and check your routers you will see routes for all local interfaces.
The router has no clue about subnets from other routers (not local) and thus if subnets are visiting or local users are visiting remote subnets then you need to tell the router that they exist and how to get there.