portforwarder-rs

Crates.ioportforwarder-rs
lib.rsportforwarder-rs
version0.1.1
sourcesrc
created_at2018-02-17 18:21:53.819706
updated_at2024-07-23 07:29:06.416945
descriptionForwards ports on UPnP-enabled gateways. Inspired by portmapper (written in Java). Command line and lib.
homepagehttps://github.com/pzmarzly/portforwarder-rs
repositoryhttps://github.com/pzmarzly/portforwarder-rs
max_upload_size
id51620
size23,748
Paweł Zmarzły (pzmarzly)

documentation

README

Port forwarder

Connects to UPnP-enabled gateways and redirects ports. Inspired by portmapper (written in Java). Abstraction over igd crate. Tested on Zhone Access Point with 2014 firmware (it cannot list opened ports, so I did not try to implement such feature).

This crate consists of binary pf and simple library abstracting over port forwarding and network interface listing.

This crate HAS NOT BEEN TESTED ON WINDOWS OR MACOS.

Building

Install the utility using command:

cargo install portforwarder-rs

or build from source with:

git clone https://github.com/pzmarzly/portforwarder-rs
cd portforwarder-rs
cargo build --release
mv target/release/pf <some place>

Usage

Redirect ports on first-matched device:

pf any TCP/80/80 UDP/3000/2000 TCP/81/82

Format is {TCP|UDP}/LOCAL_PORT/REMOTE_PORT.

Redirect ports on a network interface with specific IPv4 address:

pf 192.168.254.107 TCP/8080/8080
Commit count: 9

cargo fmt