OPNsense Forum

English Forums => General Discussion => Topic started by: Red Squirrel on March 12, 2025, 10:26:02 AM

Title: NAT "destination" and "redirect target ip"
Post by: Red Squirrel on March 12, 2025, 10:26:02 AM
When doing port forward what's the difference between "destination" and "redirect target IP"?

Say I want to forward port 8080 to internal host 10.1.1.10, which of those fields do I put that, or do I put it in both?
Title: Re: NAT "destination" and "redirect target ip"
Post by: Patrick M. Hausen on March 12, 2025, 10:31:39 AM
Redirect target IP.

Assuming you intend to forward incoming connections from the Internet via your public IP address then destination is "WAN address", because that's what the external user is connecting to.
Title: Re: NAT "destination" and "redirect target ip"
Post by: Red Squirrel on March 12, 2025, 10:40:03 AM
Oh ok, so "destination" is from the view point of being on the outside then?  That makes sense when I look at it that way. Guess in most cases you would just put "WAN Address" but if you had a block of static IPs then you could specify which external IP the rule is for?
Title: Re: NAT "destination" and "redirect target ip"
Post by: Patrick M. Hausen on March 12, 2025, 11:24:21 AM
Quote from: Red Squirrel on March 12, 2025, 10:40:03 AMGuess in most cases you would just put "WAN Address" but if you had a block of static IPs then you could specify which external IP the rule is for?

Yes and yes.
Title: Re: NAT "destination" and "redirect target ip"
Post by: dseven on March 12, 2025, 11:26:43 AM
Yes; the "Destination" address is prior to translation - it's what the rule matches on, and "Redirect target" is what it gets translated to. You're not the first to get this confused ;) And yes; if you had a subnet for your WAN interface, you could create virtual IPs and use those as the "Destination".