OPNsense Forum

English Forums => General Discussion => Topic started by: le_top on November 24, 2023, 07:54:29 PM

Title: Configuration for "route" <AnyLANIP> -> WANIP:WANPORT --NAT-> LANIP2:LANPORT
Post by: le_top on November 24, 2023, 07:54:29 PM
I have OPNsense running on a Proxmox server where its WAN port has the WAN_IP directly (datacenter).

On the LAN network it's connected to a bridge where several containers and VMs are connected.

I have several NAT rules which allow a connection from the publlic network to a internal TCP Servirce I'll call LANIP2:LANPORT .  The NAT rule works for WANIP:WANPORT to LANIP2:LANPORT .

(https://i.ibb.co/KhdC0Fj/image.png)

However when I try to connect from a machine on the internal network to WANIP:WANPORT, the NAT rule does not seem to apply - I can not connect.  I can connect if I map the domain name to the internal IP, either in /etc/hosts or by mapping it to the local IP in unbound DNS running on OPNsense.

I would like to do properly though.

Title: Re: Configuration for "route" <AnyLANIP> -> WANIP:WANPORT --NAT-> LANIP2:LANPORT
Post by: meyergru on November 24, 2023, 08:34:50 PM
You can do that 2 ways:

1. Via split-horizon DNS
2. Via hairpinning

See [ur=https://forum.opnsense.org/index.php?topic=34925.0l]this[/url].