A powerful, cross-platform network management tool written in Rust, inspired by Windows' netsh but designed to work seamlessly on Linux, macOS, and Windows.
- Interface Management - Show, configure, and manage network interfaces
- Routing Management - View and modify routing tables
- Firewall Management - Configure firewall rules across platforms
- Port Forwarding - Set up and manage port forwards
- DNS Configuration - Manage DNS settings
- Bandwidth Management - Traffic shaping and QoS
- Tunnel Management - Create and manage network tunnels
- Network Diagnostics - Connectivity tests, port scanning, bandwidth monitoring
π Root/Administrator privileges required: This tool modifies system network settings and requires elevated privileges to function properly.
π Platform Compatibility: While designed to be cross-platform, some features may have limited functionality on certain platforms due to OS-specific networking implementations.
- Rust 1.70+ (for building from source)
- Platform-specific network tools:
- Linux:
ip,iptables,tc - Windows:
netsh,powershell - macOS:
networksetup,scutil,pfctl
- Linux:
-
Clone the repository: ```bash git clone https://github.com/RimakiTaema/netmgr.git cd netmgr ```
-
Build for your platform: ```bash cargo build --release ```
-
Install (Linux/macOS): ```bash sudo cp target/release/netmgr /usr/local/bin/ ```
To build for multiple platforms:
```bash make build-all ```
This will create binaries for various platforms in the target directory.
```bash netmgr [parameters...] ```
-v, --verbose: Enable verbose output-n, --dry-run: Show what would be done without executing-f, --force: Force operations without confirmation-h, --help: Show help
```bash
netmgr interface show
netmgr interface show eth0
netmgr interface set eth0 ip 192.168.1.100 24
netmgr interface set eth0 up netmgr interface set eth0 down
netmgr interface set eth0 mtu 1500 ```
```bash
netmgr route show
netmgr route add 10.0.0.0/8 --via 192.168.1.1
netmgr route delete 10.0.0.0/8 ```
```bash
netmgr firewall show
netmgr firewall rule allow 22 tcp
netmgr firewall rule deny 25 tcp
netmgr firewall rule flush ```
```bash
netmgr forward show
netmgr forward add web 80 192.168.1.100 8080 --protocol tcp
netmgr forward remove web ```
```bash
netmgr dns show
netmgr dns set 8.8.8.8 1.1.1.1 ```
```bash
netmgr bandwidth show eth0
netmgr bandwidth limit eth0 100mbit ```
```bash
netmgr diag connectivity google.com --count 5
netmgr diag ports 192.168.1.1 22,80,443
netmgr diag bandwidth eth0 --duration 30 ```
NetMgr is built with a modular architecture:
- CLI Layer - Command parsing and user interface
- Common Layer - Shared utilities, configuration, and platform detection
- Module Layer - Feature-specific implementations
- Platform Layer - OS-specific command execution
- Memory Safety - Written in Rust for guaranteed memory safety
- Cross-Platform - Single codebase supporting Linux, Windows, and macOS
- Async Operations - Built on Tokio for efficient I/O operations
- Configuration Management - JSON-based configuration with automatic backups
- Comprehensive Logging - Detailed logging with multiple levels
- Dry-Run Mode - Test commands without making changes
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Windows
netshcommand - Built with the amazing Rust ecosystem
- Thanks to all contributors and testers