Community discussions

MikroTik App
 
WiraSoenaryo
just joined
Topic Author
Posts: 2
Joined: Fri Feb 25, 2022 5:19 am

NAT client outgoing using different route

Fri Feb 25, 2022 6:44 am

Hai,

This is my first post on this forum... please bear my stupidity...
Currently I have this setting on my network.


Internet Server (A) ( Public Server IP 100.100.100.100 - WG IP 10.66.66.1) => example.com
||
|| connection using Wireguard to mikrotik
||
|| ^^^^^^^^^^^^^^ Router ( Public ISP IP 200.200.200.200 - LAN IP 192.168.20.1 )
|| ^^^^^^^^^^^^^^^^ ||
|| ^^^^^^^^^^^^^^^^ ||
Mikrotik ( WAN IP 192.168.20.100 - LAN IP 192.168.50.1 - WG IP 10.66.66.3 )
||
||
||
Local Server (B) ( LAN IP 192.168.50.5 )

Based on my simple diagram above, so the connection is like this
1. My router connected to my local ISP
2. Mikrotik connected to my router and also connected to Server A using Wireguard
3. Local server (B) connected to Mikrotik using LAN port

My goal is using the Public IP on the Internet Server (A) to be able to connect or access the Local Server (B).
I have successfully set the port forwarding on both firewall on the server A and Mikrotik, so when we enter example.com... it will open the apache website on the server B.

The problem is when I tried to check the public IP on the local server (B), it showed my ISP Public IP (200.200.200.200). When I do traceroute, the routing goes to like this
1. _gateway 192.168.50.1
2. 192.168.20.1
3. ....
4. ....

I believe it should be like this, but what rules should I add on firewall / route?
1. _gateway 192.168.50.1
2. 10.66.66.1
3. ....
4. ....

How do I change that so when I check the public IP on local server (B), it will showed my Internet Server (A) IP (100.100.100.100). Is this possible to be done?
Thank you.