OPNsense Forum

English Forums => 26.1, 26,4 Series => Topic started by: OPNsense4ever on April 26, 2026, 11:47:58 PM

Title: 26.1.6_2 Destination NAT - how to use port range?
Post by: OPNsense4ever on April 26, 2026, 11:47:58 PM
Hello,

I am trying to redirect ports TCP/UDP ports 1630-1641 to a host on my LAN. I can use the "Single port or range" drop-down for the Destination Port, but there is nothing similar for Redirect Target Port. I looked at the docs here (https://docs.opnsense.org/manual/nat.html), but I don't see anything.

What should be used for Redirect Target Port? The first port in the range? 1630? any?

Thank you!
Title: Re: 26.1.6_2 Destination NAT - how to use port range?
Post by: SonicJoe on April 27, 2026, 01:13:16 AM
I'm pretty sure destination NAT is one to one. You would need 2 rules, one for port 1630 and one for port 1631 if you need both redirected.

Edit: Oops, just realized you have 12 ports to 1641. So it would be 12 rules. I could be wrong, but that's what I did for the redirects i need.
Title: Re: 26.1.6_2 Destination NAT - how to use port range?
Post by: lmoore on April 27, 2026, 02:29:46 AM
Quote from: OPNsense4ever on April 26, 2026, 11:47:58 PMWhat should be used for Redirect Target Port? The first port in the range? 1630? any?

In your case you would enter 1630, which is the base port number for the range.

Connections arriving within you port range of 1630-1641 will be redirected to ports 1630-1641 at the redirected address.

If you set your Redirect Target Port to 20630, the connections arriving within the port range of 1630-1641, will be redirected to 20630-20641.

If you wanted to use multiple but not sequential ports, you would set up a Port Alias with the port numbers and use the Port Alias in the Destination Port and Redirect Target Port fields.

[Edit] Using "any" simply redirects to the port numbers within the range.