Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Normal response codes: 200
  • Error response codes: 401, 404

Redirect

GET /cgi-bin/luci/sdewan/firewall/v1/redirects

Lists all defined redirects

Request: N/A

Response

  • Normal response codes: 200
  • Response Parameters

    NameInTypeDescription
    redirectsbodyarraya list of defined redirects


  • Response Example


    {
        "redirects": [

            {

                "name":"DNAT-LAN",
                "src":"wan",
                "src_dport":"19900",
                "dest":"lan",
                "dest_ip":"192.168.1.1",
                "dest_port":"22",
                "proto":"tcp",
                "target":"DNAT"

          }

        ]

    }


GET /cgi-bin/luci/sdewan/firewall/v1/redirect/{redirect}

Get a redirect

Request: N/A

  • Request Parameters

    NameInTypeDescription
    redirectpathstringredirect name


Response

  • Normal response codes: 200
  • Error response code: 404
  • Response Parameters

    NameInTypeDescription
    namebodystring(Required) forwarding name
    srcbodystring(Required) traffic source zone
    destbodystring(Required) traffic destination zone
    familybodystringProtocol family (ipv4, ipv6 or any) to generate iptables rules for.


  • Response Example


    {

        "name":"DNAT-LAN",
        "src":"wan",
        "src_dport":"19900",
        "dest":"lan",
        "dest_ip":"192.168.1.1",
        "dest_port":"22",
        "proto":"tcp",
        "target":"DNAT"

    }


POST /cgi-bin/luci/sdewan/firewall/v1/redirect

create a new redirect

Request:

  • Request Parameters: same with GET's response request

  • Request Example: same with GET's response example


Response

  • Normal response codes: 201
  • Error response codes: 400, 401


PUT /cgi-bin/luci/sdewan/firewall/v1/redirect/{redirect}

update a redirect

Request:

  • Request Parameters:

    NameInTypeDescription
    redirectpathstringredirect name
    {other params}body
    same with GET response


  • Request Example


    {

        "src":"wan",
        "src_dport":"19900",
        "dest":"lan",
        "dest_ip":"192.168.1.1",
        "dest_port":"22",
        "proto":"tcp",
        "target":"DNAT"

    }


Response

  • Normal response codes: 204
  • Error response codes: 400, 401, 404


DELETE /cgi-bin/luci/sdewan/firewall/v1/redirect/{redirect}

delete a redirect rule

Request:

  • Request Parameters

    NameInTypeDescription
    redirectpathstringredirect name


Response

  • Normal response codes: 200
  • Error response codes: 401, 404

Rule

GET /cgi-bin/luci/sdewan/firewall/v1/frulesrules

Lists all defined rules

Request: N/A

...