Expose your port behind full-cone NAT to the Internet.
python3 natter.py
Or, using Docker:
docker run --net=host nattertool/natter
2023-11-01 01:00:08 [I] Natter
2023-11-01 01:00:08 [I] Tips: Use `--help` to see help messages
2023-11-01 01:00:12 [I]
2023-11-01 01:00:12 [I] tcp://192.168.1.100:13483 <--Natter--> tcp://203.0.113.10:14500
2023-11-01 01:00:12 [I]
2023-11-01 01:00:12 [I] Test mode in on.
2023-11-01 01:00:12 [I] Please check [ http://203.0.113.10:14500 ]
2023-11-01 01:00:12 [I]
2023-11-01 01:00:12 [I] LAN > 192.168.1.100:13483 [ OPEN ]
2023-11-01 01:00:12 [I] LAN > 192.168.1.100:13483 [ OPEN ]
2023-11-01 01:00:12 [I] LAN > 203.0.113.10:14500 [ OPEN ]
2023-11-01 01:00:13 [I] WAN > 203.0.113.10:14500 [ OPEN ]
2023-11-01 01:00:13 [I]
In the example above, 203.0.113.10
is your public IP address outside the full-cone NAT. Natter opened TCP port 203.0.113.10:14500
for testing.
Visit http://203.0.113.10:14500
outside your LAN, you will see the web page:
It works!
--------
Natter
usage: natter.py [--version] [--help] [-v] [-q] [-u] [-k <interval>]
[-s <address>] [-h <address>] [-e <path>] [-i <interface>]
[-b <port>] [-m <method>] [-t <address>] [-p <port>] [-r]
Expose your port behind full-cone NAT to the Internet.
options:
--version, -V show the version of Natter and exit
--help show this help message and exit
-v verbose mode, printing debug messages
-q exit when mapped address is changed
-u UDP mode
-f Add port forwarding through UPNP device.
which maybe improve the mapping success rate under NAT Type 2/3 networks
-k <interval> seconds between each keep-alive
-s <address> hostname or address to STUN server
-h <address> hostname or address to keep-alive server
-e <path> script path for notifying mapped address
bind options:
-i <interface> network interface name or IP to bind
-b <port> port number to bind
forward options:
-m <method> forward method, common values are 'iptables', 'nftables',
'socat', 'gost' and 'socket'
-t <address> IP address of forward target
-p <port> port number of forward target
-r keep retrying until the port of forward target is open
Read natter-docker for details.
Expose local port 80 to the Internet, using built-in forward method:
python3 natter.py -p 80
Expose local port 80 to the Internet, using iptables kernel forward method (requires root permission):
sudo python3 natter.py -m iptables -p 80
If you need port mapping via UPnP
python3 natter.py -p 80 -f
- Python 2.7 (minimum), >= 3.6 (recommended)
- No third-party modules are required.
- If you need UPnP port mapping function, you need to install upnpcclient.
pip install upnpclient
GNU General Public License v3.0