This project adds the following capabilities for UPnP devices.
- List routers
- List UPnP ports on a router
- Add a port mapping
- Delete a port mapping
This project does not implement the full SSDP and UPnP specifications.
You need to install the knack command line interface framework.
$ pip3 install --user knack
You should use python-3 to run this tool.
$ python3 main.py router list
$ python3 main.py port list --router <router-uuid>
If not given, the --public-port
option defaults to the value of --private-port
, and --protocol
defaults to TCP
.
$ python3 main.py port add --router <router-uuid> --private-ip <private-ip> --private-port <port> --public-port <port> --protocol <TCP|UDP>
$ python3 main.py port delete --router <router-uuid> --protocol <TCP|UDP> --public-port <port>