OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • NAT portforward for complete subnet
« previous next »
  • Print
Pages: [1]

Author Topic: NAT portforward for complete subnet  (Read 787 times)

mts

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
    • View Profile
NAT portforward for complete subnet
« on: September 26, 2023, 07:22:23 pm »
Hey guys,

I want to redirect a port for a complete subnet.
e.g.
10.10.0.4:1234->10.10.0.4:44444
10.10.0.8:1234->10.10.0.8:44444
10.10.0.10:1234->10.10.0.10:44444
...
So destination and target is always the same. Only the port is changed.
Is there a way to prevent many manual entries?

CU
mts
Logged

Monviech (Cedrik)

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: 178
    • View Profile
Re: NAT portforward for complete subnet
« Reply #1 on: September 26, 2023, 08:57:40 pm »
How about:

Destination: 10.10.0.0/24
Destination port range: 1234-1234
Redirect target IP: 10.10.0.0/24
Redirect target port: 44444

Results in the following rule in pf:
@145 rdr on lan inet proto tcp from any to 10.10.0.0/24 port = 1234 -> 10.10.0.0/24 port 44444

Edit: I dont know if that works the way you expect it to work though, just verified that you can input that in the GUI. I dont know what the results will be.
« Last Edit: September 26, 2023, 09:41:09 pm by Monviech »
Logged
Hardware:
DEC740

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • NAT portforward for complete subnet
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2