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
UPnPIGDConfig
Example 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
UPnPIGDConfig
Example 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
¶ -
id
string Read-only¶ the redirection id
-
enabled
bool Read-only¶ is the redirection enabled
-
ext_src_ip
string Read-only¶ source IP
-
ext_port
int Read-only¶ external port
-
int_ip
string Read-only¶ the target IP on your LAN
-
int_port
int Read-only¶ the target port on your LAN
-
proto
string Read-only¶ the IP protocol to redirect
-
desc
string Read-only¶ a description
-
remaining
int 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
UPnPRedir
redirectionsExample 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 } ] }