Skip to content

NAT (Template) ​

11 operations. Call any of them with omada_call_operation (or, in full tool mode, as a tool named by its operationId).

OperationMethodSummary
getTemplateAlgGETGet site template's ALG Info
modifyTemplateAlgPUTModify site template's ALG setting
getTemplatePortForwardingListGETGet site template's port forwarding list
createTemplatePortForwardingPOSTCreate site template's new port forwarding
deleteTemplatePortForwardingDELETEDelete site template's port forwarding
modifyTemplatePortForwardingPUTModify site template's port forwarding
addOtoNatTemplatesPOSTCreate site template's otonat (deprecated)
getDisableNatGridGETGet siteTemplate's Disable Nat list
addDisableNatPOSTCreate new siteTemplate's Disable Nat
deleteDisableNatDELETEDelete an existing Disable Nat in siteTemplate
modifyDisableNatTemplatePUTModify an existing Disable Nat in siteTemplate

getTemplateAlg ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/nat/alg

Get site template's ALG Info

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
json
// omada_call_operation
{
  "operationId": "getTemplateAlg",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  }
}
Details, permissions and error codes

Get site template's ALG Info.
The interface requires one of the permissions:
Global Site Template Manager View Only

modifyTemplateAlg ​

PUT /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/nat/alg

Modify site template's ALG setting

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID

Request body — application/json (required) — schema ALGSetting

FieldTypeRequiredDescription
ftpbooleanyesWhether to enable the FTP ALG
h323booleanyesWhether to enable the H323 ALG
pptpbooleanyesWhether to enable the PPTP ALG
sipbooleanyesWhether to enable the SIP ALG
ipSecbooleanyesWhether to enable the IPSec ALG
ftpPortsarray<integer>noThe listening port for FTP signaling messages, the default port is 21
sipTcpbooleannoEnable this option if your SIP signaling uses the TCP protocol and the device needs to modify the IP address and port in SIP messages, enabled by default.
sipUdpbooleannoEnable this option if your SIP signaling uses the UDP protocol and the device needs to modify the IP address and port in SIP signaling messages, enabled by default.
sipPortsarray<integer>noThe listening ports for SIP signaling messages, the default ports are 5060 and 5061
sipDirectSignalingbooleannoEnable this option if you want SIP signaling connections to only arrive from registered IP addresses, enabled by default.
sipDirectMediabooleannoEnable this option if you want SIP media connections to only arrive from registered IP addresses.
sipTimeoutbooleannoEnable this option if you want to apply timeout limits to SIP signaling and media connections on the device.
sipSignalingTimeoutintegernoModify this item if you want to adjust the timeout duration for SIP signaling sessions (1 – 86,400 seconds).
sipMediaTimeoutintegernoModify this item if you want to adjust the timeout duration for SIP media sessions (1 – 86,400 seconds).
json
// omada_call_operation
{
  "operationId": "modifyTemplateAlg",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify site template's ALG setting.
The interface requires one of the permissions:
Global Site Template Manager Modify

getTemplatePortForwardingList ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/nat/port-forwardings

Get site template's port forwarding list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
pagequeryintegernoStart page number. Start from 1. (default 1)
pageSizequeryintegernoNumber of entries per page. It should be within the range of 1–1000. (default 100)
json
// omada_call_operation
{
  "operationId": "getTemplatePortForwardingList",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  }
}
Details, permissions and error codes

Get site template's port forwarding list.
The interface requires one of the permissions:
Global Site Template Manager View Only

createTemplatePortForwarding ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/nat/port-forwardings

Create site template's new port forwarding

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID

Request body — application/json (required) — schema PortForwardingTemplateOpenApiVO

FieldTypeRequiredDescription
namestringyesName, name should contain 1 to 64 characters.
statusbooleanyesPort-forwarding enable status.
fromintegeryesFrom corresponds with source IP in web. From should be a value as follows: 0: where; 1: limited address
limitedAddressesarray<string>noOnly for limited address
interfaceWanPortIdarray<string>yesThis field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.
externalPortstringnoExternal port corresponds with source port in web. External port should be within the range of 1–65535. Must be filled in when DMS is false.
forwardIpstringyesForward IP corresponds with destination IP in web. Forward IP
forwardPortstringnoForward port corresponds with destination port in web. Forward port should be 1 or 1-10, within the range of 1–65535. Must be filled in when DMS is false.
protocolintegernoProtocol should be a value as follows: 0: ALL; 1: TCP; 2: UDP. Must be filled in when DMS is false.
dMZbooleanyesWith DMZ enabled, all ports are open and the traffic from external network will be forwarded to the specific destination IP in the LAN.
json
// omada_call_operation
{
  "operationId": "createTemplatePortForwarding",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create site template's new port forwarding.
The interface requires one of the permissions:
Global Site Template Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-34201 - Only one DMZ rule is allowed for one WAN port.
-34209 - Cannot create a port forwarding rule with the same Interface, Source Port, and WAN IP as an existing one. Please modify.
-34245 - The limited IP address range conflict.
-34259 - The Gateway does not support WAN IP in Portforwarding
-34260 - The Gateway does not support select Virtual WAN in Portforwarding
-34261 - The source port already exists for the chosen interface(s). Please change the source port.

deleteTemplatePortForwarding ​

DELETE /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/nat/port-forwardings/{portForwardingId}

Delete site template's port forwarding

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
portForwardingIdpathstringyesPort forwarding ID
json
// omada_call_operation
{
  "operationId": "deleteTemplatePortForwarding",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "portForwardingId": "<portForwardingId>"
  }
}
Details, permissions and error codes

Delete site template's port forwarding.
The interface requires one of the permissions:
Global Site Template Manager Modify

modifyTemplatePortForwarding ​

PUT /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/nat/port-forwardings/{portForwardingId}

Modify site template's port forwarding

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
portForwardingIdpathstringyesPort forwarding ID

Request body — application/json (required) — schema PortForwardingTemplateOpenApiVO

FieldTypeRequiredDescription
namestringyesName, name should contain 1 to 64 characters.
statusbooleanyesPort-forwarding enable status.
fromintegeryesFrom corresponds with source IP in web. From should be a value as follows: 0: where; 1: limited address
limitedAddressesarray<string>noOnly for limited address
interfaceWanPortIdarray<string>yesThis field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.
externalPortstringnoExternal port corresponds with source port in web. External port should be within the range of 1–65535. Must be filled in when DMS is false.
forwardIpstringyesForward IP corresponds with destination IP in web. Forward IP
forwardPortstringnoForward port corresponds with destination port in web. Forward port should be 1 or 1-10, within the range of 1–65535. Must be filled in when DMS is false.
protocolintegernoProtocol should be a value as follows: 0: ALL; 1: TCP; 2: UDP. Must be filled in when DMS is false.
dMZbooleanyesWith DMZ enabled, all ports are open and the traffic from external network will be forwarded to the specific destination IP in the LAN.
json
// omada_call_operation
{
  "operationId": "modifyTemplatePortForwarding",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "portForwardingId": "<portForwardingId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify site template's port forwarding.
The interface requires one of the permissions:
Global Site Template Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-34201 - Only one DMZ rule is allowed for one WAN port.
-34209 - Cannot create a port forwarding rule with the same Interface, Source Port, and WAN IP as an existing one. Please modify.
-34245 - The limited IP address range conflict.
-34259 - The Gateway does not support WAN IP in Portforwarding
-34260 - The Gateway does not support select Virtual WAN in Portforwarding
-34261 - The source port already exists for the chosen interface(s). Please change the source port.

addOtoNatTemplates ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/transmission/otonats

Deprecated

This operation is deprecated.

Create site template's otonat

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID

Request body — application/json (required) — schema OtoNatOpenApiVO

FieldTypeRequiredDescription
namestringyesName, name should contain 1 to 64 characters.
statusbooleanyesStatus
interfaceIdsarray<string>yesThis field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.
internalIpstringyesInternal IP
externalIpstringyesExternal IP
dmzbooleanyesWhether to enable the h323 dmz
descriptionstringnoDescription should contain 1 to 64 characters.
json
// omada_call_operation
{
  "operationId": "addOtoNatTemplates",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create site template's otonat. This interface had been deprecated.
The interface requires one of the permissions:
Global Site Template Manager Modify

getDisableNatGrid ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/wired-networks/disable-nat

Get siteTemplate's Disable Nat list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
pagequeryintegernoStart page number. Start from 1. (default 1)
pageSizequeryintegernoNumber of entries per page. It should be within the range of 1–1000. (default 100)
json
// omada_call_operation
{
  "operationId": "getDisableNatGrid",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  }
}
Details, permissions and error codes

Get siteTemplate's Disable Nat list.
The interface requires one of the permissions:
Global Site Template Manager View Only

addDisableNat ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/wired-networks/disable-nat

Create new siteTemplate's Disable Nat

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID

Request body — application/json (required) — schema Disable Nat

FieldTypeRequiredDescription
namestringyesName of the Disable Nat.
statusbooleanyesThe Status of the Disable Nat.
lanListarray<string>yesA list of Lan of the Disable Nat.
descriptionstringnoThe description of the Disable Nat.
interfacestringyesThe wan of the Disable Nat.
json
// omada_call_operation
{
  "operationId": "addDisableNat",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create new siteTemplate's Disable Nat.
The interface requires one of the permissions:
Global Site Template Manager Modify

deleteDisableNat ​

DELETE /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/wired-networks/disable-nat/{disableNatId}

Delete an existing Disable Nat in siteTemplate

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
disableNatIdpathstringyesDisable Nat ID
json
// omada_call_operation
{
  "operationId": "deleteDisableNat",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "disableNatId": "<disableNatId>"
  }
}
Details, permissions and error codes

Delete an existing Disable Nat in siteTemplate.
The interface requires one of the permissions:
Global Site Template Manager Modify

modifyDisableNatTemplate ​

PUT /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/wired-networks/disable-nat/{disableNatId}

Modify an existing Disable Nat in siteTemplate

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
disableNatIdpathstringyesDisable Nat ID

Request body — application/json (required) — schema Disable Nat

FieldTypeRequiredDescription
namestringyesName of the Disable Nat.
statusbooleanyesThe Status of the Disable Nat.
lanListarray<string>yesA list of Lan of the Disable Nat.
descriptionstringnoThe description of the Disable Nat.
interfacestringyesThe wan of the Disable Nat.
json
// omada_call_operation
{
  "operationId": "modifyDisableNatTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "disableNatId": "<disableNatId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify an existing Disable Nat in siteTemplate.
The interface requires one of the permissions:
Global Site Template Manager Modify

Released under the MIT License. Not affiliated with or endorsed by TP-Link.