A cross-platform NAT type detection tool built with Python and PySide6 (Qt).
  • Python 99%
  • Shell 0.7%
  • Batchfile 0.3%
Find a file
JD 9e004cd79f
All checks were successful
Build Linux / build-linux (push) Successful in 1m22s
docs: add main window screenshot to README
2026-06-20 03:28:18 +08:00
.forgejo CI: generate release notes from CHANGELOG.md 2026-06-20 01:51:59 +08:00
assets docs: add main window screenshot to README 2026-06-20 03:28:18 +08:00
scripts CI: generate release notes from CHANGELOG.md 2026-06-20 01:51:59 +08:00
src Update copyright/authorship to JD Bungart (me@jdneer.com) 2026-06-20 01:51:59 +08:00
tests tests: drop unused imports in test_feature_111 (ruff F401/I001) 2026-06-20 01:55:24 +08:00
.gitignore Initial commit 2026-06-19 04:32:18 +08:00
CHANGELOG.md docs: fold Unreleased items into 1.0.0 ahead of re-cutting the release 2026-06-20 02:02:34 +08:00
conftest.py Initial commit 2026-06-19 04:32:18 +08:00
generate_icons.py Initial commit 2026-06-19 04:32:18 +08:00
init.sh Initial commit 2026-06-19 04:32:18 +08:00
install-linux.sh Initial commit 2026-06-19 04:32:18 +08:00
NatTypeTester-NG.desktop Initial commit 2026-06-19 04:32:18 +08:00
nattypetester.spec CI: replace GitHub workflows with Forgejo Actions; fix Linux packaging 2026-06-20 01:35:21 +08:00
pyproject.toml Update copyright/authorship to JD Bungart (me@jdneer.com) 2026-06-20 01:51:59 +08:00
pytest.ini Initial commit 2026-06-19 04:32:18 +08:00
README.md docs: add main window screenshot to README 2026-06-20 03:28:18 +08:00
RELEASE.md CI: generate release notes from CHANGELOG.md 2026-06-20 01:51:59 +08:00
requirements.txt Initial commit 2026-06-19 04:32:18 +08:00

NatTypeTester-NG

A cross-platform NAT type detection tool built with Python and PySide6 (Qt).

NatTypeTester-NG main window

Download

Pre-built binaries are available from the latest release. No Python installation required.

Platform File Notes
Linux NatTypeTester-NG-linux Single executable, mark as executable with chmod +x
macOS NatTypeTester-NG-macos Single executable, mark as executable with chmod +x
Windows NatTypeTester-NG-windows.exe Double-click to run

Quick Start

Linux / macOS:

chmod +x NatTypeTester-NG-linux   # or NatTypeTester-NG-macos
./NatTypeTester-NG-linux

Windows: Double-click NatTypeTester-NG-windows.exe or run from a terminal.

Overview

NatTypeTester-NG uses STUN (Session Traversal Utilities for NAT) protocols to identify what type of NAT a computer is behind. This is a port of the original .NET/WPF application to Python/Qt for true cross-platform support.

Features

  • Dual Protocol Support

    • Classic RFC 3489 NAT type detection
    • Modern RFC 5389/5780 behavior classification
  • Multiple Transports

    • UDP
    • TCP (modern test, currently not supported)
    • TLS-over-TCP (modern test, currently not supported)
  • Pre-configured STUN Servers

    • Google, Xiaomi, Hot Chilli, Syncthing, and more
    • Custom server support
  • Modern UI

    • Dark/light theme toggle
    • Clear results display
    • Copy results to clipboard

NAT Types Detected

Classic (RFC 3489)

  • Open Internet
  • Symmetric UDP Firewall
  • Full Cone NAT
  • Restricted Cone NAT
  • Port Restricted Cone NAT
  • Symmetric NAT
  • UDP Blocked

Modern (RFC 5389/5780)

Mapping Behavior:

  • Direct (no NAT)
  • Endpoint Independent
  • Address Dependent
  • Address and Port Dependent

Filtering Behavior:

  • Endpoint Independent
  • Address Dependent
  • Address and Port Dependent

Building from Source

Prerequisites

  • Python 3.11 or higher
  • pip package manager

Setup Development Environment

  1. Clone the repository:
git clone https://git.jdneer.com/jd/NatTypeTester-NG.git
cd NatTypeTester-NG
  1. Run the setup script:
./init.sh

Or manually:

python -m venv venv
source venv/bin/activate  # On Linux/macOS
# On Windows: venv\Scripts\activate
pip install -r requirements.txt

Running from Source

source venv/bin/activate
python src/main.py

Building a Binary

The project includes a build script that uses PyInstaller to create a standalone executable:

Linux / macOS:

source venv/bin/activate
python scripts/build.py

Windows:

venv\Scripts\activate
python scripts/build.py

Options:

  • --clean — Remove previous build artifacts before building
  • --verbose — Show detailed build output

The resulting binary will be placed in the dist/ directory.

Automated Builds (CI/CD)

GitHub Actions workflows automatically build binaries for all platforms on every push to tagged releases (v*). See the .github/workflows/ directory for details.

Network Requirements

The application requires outbound access to STUN servers:

  • UDP/TCP port 3478 (standard STUN)
  • TCP port 5349 (STUN over TLS)

Project Structure

NatTypeTester-NG/
├── src/
│   ├── core/          # Settings, configuration
│   ├── transport/     # UDP, TCP, TLS implementations
│   ├── protocol/      # STUN message handling
│   ├── ui/            # PySide6 widgets
│   └── main.py        # Application entry point
├── scripts/
│   └── build.py       # Automated build script
├── tests/             # Unit tests
├── init.sh            # Setup script
└── requirements.txt   # Python dependencies

Linux Desktop Integration

After building the application, you can integrate it into your Linux desktop environment:

# User-level install (no root required)
./install-linux.sh

# System-wide install
sudo ./install-linux.sh system

This installs the binary, desktop entry, and icons to standard XDG locations so NatTypeTester-NG appears in your GNOME, KDE, or other freedesktop-compatible application menu.

License

See LICENSE file for details.