Versions Compared

Key

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

...

  • Request Parameters: same with PUT's response request

  • Request Example: same with PUT's response example


Response

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

...

  • Request Parameters: same with PUT's response request

  • Request Example: same with PUT's response example


Response

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

...

  • Request Parameters: same with PUT's response request

  • Request Example: same with PUT's response example


Response

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

...

  • Request Parameters:

    NameInTypeDescription
    zone-namepathstringzone name
    {other params}networkbodysame with GET response
    Request Example

    PUT /cgi-bin/luci/sdewan/mwan3/v1/zones/wan

    {

           "network":"wan",

           "input": "REJECT",

           "output": "ACCEPT",

          "forward": "REJECT",

           "masq": "1",

           "mtu_fix": "1"

    }

Response

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

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

Lists all defined zones

Request: N/A

Response

...

Response Parameters

...

{
    "zones": [

        {

            "name":"wan",

            "network":"wan",

            "input": "REJECT",

            "output": "ACCEPT",

            "forward": "REJECT",

            "masq": "1",

            "mtu_fix": "1"

         }

    ]

}

...

  • arrayList of interfaces attached to this zone
    masqbodybooleanSpecifies whether outgoing zone traffic should be masqueraded. "0" or "1"
    masq_srcbodystringLimit masquerading to the given source subnets.
    masq_destbodystringLimit masquerading to the given destination subnets
    masq_allow_invalidbodybooleanwhether add DROP INVALID rules 
    mtu_fix bodybooleanEnable MSS clamping for outgoing zone traffic 
    input body string Default policy (ACCEPT, REJECT, DROP) for incoming zone traffic. 
    forward body string Default policy (ACCEPT, REJECT, DROP) for forwarded zone traffic. 
    outputbody string Default policy (ACCEPT, REJECT, DROP) for output zone traffic. 
    family body string The protocol family (ipv4, ipv6 or any) these iptables rules are for. 
    subnet body string List of IP subnets attached to this zone 
    extra_src body string Extra arguments passed directly to iptables for source classification rules.   
    etra_dest body string Extra arguments passed directly to iptables for destination classification rules.   


  • Request Example

    PUT /cgi-bin/luci/sdewan/

...

  • mwan3/v1/zones/wan

    {

...

Get a zone

Request: N/A

  • Request Parameters

    NameInTypeDescriptionzone-namepathstringzone name

           "network":"wan",

           "input": "REJECT",

           "output": "ACCEPT",

          "forward": "REJECT",

           "masq": "1",

           "mtu_fix": "1"

    }


Response

  • Normal response codes: 200204
  • Error response codecodes: 404
  • Response Parameters

    NameInTypeDescriptionnamebodystring(Required) zone namenetwork
  • 400, 401, 404


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

Lists all defined zones

Request: N/A

Response

  • Normal response codes: 200
  • Response Parameters

    NameInTypeDescription
    zonesbodyarray
    List of interfaces attached to this zonemasqbodybooleanSpecifies whether outgoing zone traffic should be masqueraded. "0" or "1"masq_srcbodystringLimit masquerading to the given source subnets.masq_destbodystringLimit masquerading to the given destination subnetsmasq_allow_invalidbodybooleanwhether add DROP INVALID rules mtu_fix bodybooleanEnable MSS clamping for outgoing zone traffic input body string Default policy (ACCEPT, REJECT, DROP) for incoming zone traffic. forward body string Default policy (ACCEPT, REJECT, DROP) for forwarded zone traffic. outputbody string Default policy (ACCEPT, REJECT, DROP) for output zone traffic. family body string The protocol family (ipv4, ipv6 or any) these iptables rules are for. subnet body string List of IP subnets attached to this zone extra_src body string Extra arguments passed directly to iptables for source classification rules.   etra_dest body string Extra arguments passed directly to iptables for destination classification rules.   
    Response Example

    {

          "name":"wan",

           "network":"wan",

           "input": "REJECT",

           "output": "ACCEPT",

          "forward": "REJECT",

           "masq": "1",

           "mtu_fix": "1",

    }

DELETE /cgi-bin/luci/sdewan/firewall/v1/zones/{zone-name}

delete a zone

Request:

Request Parameters

...

Response

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

Redirect

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

create a new redirect

Request:

...

Request Parameters: same with PUT's response request

...

Response

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

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

update a redirect

Request:

  • Request Parameters:

    NameInTypeDescriptionredirect-namepathstringredirect name{other params}bodysame with GET responseRequest ExamplePUT
    a list of defined zones


  • Response Example


    {
        "zones": [

            {

                "name":"wan",

                "network":"wan",

                "input": "REJECT",

                "output": "ACCEPT",

                "forward": "REJECT",

                "masq": "1",

                "mtu_fix": "1"

             }

        ]

    }


GET /cgi-bin/luci/sdewan/firewall/v1/zones/{zone-name}

Get a zone

Request: N/A

  • Request Parameters

    NameInTypeDescription
    zone-namepathstringzone name


Response

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

    NameInTypeDescription
    namebodystring(Required) zone name
    networkbodyarrayList of interfaces attached to this zone
    masqbodybooleanSpecifies whether outgoing zone traffic should be masqueraded. "0" or "1"
    masq_srcbodystringLimit masquerading to the given source subnets.
    masq_destbodystringLimit masquerading to the given destination subnets
    masq_allow_invalidbodybooleanwhether add DROP INVALID rules 
    mtu_fix bodybooleanEnable MSS clamping for outgoing zone traffic 
    input body string Default policy (ACCEPT, REJECT, DROP) for incoming zone traffic. 
    forward body string Default policy (ACCEPT, REJECT, DROP) for forwarded zone traffic. 
    outputbody string Default policy (ACCEPT, REJECT, DROP) for output zone traffic. 
    family body string The protocol family (ipv4, ipv6 or any) these iptables rules are for. 
    subnet body string List of IP subnets attached to this zone 
    extra_src body string Extra arguments passed directly to iptables for source classification rules.   
    etra_dest body string Extra arguments passed directly to iptables for destination classification rules.   


  • Response Example


    {

          "name":"wan",

           "network":"wan",

           "input": "REJECT",

           "output": "ACCEPT",

          "forward": "REJECT",

           "masq": "1",

           "mtu_fix": "1",

    }


DELETE /cgi-bin/luci/sdewan/

...

firewall/v1/

...

{

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

}

zones/{zone-name}

delete a zone

Request:

  • Request Parameters

    NameInTypeDescription
    zone-namepathstringzone name


Response

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

Redirect

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

create a new redirect

Request:

  • Request Parameters: same with PUT's request

  • Request Example: same with PUT's example


Response

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


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

Lists all defined redirects

Request: N/A

Response

...

/{redirect-name}

update a redirect

Request:

  • Request Parameters:

    NameInTypeDescription
    redirects
    redirect-name
    body
    path
    arraya 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/redirects/{redirect-name}

Get a redirect

Request: N/A

Request Parameters

...

Response

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

    NameInTypeDescriptionnamebodystring(Required) forwarding namesrcbodystring(Required for DNAT) traffic source zonesrc_ipbodystringMatch incoming traffic from the specified source ip address.src_dipbodystring(Required for SNAT) For DNAT, match incoming traffic directed at the given destination ip address. For SNAT rewrite the source address to the given address.src_macbody string Match incoming traffic from the specified mac addresssrc_port body port or range Match incoming traffic originating from the given source port or port range on the client host.src_dport body port or range For DNAT, match incoming traffic directed at the given destination port or port range on this host. For SNAT rewrite the source ports to the given value.  proto body string Match incoming traffic using the given protocol. Can be one of tcp, udp, tcpudp, udplite, icmp, esp, ah, sctp, or all dest body string Specifies the traffic destination zone. Must refer to one of the defined zone namesdest_ip body string For DNAT, redirect matches incoming traffic to the specified internal host. For SNAT, it matches traffic directed at the given address.  dest_port bodyport or range For DNAT, redirect matched incoming traffic to the given port on the internal host. For SNAT, match traffic directed at the given ports. mark body string match traffic against the given firewall mark target body string (Required) NAT target: SNAT, DNATfamily body string Protocol family (ipv4, ipv6 or any) to generate iptables rules for Response Example

    {

       
    stringredirect name
    srcbodystring(Required for DNAT) traffic source zone
    src_ipbodystringMatch incoming traffic from the specified source ip address.
    src_dipbodystring(Required for SNAT) For DNAT, match incoming traffic directed at the given destination ip address. For SNAT rewrite the source address to the given address.
    src_macbody string Match incoming traffic from the specified mac address
    src_port body port or range Match incoming traffic originating from the given source port or port range on the client host.
    src_dport body port or range For DNAT, match incoming traffic directed at the given destination port or port range on this host. For SNAT rewrite the source ports to the given value.  
    proto body string Match incoming traffic using the given protocol. Can be one of tcp, udp, tcpudp, udplite, icmp, esp, ah, sctp, or all 
    dest body string Specifies the traffic destination zone. Must refer to one of the defined zone names
    dest_ip body string For DNAT, redirect matches incoming traffic to the specified internal host. For SNAT, it matches traffic directed at the given address.  
    dest_port bodyport or range For DNAT, redirect matched incoming traffic to the given port on the internal host. For SNAT, match traffic directed at the given ports. 
    mark body string match traffic against the given firewall mark 
    target body string (Required) NAT target: SNAT, DNAT
    family body string Protocol family (ipv4, ipv6 or any) to generate iptables rules for 


  • Request Example

    PUT /cgi-bin/luci/sdewan/mwan3/v1/redirects/dnat_lan

    {

        "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


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


...

Response

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

PUT /cgi-bin/luci/sdewan/firewall/v1/rules/{rule-name}

update a rule

Request:

  • Request Parameters:

    NameInTypeDescriptionrule-namepathstringrule name{other params}bodysame with GET response

    {
        "redirects": [

            {

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

    }

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

delete a redirect rule

Request:

Request Parameters

...

Response

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

Rule

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

create a new rule

Request:

...

Request Parameters: same with PUT's response request

  •             "proto":"tcp",
                "target":"DNAT"

          }

        ]

    }


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

Get a redirect

Request: N/A

  • Request Parameters

    NameInTypeDescription
    redirect-namepathstringredirect name


Response

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

    NameInTypeDescription
    namebodystring(Required) forwarding name
    srcbodystring(Required for DNAT) traffic source zone
    src_ipbodystringMatch incoming traffic from the specified source ip address.
    src_dipbodystring(Required for SNAT) For DNAT, match incoming traffic directed at the given destination ip address. For SNAT rewrite the source address to the given address.
    src_macbody string Match incoming traffic from the specified mac address
    src_port body port or range Match incoming traffic originating from the given source port or port range on the client host.
    src_dport body port or range For DNAT, match incoming traffic directed at the given destination port or port range on this host. For SNAT rewrite the source ports to the given value.  
    proto body string Match incoming traffic using the given protocol. Can be one of tcp, udp, tcpudp, udplite, icmp, esp, ah, sctp, or all 
    dest body string Specifies the traffic destination zone. Must refer to one of the defined zone names
    dest_ip body string For DNAT, redirect matches incoming traffic to the specified internal host. For SNAT, it matches traffic directed at the given address.  
    dest_port bodyport or range For DNAT, redirect matched incoming traffic to the given port on the internal host. For SNAT, match traffic directed at the given ports. 
    mark body string match traffic against the given firewall mark 
    target body string (Required) NAT target: SNAT, DNAT
    family body string Protocol 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"

    }


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

delete a redirect rule

Request:

  • Request Parameters

    NameInTypeDescription
    redirect-namepathstringredirect name


Response

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

Rule

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

create a new rule

Request:

  • Request Parameters: same with PUT's request

  • Request Example: same with PUT's example


Response

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


PUT /cgi-bin/luci/sdewan/firewall/v1/rules/{rule-name}

update a rule

Request:

  • Request Parameters:

    NameInTypeDescription
    rule-namepathstringrule name
    srcbodystring(Required) traffic source zone
    src_ipbodystringMatch incoming traffic from the specified source ip address
    src_macbodystringMatch incoming traffic from the specified mac address
    src_port body port or range Match incoming traffic from the specified source port or port range
    proto body string Match incoming traffic using the given protocol. Can be one of tcp, udp, tcpudp, udplite, icmp, esp, ah, sctp, or all  
    icmp_type body string For protocol icmp select specific icmp types to match. 
    dest body string traffic destination zone. Must refer to one of the defined zone names, or * for any zone 
    dest_ip body string Match incoming traffic directed to the specified destination ip address 
    dest_port body port or range Match incoming traffic directed at the given destination port or port range 
    mark body string If specified, match traffic against the given firewall mark 
    target body string (Required) Firewall action (ACCEPT, REJECT, DROP, MARK, NOTRACK) for matched traffic
    set_mark body string Zeroes out the bits given by mask and ORs value into the packet mark. 
    set_xmark body string Zeroes out the bits given by mask and XORs value into the packet mark 
    family body string Protocol family (ipv4, ipv6 or any) to generate iptables rules for 
    extra body string Extra arguments to pass to iptables. Useful mainly to specify additional match options, such as -m policy --dir in for IPsec. 


  • Request Example

    PUT /cgi-bin/luci/sdewan/mwan3/v1/rules/reject_lan_80

    {

           "src":"lan",

           "src_ip": "192.168.1.2",

           "src_port": "80",

           "proto":"tcp",

           "target":"REJECT"

    }


...

  • Request Parameters: same with PUT's response request

  • Request Example: same with PUT's response example


Response

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

...

  • Request Parameters:

    NameInTypeDescription
    forwarding-namepathstringforwarding name{other params}bodysame with GET response
    srcbodystring(Required) traffic source zone
    destbodystring(Required) traffic destination zone
    familybodystringProtocol family (ipv4, ipv6 or any) to generate iptables rules for.


  • Request Example

    PUT /cgi-bin/luci/sdewan/mwan3/v1/forwardings/lan_wan

    {

           "src":"lan",

           "dest": "wan"

    }


...