A cross-platform Terminal User Interface (TUI) application for managing network interfaces on macOS, Linux, and Arch Linux. Built with Rust, using ratatui for the UI and crossterm for terminal handling.
- Interface Discovery: Automatically detects all network interfaces on your system
- Interface Type Detection: Identifies Ethernet, WiFi, Loopback, Bridge, Virtual, and Tunnel/VPN interfaces
- WiFi Information: Displays SSID for connected WiFi interfaces
- Detailed Information: View IP addresses (IPv4 and IPv6), MAC addresses, subnet masks, and interface status
- DNS Configuration: Display and edit system DNS servers and search domains
- DNS Cache Flush: Clear system DNS cache with
Ctrl+f(requires sudo) - Detailed View: Press
ito see comprehensive details for the selected interface
- DHCP/Static IP: Toggle between DHCP and static IP configuration
- IPv4 Configuration: Set static IP addresses, netmasks, and gateways
- IPv6 Support: Enable/disable IPv6, configure static IPv6 addresses
- DNS Management: Add, edit, and remove multiple DNS servers and search domains
- Interface Control: Enable/disable network interfaces
- Sortable Table: Sort by any column (interface name, type, IP address, MAC address, subnet mask, DNS servers, status)
- Search & Filter: Case-insensitive search across interface names, types, IP addresses, and MAC addresses
- Pagination: Navigate large numbers of interfaces with keyboard shortcuts
- Clipboard Support: Copy interface details to clipboard
- Confirmation Dialogs: All configuration changes require confirmation before execution
- Integrated Terminal: Execute network commands (ping, traceroute, etc.) without leaving the app
- Help Menu: Comprehensive keyboard shortcuts and usage guide
- Rust 1.70 or later (for building)
- macOS, Linux, or Arch Linux
- sudo privileges (for modifying network configuration)
- Install Rust if you haven't already:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- Clone or navigate to the project directory:
cd /path/to/netutil- Build the project:
cargo build --release- The binary will be available at
target/release/netutil-tui
# Run directly with cargo
cargo run --release
# Or run the binary
./target/release/netutil-tui
# For network configuration changes, run with sudo
sudo ./target/release/netutil-tui↑ork- Move up↓orj- Move downPgUporCtrl+u- Previous pagePgDnorCtrl+d- Next pageHomeorg- Go to first itemEndorG- Go to last item
i- Show detailed interface informationr- Refresh interface datas- Cycle sort column forwardS- Cycle sort column backward/- Enter search mode?- Show help menu
e- Edit IP configuration (DHCP/Static)d- Edit DNS servers and search domains6- Edit IPv6 settingst- Toggle interface up/down
c- Copy selected interface nameCtrl+i- Copy IP addressCtrl+m- Copy MAC address
Ctrl+f- Flush DNS cache (requires sudo)
x- Open integrated terminal- In terminal mode:
- Type commands and press
Enterto execute ↑/↓- Scroll through outputCtrl+l- Clear terminalEsc- Exit terminal
- Type commands and press
q- Quit applicationEsc- Cancel current operation/clear searchTab- Navigate between fields in edit modesEnter- Confirm actionSpace- Toggle options in edit modes
When you press e to edit IP configuration, you can:
- Toggle between DHCP and Static mode using
Space - In Static mode, enter:
- IP Address
- Netmask
- Gateway (optional)
- Use
Tabto move between fields - Press
Enterto apply changes - Confirm the action in the dialog
When you press d to edit DNS configuration, you can:
- Add multiple DNS servers
- Add search domains
- Navigate with
↑/↓arrows - Press
ato add a new entry - Press
xto delete the selected entry - Press
Ctrl+sto save changes - Confirm the action in the dialog
When you press 6 to edit IPv6 configuration, you can:
- Toggle IPv6 on/off using
Space - If enabled, optionally set a static IPv6 address
- Set the prefix length (default: 64)
- Leave address empty for SLAAC (automatic configuration)
- Press
Enterto apply changes - Confirm the action in the dialog
Press i on any interface to see:
- Interface name and type
- Status (UP/DOWN)
- MAC address
- WiFi SSID (for WiFi interfaces)
- MTU
- All IP addresses (IPv4 and IPv6) with netmasks and broadcast addresses
- All DNS servers
- Search domains
- Uses
ifconfigfor interface details - Uses
scutil --dnsfor DNS configuration - Uses
networksetupfor configuration changes and WiFi detection - Uses
airportcommand for WiFi SSID detection - DNS cache flush uses
dscacheutilandmDNSResponder - Network modifications require
sudoprivileges
- Uses
/sys/class/netfor MAC addresses and WiFi detection - Uses
iwgetidoriwfor WiFi SSID detection - Supports both
systemd-resolvedand/etc/resolv.conffor DNS - DNS cache flush supports
resolvectl,systemd-resolve,nscd, anddnsmasq - Uses
ipcommand for network configuration - Uses
sysctlfor IPv6 enable/disable - Network modifications require
sudoprivileges
- Same as Linux
- Ensure
iproute2package is installed for network configuration
The application is structured into several modules:
main.rs- Entry point and terminal setupapp.rs- Application state and logicmodels.rs- Data structures for network interfaces and configurationnetwork.rs- System-specific network interface detectionsudo.rs- Sudo command execution for network configurationui.rs- UI rendering with ratatuievent.rs- Keyboard event handling
- Reading network interface information does not require elevated privileges
- All network configuration changes require sudo privileges
- The application uses
sudo -Sto execute privileged commands - You will be prompted for your password when making configuration changes
- All configuration changes require explicit confirmation
- The application validates inputs before executing system commands
- Navigate to your interface
- Press
eto edit IP configuration - Press
Spaceto switch to Static mode - Use
Tabto navigate fields and enter:- IP: 192.168.1.100
- Netmask: 255.255.255.0
- Gateway: 192.168.1.1
- Press
Enterto proceed - Confirm the action when prompted
- Enter your sudo password when prompted
- Press
dto edit DNS configuration - Use
↑/↓to navigate existing servers - Press
ato add a new server - Type the DNS server IP (e.g., 8.8.8.8)
- Press
Tabto switch to search domains if needed - Press
Ctrl+sto save - Confirm the action when prompted
- Enter your sudo password when prompted
- Navigate to your interface
- Press
6to edit IPv6 configuration - Press
Spaceto toggle IPv6 off - Press
Enterto apply - Confirm the action when prompted
- Enter your sudo password when prompted
- Press
xto open the terminal - Type any command, for example:
ping 8.8.8.8- Test connectivitytraceroute google.com- Trace route to hostnslookup google.com- DNS lookupifconfig en0- Show specific interface detailsnetstat -rn- Show routing table
- Press
Enterto execute - Use
↑/↓to scroll through output - Press
Ctrl+lto clear the terminal - Press
Escto return to main view
Note: Terminal commands run with the same privileges as the app. Use sudo prefix for commands requiring elevation.
- Press
Ctrl+fto flush the DNS cache - Enter your sudo password when prompted
- The cache will be cleared using the appropriate method for your OS:
- macOS: Uses
dscacheutil -flushcacheand restartsmDNSResponder - Linux: Tries
resolvectl,systemd-resolve,nscd, ordnsmasq(whichever is available)
- macOS: Uses
- A status message will confirm success or show any errors
Install Rust using rustup: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Ensure you have network interfaces configured on your system. Run ip addr (Linux) or ifconfig (macOS) to verify.
Make sure you have the necessary system clipboard libraries:
- Linux:
sudo apt-get install xcliporsudo apt-get install xsel - macOS: Built-in, should work out of the box
- macOS: Ensure
scutilis available - Linux: Check
/etc/resolv.conforresolvectl status
- Ensure you're running the application with sudo:
sudo ./target/release/netutil-tui - Check that you have the required tools installed:
- macOS:
networksetup,ifconfig - Linux:
ip,dhclientordhcpcd,sysctl
- macOS:
All network configuration changes require sudo privileges. Make sure you:
- Run the application with
sudowhen making configuration changes - Enter your password when prompted
- Have sudo privileges on the system
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is provided as-is for educational and practical use.
Completed features:
- ✅ Interface type detection (Ethernet, WiFi, VPN, etc.)
- ✅ Detailed interface view
- ✅ DHCP/Static IP configuration
- ✅ Multiple DNS servers support
- ✅ IPv6 configuration
- ✅ IPv6 enable/disable
- ✅ Sudo password prompt support
- ✅ Confirmation dialogs
Future enhancements:
- Route table viewing and editing
- Network statistics and monitoring
- Configuration profiles (save/load network settings)
- Export data to JSON/CSV
- Windows support
- Mouse support for clicking column headers
- Wireless network scanning and connection
- VPN configuration support
- Network diagnostics (ping, traceroute integration)
- Fixed WiFi interface detection on macOS - Now correctly identifies WiFi interfaces (e.g., en1)
- Added WiFi SSID display - Shows connected network name for WiFi interfaces
- Added DNS cache flush - Press
Ctrl+fto clear DNS cache (supports macOS and Linux) - Updated help documentation with new features
- Added interface type detection
- Added detailed interface view (press
i) - Improved IP configuration with DHCP/Static toggle
- Enhanced DNS configuration with multiple servers
- Added IPv6 configuration support
- Added IPv6 enable/disable functionality
- Implemented sudo password prompts
- Added confirmation dialogs for all changes
- Added integrated terminal (press
x) for running network commands - Updated UI with better navigation
- Initial release
- Basic interface listing
- DNS server display
- Search and filter
- Clipboard support
- Basic sorting