Skip to content

Latest commit

 

History

History
310 lines (225 loc) · 6.59 KB

File metadata and controls

310 lines (225 loc) · 6.59 KB

🚀 NetworkOptimizer

Fast, simple network optimization for macOS.

Maximize speed • Minimize latency • Zero buffering


📋 Table of Contents


⚡ Features

Feature What it does
TCP Optimization 4MB buffers, disabled delayed ACK for low latency
DNS Optimization Cloudflare 1.1.1.1 - fastest public DNS
VPN Integration Cloudflare WARP with MASQUE/HTTP3 protocol
Firewall Hardening Stealth mode, block unsolicited connections
Boot Optimization Auto-apply settings on login (optional)
CLI Tool Simple netopt command for all controls

📦 Requirements

  • macOS Sonoma 14.x or later
  • Cloudflare WARP (optional, for VPN features): Download here
  • Admin access (for network settings)

🔧 Installation

Step 1: Clone the Repository

git clone https://github.com/Adi-gitX/NetworkOptimizer.git
cd NetworkOptimizer

Step 2: Make Scripts Executable

chmod +x scripts/*.sh scripts/netopt tools/*.sh

Step 3: Install CLI Tool (Recommended)

sudo cp scripts/netopt /usr/local/bin/netopt
sudo chmod +x /usr/local/bin/netopt

Now you can use netopt from anywhere!

Step 4: Enable Auto-Start on Boot (Optional)

# Copy the plist file
cp launchd/com.networkoptimizer.boot.plist ~/Library/LaunchAgents/

# Load it
launchctl load ~/Library/LaunchAgents/com.networkoptimizer.boot.plist

🚀 Quick Start

One Command Optimization

# If netopt installed globally:
netopt start

# Or run directly:
./scripts/netopt start

This applies ALL optimizations:

  • ✓ TCP buffers set to 4MB
  • ✓ Delayed ACK disabled
  • ✓ DNS set to Cloudflare 1.1.1.1
  • ✓ VPN connected (if WARP installed)
  • ✓ Firewall enabled with stealth mode

Check Status

netopt status

Run Speed Test

netopt speed

Stop Everything

netopt stop

📖 Usage

CLI Commands

netopt <command> [option]
Command Description
netopt start Apply all optimizations
netopt stop Stop VPN and reset DNS
netopt status Show current network status
netopt speed Run speed and latency tests
netopt vpn on/off/status Control VPN
netopt dns cloudflare/google/auto Change DNS server
netopt tcp apply/reset/status Control TCP settings
netopt firewall on/off/stealth Control firewall
netopt reset Reset everything to defaults
netopt help Show help

Examples

# Connect VPN only
netopt vpn on

# Switch to Google DNS
netopt dns google

# Enable stealth firewall
netopt firewall stealth

# Check everything
netopt status

📁 Project Structure

NetworkOptimizer/
├── README.md                    # This file
├── LICENSE                      # MIT License
├── .gitignore                   # Git ignore rules
│
├── scripts/                     # All scripts
│   ├── netopt                   # 🔥 Main CLI tool
│   ├── full-optimize.sh         # Apply all optimizations
│   ├── tcp-optimize.sh          # TCP/IP tuning
│   ├── dns-setup.sh             # DNS configuration
│   ├── warp-config.sh           # WARP VPN setup
│   ├── network-reset.sh         # Reset network
│   ├── speed-test.sh            # Speed testing
│   ├── health-check.sh          # Diagnostics
│   └── network-boot.sh          # Boot script
│
├── configs/                     # Configuration files
│   ├── sysctl.conf              # Persistent TCP settings
│   └── chrome-policies.json     # Browser DNS bypass
│
├── launchd/                     # Auto-start on boot
│   └── com.networkoptimizer.boot.plist
│
├── tools/                       # Utilities
│   └── network-monitor.sh       # Real-time monitoring
│
└── docs/                        # Documentation
    ├── QUICK_START.md
    ├── TROUBLESHOOTING.md
    ├── SECURITY.md
    └── BENCHMARKS.md

📜 Scripts Reference

Main CLI: netopt

The all-in-one command-line tool. Supports all network optimization features.

netopt start     # Full optimization
netopt stop      # Stop and reset
netopt status    # View status
netopt speed     # Speed test

Individual Scripts

Script Purpose
tcp-optimize.sh Apply TCP buffer and latency optimizations
dns-setup.sh Configure DNS (Cloudflare/Google/Auto)
warp-config.sh Configure WARP VPN with MASQUE
network-reset.sh Reset network and reconnect
speed-test.sh Comprehensive speed testing
health-check.sh Diagnose network issues
full-optimize.sh Run all optimizations at once

📊 Expected Results

Metric Before After
DNS Resolution 50-100ms 10-20ms
Network Latency 50-80ms 15-25ms
Packet Loss 0.5-2% <0.1%
Download Speed 80-90% 95-100%
Buffering Frequent None

🔧 Troubleshooting

VPN won't connect

# Check WARP status
warp-cli status

# Try tunnel-only mode
warp-cli mode tunnel_only
warp-cli connect

DNS not working

# Flush DNS cache
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

# Re-apply DNS
netopt dns cloudflare

Settings reset after reboot

# Make TCP settings persistent
sudo cp configs/sysctl.conf /etc/sysctl.conf

# Or enable auto-start
launchctl load ~/Library/LaunchAgents/com.networkoptimizer.boot.plist

Need to reset everything

netopt reset

See docs/TROUBLESHOOTING.md for more help.


🗑️ Uninstall

# Remove global CLI
sudo rm /usr/local/bin/netopt

# Remove auto-start
launchctl unload ~/Library/LaunchAgents/com.networkoptimizer.boot.plist
rm ~/Library/LaunchAgents/com.networkoptimizer.boot.plist

# Reset network to defaults
netopt reset
# or manually:
sudo networksetup -setdnsservers Wi-Fi Empty

📄 License

MIT License - see LICENSE


🙏 Credits

  • Cloudflare for WARP and 1.1.1.1
  • The macOS networking community

Made with ❤️ for faster networks