fport
Simple port-forwarding utility using the NAT-PMP protocol.
Installation
Install the Rust lang toolchain from here. Then run the following command in your favorite terminal to build and install fport;
$ cargo install --git https://github.com/quillx01/fport
Using pre-compiled binaries
The pre-compiled binaries are also available on the releases page.
Usage
If your default gateway is different from
192.168.1.1
make sure to explicitly specify it. For example;fport --gateway 192.168.0.1 ip
,fport -g 192.168.0.1 map 80
.
To get help run the following command;
$ fport --help
To get the public IP address from the router run the following command;
$ fport ip
To map the external port 23722
to the local port 80
on your computer with a lifetime of 300
seconds run;
$ fport map 23722 -r 80 -l 300
Common problems
If the program returns a Networking error
the default gateway might be different from 192.168.1.1
(see above) or the NAT-PMP protocol is not supported by your router.