pytun-pmd3
python-pytun fork with darwin and windows support (IPv6-ONLY)
What it is and what it does
pytun-pmd3 is a Python wrapper around the TUN/TAP interface creation and management APIs on Linux and macOS. It allows developers to programmatically create virtual network interfaces at the packet level, enabling use cases like network tunneling, packet filtering, and custom network protocol implementation. The package is a fork of the original pytun project with added support for Darwin (macOS) and Windows keywords, though support is described as partial.
The package has no external runtime dependencies, making installation straightforward. It supports Python 3.9 through 3.13 and requires at least Python 3.8. The codebase is aging with infrequent updates, and the small repository size suggests it serves a niche audience. Users should be aware that creating TUN/TAP interfaces typically requires elevated privileges (root or capabilities) on the host system.
Use it for:
- Build VPN or tunneling applications that need direct control over virtual network interfaces
- Implement custom network protocols or packet filters at the kernel interface level
- Create network simulation or testing environments that require virtual network devices
- Develop tools for network packet capture and manipulation on macOS or Linux systems
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings to create and manage TUN/TAP virtual network interfaces on Linux and Darwin (macOS), enabling low-level network packet manipulation and tunneling.
Yes, if you need TUN/TAP interface control on Linux or macOS and accept the copyleft license. The low install friction and lack of dependencies make it straightforward to add. However, the aging maintenance status and small user base mean you should verify that Darwin support meets your needs and be prepared to maintain a fork if critical bugs emerge.
Install
pytun-pmd3 on PyPI
pip
pip install pytun-pmd3uv
uv add pytun-pmd3poetry
poetry add pytun-pmd3Installing pytun-pmd3
Before you install
Low install friction with no runtime dependencies. Maintenance status is aging—last commit was 2026-01-27 and the repository has only 8 stars, suggesting limited active development and a small user base.
License in practice
Licensed under GPLv3+, a copyleft license requiring derivative works and modifications to be distributed under the same terms. Use is unrestricted for private purposes, but redistribution of modified versions must include source code.
Quickstart
pip install pytun-pmd3
import pytun
# Create a TUN interface
tun = pytun.TunTapDevice(name='tun0', flags=pytun.IFF_TUN)
tun.up()
# Read/write packets from/to the interface
Requires root or appropriate capabilities to create TUN/TAP interfaces on Linux; macOS support is partial and may require system configuration.
Verify before relying
- Extent of Darwin/macOS support and any known limitations or missing features compared to Linux
- Whether IPv6-only mode is a hard requirement or a configuration option
- Current maintenance status and likelihood of future updates or bug fixes
Package facts
| License | Copyright (c) 2011, montag451. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the… (full text in the JSON record) (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 199 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 320,958/month — #7,627 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytun_pmd3-3.0.3-py3-none-any.whl
Keywords: tun, tuntap, darwin, pymobiledevice3, macos, windows
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pmd-pytcpA pure-Python TCP/IP stack (Ethernet through…
copyleft · top 15,000 on PyPI
dpktdpkt parses and creates TCP/IP protocol packets…
permissive · top 5,000 on PyPI
pmd-net-protoParses, assembles, and validates network…
copyleft · top 15,000 on PyPI
sshuttlesshuttle creates a transparent proxy that…
copyleft · top 15,000 on PyPI
pyobjc-framework-NetworkProvides Python bindings to Apple's Network…
permissive · top 15,000 on PyPI
pydivertPyDivert is a Python binding for the WinDivert…
copyleft · top 15,000 on PyPI
ping3Ping3 sends ICMP echo requests to hosts and…
permissive · top 15,000 on PyPI
wakeonlanSends wake-on-LAN magic packets to power on…
permissive · top 15,000 on PyPI
pyroute2Pyroute2 is a pure Python networking framework…
unclear · top 5,000 on PyPI
pymobiledevice3A pure Python library and command-line tool for…
copyleft · top 15,000 on PyPI