Community discussions

 
vit20
just joined
Topic Author
Posts: 1
Joined: Fri Nov 09, 2018 10:06 pm

Hairpin NAT, but change the src IP to my WAN's instead of my router's

Sat Nov 10, 2018 8:46 pm

Hello, I'm trying to configure Hairpin NAT like that:
/ip firewall nat add chain=dstnat dst-address-type=local protocol=tcp dst-port=443 action=dst-nat to-address=192.168.0.190 to-port=443
/ip firewall nat add chain=srcnat src-address=192.168.0.0/23 dst-address=192.168.0.190 protocol=tcp dst-port=443 out-interface=bridge action=masquerade
... and it works.

192.168.0.190 is the IP address of my RaspberryPi and the port 443 is pointing to my Apache server running there.
However, when I look into the Apache's logs, the source IP of the request is always 192.168.0.1, which is the IP of the Mikrotik router.

Is there any way how to change the router IP in the request (192.168.0.1) to my WAN IP (213.x.x.x) in this case, so it would show in the logs?

The reason why I'm asking is that my old router did that automatically and I was used to it.
Thanks!

Who is online

Users browsing this forum: Frostbyte, Kindis, petrz, TurboCow and 33 guests