have CCR router on IGW (connected to my provider) and two FreeBSD servers. BSD1 is directly connected to port in CCR. BSD2 is remote webhosting (and next services) server in LAN with IP 10.0.254.78 (2 hops far).
Some public IP addresses are set on WAN interface of CCR. One of them is redirected into BSD2 in LAN (dst-nat):
0 chain=dstnat action=dst-nat to-addresses=10.0.254.78 dst-address={PUBLIC_IP} in-interface=bridge_wan log=no log-prefix=""
1 chain=srcnat action=src-nat to-addresses={PUBLIC_IP} src-address=10.0.254.78 out-interface=bridge_wan log=no log-prefix=""
This works - access to BSD2 from internet over public IP and access from LAN over private IP 10.0.254.78.
I wanted to adjust the settings to work BSD2 access from the LAN directed to a public IP.
I found on internet this recommended rules:
2 chain=dstnat action=dst-nat to-addresses=10.0.254.78 dst-address={PUBLIC_IP} dst-address-type=local log=no log-prefix=""
3 chain=srcnat action=masquerade dst-address=10.0.254.78 log=no log-prefix=""
This works, I can contact server from LAN (10.0.0.0/8) over PUBLIC_IP, but one problem here (masquerade).
On BSD2, I use NFS, ACL etc. Problem is source IP of communication from LAN to BSD2 PUBLIC_IP. It is outgoing IP of CCR. This is problem for me.
Does exist any solution for my idea with preserving source IP? Thank you.