Skip to content

NAT ​

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

OperationMethodSummary
getAlgGETGet ALG Info
modifyAlgPUTModify ALG setting
getGridOtoNatsGETGet One-to-One NAT list
createOtoNatPOSTCreate new One-to-One NAT
deleteOtoNatDELETEDelete One-to-One NAT
modifyOtoNatPUTModify One-to-One NAT
getPortForwardingListGETGet port forwarding list
createPortForwardingPOSTCreate new port forwarding
deletePortForwardingDELETEDelete port forwarding
modifyPortForwardingPUTModify port forwarding

getAlg ​

GET /openapi/v1/{omadacId}/sites/{siteId}/nat/alg

Get ALG Info

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
json
// omada_call_operation
{
  "operationId": "getAlg",
  "params": {
    "siteId": "<siteId>"
  }
}
Details, permissions and error codes

Get ALG Info.
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
Site Device Manager View Only

modifyAlg ​

PUT /openapi/v1/{omadacId}/sites/{siteId}/nat/alg

Modify ALG setting

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)

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": "modifyAlg",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify ALG setting.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

getGridOtoNats ​

GET /openapi/v1/{omadacId}/sites/{siteId}/nat/one-to-one-nat

Get One-to-One NAT list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
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": "getGridOtoNats",
  "params": {
    "siteId": "<siteId>"
  }
}
Details, permissions and error codes

Get One-to-One NAT list.
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
Site Device Manager View Only

createOtoNat ​

POST /openapi/v1/{omadacId}/sites/{siteId}/nat/one-to-one-nat

Create new One-to-One NAT

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)

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": "createOtoNat",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create new One-to-One NAT.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

deleteOtoNat ​

DELETE /openapi/v1/{omadacId}/sites/{siteId}/nat/one-to-one-nat/{otonatId}

Delete One-to-One NAT

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
otonatIdpathstringyesOtonat ID
json
// omada_call_operation
{
  "operationId": "deleteOtoNat",
  "params": {
    "siteId": "<siteId>",
    "otonatId": "<otonatId>"
  }
}
Details, permissions and error codes

Delete One-to-One NAT.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

modifyOtoNat ​

PUT /openapi/v1/{omadacId}/sites/{siteId}/nat/one-to-one-nat/{otonatId}

Modify One-to-One NAT

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
otonatIdpathstringyesOtonat 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": "modifyOtoNat",
  "params": {
    "siteId": "<siteId>",
    "otonatId": "<otonatId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify One-to-One NAT.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

getPortForwardingList ​

GET /openapi/v1/{omadacId}/sites/{siteId}/nat/port-forwardings

Get port forwarding list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
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": "getPortForwardingList",
  "params": {
    "siteId": "<siteId>"
  }
}
Details, permissions and error codes

Get port forwarding list.
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
Site Device Manager View Only

createPortForwarding ​

POST /openapi/v1/{omadacId}/sites/{siteId}/nat/port-forwardings

Create new port forwarding

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)

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

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>noThis field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.
virtualWanIdarray<string>noThis field represents Virtual Wan ID. Virtual Wan Id can be obtained from 'Query available virtual WAN list'
existVirtualWanbooleannoWhether Virtual Wan has been configured in current Port Forwarding.
wanIpsarray<PortIpOpenApiVO>noWAN IPs. Wan IPs can be obtained from 'Get internet ports config' interface
existWanIpbooleannoWhether WAN IP has been configured in current Port Forwarding.
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": "createPortForwarding",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create new port forwarding.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33474 - This feature is not supported for the DS-Lite or Map-E WAN connection types.
-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.

deletePortForwarding ​

DELETE /openapi/v1/{omadacId}/sites/{siteId}/nat/port-forwardings/{portForwardingId}

Delete port forwarding

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
portForwardingIdpathstringyesPort Forwarding ID
json
// omada_call_operation
{
  "operationId": "deletePortForwarding",
  "params": {
    "siteId": "<siteId>",
    "portForwardingId": "<portForwardingId>"
  }
}
Details, permissions and error codes

Delete port forwarding.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

modifyPortForwarding ​

PUT /openapi/v1/{omadacId}/sites/{siteId}/nat/port-forwardings/{portForwardingId}

Modify port forwarding

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
portForwardingIdpathstringyesPort Forwarding ID

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

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>noThis field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.
virtualWanIdarray<string>noThis field represents Virtual Wan ID. Virtual Wan Id can be obtained from 'Query available virtual WAN list'
existVirtualWanbooleannoWhether Virtual Wan has been configured in current Port Forwarding.
wanIpsarray<PortIpOpenApiVO>noWAN IPs. Wan IPs can be obtained from 'Get internet ports config' interface
existWanIpbooleannoWhether WAN IP has been configured in current Port Forwarding.
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": "modifyPortForwarding",
  "params": {
    "siteId": "<siteId>",
    "portForwardingId": "<portForwardingId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify port forwarding.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33474 - This feature is not supported for the DS-Lite or Map-E WAN connection types.
-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.

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