Bind applications to specific network interfaces with ease
Features β’ Installation β’ Usage β’ Architecture β’ Contributing
InterMux is a powerful Linux utility that enables you to bind applications to specific network interfaces. Whether you need to route your browser through Wi-Fi while keeping your development server on Ethernet, or isolate applications for security testing, InterMux makes it simple.
Privacy Note: InterMux sets up network namespaces as root, but launches all applications as your regular user β your bookmarks, cookies, and app settings are always preserved.
- Multi-WAN Management: Route different applications through different internet connections
- Network Testing: Test applications on specific network interfaces
- Security Isolation: Isolate applications in separate network namespaces
- Bandwidth Management: Control which apps use which network connections
- Development: Test network-dependent applications across different interfaces
I was downloading a large file via torrent, and while waiting, I opened YouTube to pass the time. But the videos were stuck on low quality, buffering like crazy β even though my connection showed 300 Mbps.
Turns out, the torrent was consuming all the bandwidth, and YouTube was left starving. Thatβs when I had the idea: βWhat if I could assign different apps to different networks?β
After some research, I found that while Linux supports advanced networking, there wasnβt a simple tool to do what I needed β especially one that was GUI-friendly and straightforward.
So I built InterMux: A utility that lets me bind any app to a specific interface with ease β no messy configs, no guesswork, just full control.
|
|
Ubuntu / Debian / Mint
sudo apt update
sudo apt install -y python3 python3-pip iproute2 iptables policykit-1 x11-xserver-utilsArch / EndeavourOS / Manjaro
sudo pacman -S python python-pip iproute2 iptables polkit xorg-xhostFedora / RHEL / Rocky
sudo dnf install -y python3 python3-pip iproute iptables polkit xorg-x11-server-utilsopenSUSE
sudo zypper install python3 python3-pip iproute2 iptables polkit xorg-x11-xhost- Note for Ubuntu 24.04+ users: Some Python modules (like brotli) may require system-level installation.
# If pip fails
sudo apt install python3-brotli# Clone the repository
git clone https://github.com/Rishi-Bhati/intermux.git
cd intermux
# Python Virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip3 install -r requirements.txtpython3 cli.py check- You can explicitly install these packeges, if all the above given installation steps fails.
Brotli==1.1.0
click==8.2.1
markdown2==2.5.3
MarkupSafe==3.0.2
minijinja==2.11.0
page==0.3
PyYAML==6.0.2
tk==0.1.0
python3 gui/app.pyThe GUI requests root via pkexec (falls back to sudo). Apps always launch as your regular user β your profile data is preserved.
GUI Features
- Interface Selection: Dropdown with all active physical interfaces (virtual adapters like veth/docker are auto-hidden)
- Application Binding: Enter app path and assign to an interface
- Running App Detection: Prompts to close & reopen (default profile) or open new instance
- Session Awareness: Auto-detects X11 or Wayland
- Dependency Banner: Warns about missing system tools
sudo python3 cli.py listsudo python3 cli.py assign --app /usr/lib/firefox/firefox --iface wlan0If Firefox is already open, you'll be prompted:
[!] 'firefox' is already running (PID(s): [12345]).
Options:
1) Close current instance and reopen on the selected network (uses your default profile)
2) Open a new instance with a separate profile
3) Cancel
Enter choice [1/2/3]:
python3 cli.py checksudo python3 cli.py clearsudo python3 cli.py resetintermux/
βββ core/ # Core functionality
β βββ interface.py # Network interface detection (cross-distro)
β βββ router.py # Routing table management
β βββ platform_utils.py # β
Distro detection, display/DNS/user helpers
βββ gui/ # GUI components
β βββ app.py # Main GUI application
β βββ gui.py # Legacy GUI interface
βββ cli.py # CLI entrypoint
βββ requirements.txt # Python dependencies
βββ README.md # This file
- Interface Detection: Scans system for all network interfaces using
ipcommands - Routing Tables: Creates custom routing tables in
/etc/iproute2/rt_tables - Network Namespaces: Isolates network traffic using Linux network namespaces
- Virtual Interfaces: Uses veth pairs to connect namespaces to physical interfaces
- IP Forwarding: Configures NAT/masquerading for namespace connectivity
- Privilege Separation: Namespace setup runs as root; apps launch as your user via
sudo -u - DNS Resolution: Writes real upstream DNS servers to namespace (handles
systemd-resolvedstubs)
| Operation | Runs As |
|---|---|
| Create network namespace | root |
| Configure veth / routing / NAT | root |
| Write namespace resolv.conf | root |
| Launch your application | your regular user |
Edit core/router.py:
BASE_TABLE_ID = 100 # Starting table ID
BASE_PRIORITY = 1000 # Starting priorityGUI doesn't launch on Wayland
InterMux auto-detects Wayland. If issues occur, ensure xwayland is installed:
# Arch
sudo pacman -S xorg-xwayland
# Ubuntu/Debian
sudo apt install xwaylandPermission denied errors
sudo python3 cli.py assign --app /usr/lib/firefox/firefox --iface wlan0Interface not detected
ip link show
sudo ip link set <interface> upNo internet in namespace / DNS failures
python3 cli.py check
sudo sysctl -w net.ipv4.ip_forward=1InterMux automatically logs all activity, commands, and errors to a persistent log file:
~/.local/share/intermux/intermux.logThis log includes detailed debug information and full stack traces, which is highly recommended to include when reporting issues.
- β Firefox: Fully supported β uses your existing profile, prompts if already running
- β Chromium: Not supported due to sandboxing conflicts with network namespaces
- β Most other apps: GUI and CLI applications work correctly
- β Linux (all major distros): Arch, Ubuntu, Debian, Fedora, openSUSE, Manjaro, EndeavourOS, etc.
- β X11 and Wayland: Both session types supported
- β Windows 10 / 11: Phase 1 supported via SOCKS5 proxy binding β see windows/README.md
- Root privileges for network namespace operations
- Linux kernel with
CONFIG_NET_NS iproute2for network management
Contributions are welcome! Please submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes
- Push and open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Python and Tkinter
- Uses Linux networking stack (iproute2)
- Inspired by the need for better network interface management
- π Report bugs
- π‘ Request features
InterMux now supports Windows 10 and 11 via a SOCKS5 proxy engine. See windows/README.md for full installation and usage instructions.
windows/
βββ gui/app.py β GUI (same dark theme)
βββ cli.py β CLI (same commands)
βββ core/ β Windows-specific engine
βββ intermux_windows.spec β PyInstaller β .exe
