# WireGuard Complete Removal Guide

When WireGuard is no longer needed (e.g., switched to Clash/Mihomo proxy), remove it completely to prevent it from intercepting traffic on reboot.

## Step-by-step removal

```bash
# 1. Stop the interface immediately
sudo wg-quick down wg0

# 2. Disable the systemd service (prevents auto-start on boot)
sudo systemctl disable wg-quick@wg0

# 3. Verify no WireGuard interfaces remain
ip addr show wg0 2>/dev/null || echo "wg0 removed"
sudo wg show  # should show nothing

# 4. Verify routing table is clean (no wg0 routes)
ip route show | grep wg0  # should show nothing

# 5. Test connectivity
ping -c 3 8.8.8.8
```

## If you want to fully uninstall WireGuard

```bash
# Ubuntu/Debian
sudo apt remove wireguard wireguard-tools

# Remove config files
sudo rm -rf /etc/wireguard/
```

## Pitfalls

- **`wg-quick down` alone is NOT enough** — the systemd service will restart wg0 on next boot. Always `systemctl disable` as well.
- **Check routing after removal** — WireGuard may have added custom routes or iptables rules. Verify with `ip route show` and `sudo iptables -L -n`.
- **DNS leaks** — WireGuard may have modified `/etc/resolv.conf`. Check and restore if needed.
- **Clash/Mihomo coexistence** — If switching from WireGuard to Clash, ensure WireGuard is fully stopped BEFORE starting Clash to avoid route conflicts.
