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

Unable to create port_forward NAT rule with enc0 as interface #336

Closed
martialt opened this issue Mar 29, 2023 · 0 comments · Fixed by #359
Closed

Unable to create port_forward NAT rule with enc0 as interface #336

martialt opened this issue Mar 29, 2023 · 0 comments · Fixed by #359
Labels
feature request New feature or request

Comments

@martialt
Copy link

Describe the bug
I tried to create port_forward NAT rule with enc0 as interface.

To Reproduce

  • Create a NAT port forward rule with wan as interface -> OK
{
  "apply": true,
  "descr": "From Postman",
  "disabled": false,
  "dst": "192.168.1.1",
  "dstport": "8080",
  "interface": "wan",
  "local-port": "80",
  "natreflection": "enable",
  "nordr": false,
  "nosync": false,
  "protocol": "tcp",
  "src": "any",
  "srcport": "any",
  "target": "192.168.1.2"
}
  • API response -> OK
{
    "status": "ok",
    "code": 200,
    "return": 0,
    "message": "Success",
    "data": {
        "interface": "wan",
        "protocol": "tcp",
        "target": "192.168.1.2",
        "local-port": "80",
        "source": {
            "any": ""
        },
        "destination": {
            "address": "192.168.1.1",
            "port": "8080"
        },
        "descr": "From Postman",
        "natreflection": "enable",
        "associated-rule-id": "pass",
        "created": {
            "time": 1680094211,
            "username": "[email protected] (API)"
        },
        "updated": {
            "time": 1680094211,
            "username": "[email protected] (API)"
        }
    }
}
  • Create a NAT port forward rule with enc0 as interface -> NOK
{
  "apply": true,
  "descr": "From Postman",
  "disabled": false,
  "dst": "192.168.1.1",
  "dstport": "8080",
  "interface": "enc0",
  "local-port": "80",
  "natreflection": "enable",
  "nordr": false,
  "nosync": false,
  "protocol": "tcp",
  "src": "any",
  "srcport": "any",
  "target": "192.168.1.2"
}

API response -> NOK

{
    "status": "bad request",
    "code": 400,
    "return": 4006,
    "message": "Unknown port forward interface",
    "data": []
}

If I modify the port_forward NAT rule from the UI to change wan by IPsec (enc0) -> OK

  • API Get https://{{url}}//api/v1/firewall/nat/port_forward -> OK
    But address is also /31 and I don't know why.
{
    "status": "ok",
    "code": 200,
    "return": 0,
    "message": "Success",
    "data": [
        {
            "source": {
                "any": ""
            },
            "destination": {
                "address": "192.168.1.1/31",
                "port": "8080"
            },
            "ipprotocol": "inet",
            "protocol": "tcp",
            "target": "192.168.1.2",
            "local-port": "80",
            "interface": "enc0",
            "descr": "From Postman",
            "associated-rule-id": "pass",
            "natreflection": "enable",
            "created": {
                "time": "1680094211",
                "username": "[email protected] (API)"
            },
            "updated": {
                "time": "1680094521",
                "username": "[email protected] (Local Database)"
            }
        }
    ]
}

Expected behavior
A port_forward rule with enc0 as interface.

pfSense Version & Package Version:

  • pfSense Version: 2.6.0-RELEASE (amd64)
  • Package Version v1.5.3

Affected Endpoints:

  • URL: /api/v1/firewall/nat/port_forward

In advance, thank you.

@jaredhendrickson13 jaredhendrickson13 added feature request New feature or request backlog Issues backlogged for inclusion in future releases labels Apr 13, 2023
@jaredhendrickson13 jaredhendrickson13 removed the backlog Issues backlogged for inclusion in future releases label Jul 1, 2023
@jaredhendrickson13 jaredhendrickson13 linked a pull request Jul 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants