# UPnPPort
Maintains port forwarding in UPnP compatible routers.
## Install
```
pip install upnpport
```
This installs a script called `upnpport`.
## Example use case
With the following configuration file, the daemon will create two
forwarding rules `80 -> 8888` and `22 -> 22`.
```yaml
- port: 8888
external_port: 80
protocol: tcp
- port: 22
protocol: tcp
```
The internal ip used is the one running the daemon.
## Configuration
Configuration files are searched in one of the following
locations. Last configuration file found takes precendence.
* `/etc/upnpport/upnpport.yaml`
* `~/.config/upnpport/upnpport.yaml`
* `./config/upnpport.yaml`
You can override the above list of searched paths by giving the
`--config_files=path[,path,...]` argument.
Adding or removing rules to a configuration file is done by using the
`configure` argument:
```
upnpport <config_file.yaml> add [--protocol {tcp,udp}] [--external_port EXTERNAL_PORT] port
upnpport <config_file.yaml> del [--protocol {tcp,udp}] [--external_port EXTERNAL_PORT] port
```
## Run
Running the daemon is done by using the `run` argument:
```
upnpport run [--config_files CONFIG_FILES]
```
## Using systemd
The daemon can start when the system starts by creating a systemd unit
file like the following one in `/etc/systemd/system/upnpport.service`.
```
[Unit]
Description=UPnPPort service
After=network.target
[Service]
User=upnpport
Group=upnpport
ExecStart=/usr/bin/upnpport
[Install]
WantedBy=default.target
```
I advice running the daemon with a non-root user. A system user can be
created with `useradd --system upnpport`.
Maintains port forwarding in UPnP compatible routers.
## Install
```
pip install upnpport
```
This installs a script called `upnpport`.
## Example use case
With the following configuration file, the daemon will create two
forwarding rules `80 -> 8888` and `22 -> 22`.
```yaml
- port: 8888
external_port: 80
protocol: tcp
- port: 22
protocol: tcp
```
The internal ip used is the one running the daemon.
## Configuration
Configuration files are searched in one of the following
locations. Last configuration file found takes precendence.
* `/etc/upnpport/upnpport.yaml`
* `~/.config/upnpport/upnpport.yaml`
* `./config/upnpport.yaml`
You can override the above list of searched paths by giving the
`--config_files=path[,path,...]` argument.
Adding or removing rules to a configuration file is done by using the
`configure` argument:
```
upnpport <config_file.yaml> add [--protocol {tcp,udp}] [--external_port EXTERNAL_PORT] port
upnpport <config_file.yaml> del [--protocol {tcp,udp}] [--external_port EXTERNAL_PORT] port
```
## Run
Running the daemon is done by using the `run` argument:
```
upnpport run [--config_files CONFIG_FILES]
```
## Using systemd
The daemon can start when the system starts by creating a systemd unit
file like the following one in `/etc/systemd/system/upnpport.service`.
```
[Unit]
Description=UPnPPort service
After=network.target
[Service]
User=upnpport
Group=upnpport
ExecStart=/usr/bin/upnpport
[Install]
WantedBy=default.target
```
I advice running the daemon with a non-root user. A system user can be
created with `useradd --system upnpport`.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
UPnPPort-0.1.0.tar.gz
(4.1 kB
view details)
File details
Details for the file UPnPPort-0.1.0.tar.gz.
File metadata
- Download URL: UPnPPort-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
741c1d669e54f94ee1481bf25b9db4674eb10896883c037b8beff3798b6ccb8f
|
|
| MD5 |
eba3e8bd4e3a21d2688a78aeeb948721
|
|
| BLAKE2b-256 |
109d4e8c8da1360652697c00204c58d81f83cfc918b81b436ed1e9719eaf786c
|