LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pystun3

Discover NAT type using STUN protocol

TLDR

Check NAT type
$ pystun3
copy
Use specific STUN server
$ pystun3 -H [stun.example.com]
copy
Specify source port
$ pystun3 -p [54320]
copy
Use specific interface
$ pystun3 -i [192.168.1.100]
copy
Enable debug logging
$ pystun3 -d
copy
Specify STUN server port
$ pystun3 -H [stun.example.com] -P [3478]
copy

SYNOPSIS

pystun3 [-H server] [-p port] [-i ip] [options]

DESCRIPTION

pystun3 is a STUN (Session Traversal Utilities for NAT) client that discovers the type of NAT between a host and the internet. It communicates with a STUN server to determine the NAT classification (full cone, restricted cone, port restricted, or symmetric) and reports the external IP address and mapped port.Understanding NAT type is essential for configuring VoIP, video conferencing, and peer-to-peer applications that require direct connections between hosts. The tool can target specific STUN servers and bind to particular network interfaces.

PARAMETERS

-H STUNHOST, **--host** STUNHOST

STUN server hostname.
-P STUNPORT, **--host-port** STUNPORT
STUN server port (default: 3478).
-p SOURCEPORT, **--port** SOURCEPORT
Source port to listen on (default: 54320).
-i SOURCEIP, **--interface** SOURCEIP
Network interface for client (default: 0.0.0.0).
-d, --debug
Enable debug logging.
--version
Show program version.

CAVEATS

Requires network access. STUN server must be reachable. NAT types vary.

HISTORY

pystun3 is a Python 3 port of pystun, implementing STUN (Session Traversal Utilities for NAT) client functionality.

SEE ALSO

stun(1), nmap(1), netcat(1)

Copied to clipboard
Kai