A modern, lightweight TUI (Terminal User Interface) application for managing network interfaces on Linux systems. Lantern provides an intuitive interface for configuring network settings through systemd-networkd, offering a clean alternative to traditional network management tools.
- Real-time interface monitoring - Live statistics for RX/TX bytes, packets, and errors
- Static and DHCP configuration - Easy switching between automatic and manual network setup
- IPv4 and IPv6 support - Full dual-stack networking with modern protocols
- systemd-networkd integration - Native support for systemd-based network management
- WiFi management - Network scanning, WPA/WPA2/WPA3 authentication, and connection management
- VPN support - WireGuard configuration and management
- Interface control - Bring interfaces up/down with real-time status updates
- Configuration persistence - All settings persist across reboots via systemd-networkd
- Intuitive TUI - Clean, responsive terminal interface built with Ratatui
- Keyboard navigation - Vim-like keybindings for efficient operation
- Real-time updates - Live network statistics and status monitoring
- Error handling - Comprehensive error messages and recovery suggestions
Lantern requires a Linux system with:
- systemd-networkd enabled
- Root privileges for network configuration
- System tools:
ip,iw,wg(for wireless and VPN features)
# Clone the repository
git clone https://github.com/yourusername/lantern.git
cd lantern
# Build the release version
cargo build --release
# Install (optional)
sudo cp target/release/lantern /usr/local/bin/# Arch Linux
sudo pacman -S iproute2 wireless-tools wireguard-tools
# Ubuntu/Debian
sudo apt install iproute2 wireless-tools wireguard-tools
# Fedora
sudo dnf install iproute wireless-tools wireguard-tools# Enable and start systemd-networkd
sudo systemctl enable --now systemd-networkd
sudo systemctl enable --now systemd-resolved# Run with root privileges (required for network configuration)
sudo lanternIf you encounter terminal issues: Some terminal emulators or SSH sessions may have compatibility issues with TUI applications under sudo. If you see terminal setup errors, try:
# Switch to root user first, then run
su - root
lantern
# Or for SSH sessions
ssh -t user@host sudo lantern┌─────────────────────────────────────────────────────────────────┐
│ Lantern - Network Interface Manager │
├─────────────────────────┬───────────────────────────────────────┤
│ Interfaces [↑/↓ to nav] │ Statistics [Enter for details] │
│ │ │
│ eth0 UP 192.168.│ Network Statistics │
│ wlan0 DOWN No IP │ │
│ lo UP 127.0.0.│ ↓ RX: 45.2 MB │
│ │ Packets: 1,234 │
│ │ Errors: 0 │
│ │ │
│ │ ↑ TX: 12.8 MB │
│ │ Packets: 892 │
│ │ Errors: 0 │
└─────────────────────────┴───────────────────────────────────────┘
│ ^Q: Quit | ^R: Refresh | e: Edit | u: Up/Down | Enter: Details │
└─────────────────────────────────────────────────────────────────┘
| Key | Action |
|---|---|
↑/↓ or j/k |
Navigate interfaces |
Enter |
Toggle details/statistics view |
e |
Edit interface configuration |
u |
Toggle interface up/down |
Ctrl+R |
Refresh interface data |
Ctrl+Q |
Quit application |
When editing an interface (e key):
┌──────────────── Edit eth0 ────────────────┐
│ │
│ DHCP: [✓] Enabled (press 'd' to toggle) │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ IP Address │ │
│ │ 192.168.1.100/24 │ │
│ └─────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ Gateway │ │
│ │ 192.168.1.1 │ │
│ └─────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ DNS Servers (comma separated) │ │
│ │ 8.8.8.8, 1.1.1.1 │ │
│ └─────────────────────────────────────┘ │
│ │
│ Tab: Next field | s: Save | Esc: Cancel │
└───────────────────────────────────────────┘
Lantern creates systemd-networkd configuration files in /etc/systemd/network/:
- Ethernet:
10-<interface>.network - WiFi:
25-<interface>.network+ wpa_supplicant config - VPN:
50-<interface>.netdevand50-<interface>.network
Static IP configuration for eth0:
[Match]
Name=eth0
[Network]
Address=192.168.1.100/24
Gateway=192.168.1.1
DNS=8.8.8.8
DNS=1.1.1.1
[Link]
RequiredForOnline=yes- Network Scanning: Discover available WiFi networks
- Security Support: WPA/WPA2/WPA3, WEP, and open networks
- Connection Management: Save and manage WiFi profiles
- Dual-stack networking: Simultaneous IPv4 and IPv6
- SLAAC and DHCPv6: Automatic IPv6 configuration
- Privacy extensions: Enhanced privacy for IPv6 addresses
- Native WireGuard support: Create and manage VPN connections
- Key generation: Automatic cryptographic key creation
- Configuration import: Support for standard WireGuard config files
"Permission denied" errors
# Ensure you're running as root
sudo lantern"systemd-networkd not running"
# Enable and start systemd-networkd
sudo systemctl enable --now systemd-networkd
sudo systemctl enable --now systemd-resolved"Command not found: ip/iw/wg"
# Install required system tools (see Installation section)Interface changes not applying
# Restart systemd-networkd
sudo systemctl restart systemd-networkd
# Or reload configuration
sudo networkctl reload
sudo networkctl reconfigure <interface># Check systemd-networkd status
sudo systemctl status systemd-networkd
# View network logs
sudo journalctl -u systemd-networkd -f
# Check interface status
networkctl status
# Verify configuration files
ls -la /etc/systemd/network/Lantern follows these core principles:
- Simplicity: Clean, intuitive interface focused on essential networking tasks
- Integration: Native systemd-networkd support for modern Linux systems
- Performance: Optimized for low resource usage and responsive operation
- Reliability: Comprehensive error handling and graceful failure recovery
- OS: Linux with systemd
- Memory: < 10MB RAM usage
- CPU: Minimal CPU usage (< 1% during normal operation)
- Storage: 1.9MB binary size
- Network: systemd-networkd and systemd-resolved
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
git clone https://github.com/yourusername/lantern.git
cd lantern
cargo build
cargo testsrc/main.rs- Application entry point and event loopsrc/app.rs- Application state managementsrc/network.rs- Network interface operationssrc/systemd.rs- systemd-networkd configurationsrc/ui.rs- Terminal user interfacesrc/config.rs- Configuration managementsrc/utils.rs- Utility functions
This project is licensed under the GNU General Public License v3.0 - see the LICENCE file for details.
- Built with Ratatui for the excellent TUI framework
- Inspired by
nmtuiand other network management tools - Thanks to the Rust community for the amazing ecosystem
Note: Lantern is designed as an alternative to NetworkManager for users who prefer systemd-networkd. It provides a modern, efficient approach to network management on systemd-based Linux distributions.