Skip to content

yurt-page/natpmpd

Repository files navigation

NAT Port Mapping daemon
=======================

Introduction
------------
This is a daemon implementing NAT-PMP.

NAT-PMP is a protocol for handling port forwarding requests from clients
behind a NAT. NAT-PMP specifications are available at:
  http://files.dns-sd.org/draft-cheshire-nat-pmp.txt

Author
------
The main author of this program is
  Adrian Friedli <adi@koalatux.ch>

Bugs
----
Please report bugs with the bug tracking system on the project page.
  http://savannah.nongnu.org/projects/natpmp/

Supported Platforms
-------------------
GNU/Linux support is done with iptables system calls. 
A nicer interface to the kernel is not planned because there's no stable
API to use. If you really want to struggle with libiptc, you are welcome.

Other OSes support would not be a big deal. Write me, if you're planning to
port some code. But you need GCC to compile this program.

Features beyond the specifications
----------------------------------
* Multiple private interfaces supported.
* Configurable range for mapable ports.
* Configurable limit for lifetime.
* A little test suite written in bash.

Limitations
-----------
* "Companion ports" are only acquirable to the same private port number.
  But that should not harm. You can also consider this as a feature.
* Leases are not permanent over reboots. But this is not required by the
  specifications. It even could be harmful if clients could not delete a
  mapping while the machine is rebooting.

See the TODO file for things that might be implemented sometime.

Installation
------------
You need gcc to compile. To build the binary just type `make'. If you
downloaded from git and if you want the manpage type `make man', releases
should have a prebuilt manpage. `make install' only installs the binary to
/usr/sbin, install the init script and the manpage manually if you want
them. The init script needs `ip' from iproute to run.
If your iptables binary is not in /sbin, you have to define it with the
IPTABLES_PATH macro, e.g. run before compile:
	export CPPFLAGS=-DIPTABLES_PATH=\\\"/usr/sbin\\\"