Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter rule association into the NAT Port Forward Create. #275

Closed
gertyes opened this issue Sep 8, 2022 · 3 comments · Fixed by #544
Closed

Add filter rule association into the NAT Port Forward Create. #275

gertyes opened this issue Sep 8, 2022 · 3 comments · Fixed by #544
Labels
backlog Issues backlogged for inclusion in future releases feature request New feature or request

Comments

@gertyes
Copy link

gertyes commented Sep 8, 2022

Hi Jared,

Thank you for a brilliant piece of work.

I would like to suggest the addition of a missing field in the Port Forward Creation page.

Is your feature request related to existing pfSense functionality that is missing from the API? Please describe.

In the pfSense UI a selection can be made to Add associated filter rule. This is the last field in the UI under port forward create, Filter rule assosiation. This seems to be missing from the REST API.

When this is used with add-associated, then pfSense will create a basic firewall rule and associate it with the nat port forward rule.

The json below shows the current request body that could be send to create a nat port forward rule.

{
  "apply": false,
  "descr": "",
  "disabled": false,
  "dst": "string",
  "dstport": "string",
  "interface": "string",
  "local-port": "string",
  "natreflection": "enable",
  "nordr": false,
  "nosync": false,
  "protocol": "tcp",
  "src": "string",
  "srcport": "string",
  "target": "string",
  "top": false
}

Describe the solution you'd like

This can be achieved by adding the filter-rule-association field to the Port Forward Create model.

It seems that there are 4 possible values that can be used here:

  • None
  • add-associated
  • add-unassociated
  • pass

Suggested json to be send in request body.

{
  "apply": false,
  "descr": "",
  "disabled": false,
  "dst": "string",
  "dstport": "string",
  "interface": "string",
  "local-port": "string",
  "natreflection": "enable",
  "nordr": false,
  "nosync": false,
  "protocol": "tcp",
  "src": "string",
  "srcport": "string",
  "target": "string",
  "top": false,
  "filter-rule-association": "string"
}

Additional context
I tried to add the field myself but since I have no knowledge on PHP I seem to keep on missing something. My solution doesn't seem to affect any change.

Kind Regards,
Gert.

@gertyes gertyes added backlog Issues backlogged for inclusion in future releases feature request New feature or request labels Sep 8, 2022
@git-wessel
Copy link

I would really like to see this integration too!

It's an bit of a time saver, and this makes it more like how the GUI is supposed to work/respond

@lechuhuuha
Copy link

Hi @jaredhendrickson13

I had forked the repo and add additional choices to field associated_rule_id in PortFoward model to support created rule when created port forward

is there a way you can add the option for that Model

if not then can you show me the way how to setup a vps for the runner to build pkg

i had setup a pfsense with freebsd but can not run the github runner

Thanks

@jaredhendrickson13
Copy link
Owner

@lechuhuuha The reason this has not yet been implemented is it heavily relies on managing the state of a related model object, which up until v2 was difficult and required a lot of redundant logic. I think this should be much more feasible now. I'll see if I can fit it into v2.1.0.

You can refer to the link in the comment I added on #516 for help building the package from source on your fork if you want to go that route.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues backlogged for inclusion in future releases feature request New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants