UPnP IGD¶
The UPnP IGD API allow you to control the settings of the Universal Plug n’ Play Internet Gateway Device service. This service allow hosts on your local network to manage nat redirections.
UPnP IGD Errors¶
When attempting to access the UPnP IGD API, you may encounter the following errors:
| error_code | Description |
|---|---|
| disabled | the service is disabled |
| noent | invalid rule id |
UPnP IGD Config¶
UPnPIGDConfig has the following attributes:
UPnP IGD config API¶
Get the current UPnP IGD configuration¶
-
GET/api/v4/upnpigd/config/¶ Get the
UPnPIGDConfigExample request:
GET /api/v4/upnpigd/config/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "enabled": false, "version": 1 } }
Update the UPnP IGD configuration¶
-
PUT/api/v4/upnpigd/config/¶ Update the
UPnPIGDConfigExample request:
PUT /api/v4/upnpigd/config/ HTTP/1.1 Host: mafreebox.freebox.fr
{ "enabled": true, "version": 2 }
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "enabled": true, "version": 2 } }
UPnP IGD Redirection¶
UPnPRedir has the following attributes:
-
UPnPRedir¶ -
idstring Read-only¶ the redirection id
-
enabledbool Read-only¶ is the redirection enabled
-
ext_src_ipstring Read-only¶ source IP
-
ext_portint Read-only¶ external port
-
int_ipstring Read-only¶ the target IP on your LAN
-
int_portint Read-only¶ the target port on your LAN
-
protostring Read-only¶ the IP protocol to redirect
-
descstring Read-only¶ a description
-
remainingint Read-only¶ seconds remaining before redirection expire
-
UPnP IGD Redirection API¶
Get the list of current redirection¶
-
GET/api/v4/upnpigd/redir/¶ Get the list of
UPnPRedirredirectionsExample request:
GET /api/v4/upnpigd/redir/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": [ { "enabled": true, "proto": "udp", "id": "0.0.0.0-53644-udp", "desc": "iC53644", "remaining": 0, "ext_src_ip": "0.0.0.0", "int_port": 16402, "int_ip": "192.168.1.44", "ext_port": 53644 } ] }