FortiClient VPN is notoriously aggressive — it hijacks all your internet traffic (0.0.0.0/0) and overrides your DNS settings. The result? Slow browsing, no local network access (printers, NAS, local IPs), and every single request routed through your company's tunnel.
FortiSplit is a lightweight, zero-dependency PowerShell script that automates split tunneling. It restores your local internet speed and local network access while keeping corporate traffic strictly inside the VPN tunnel.
- 🚀 Key Features
- 📦 Installation
- ⚙️ How It Works
- 📝 Configuration
- 🔧 Troubleshooting
- 📋 Requirements
- 🤝 Contributing
| Feature | Description |
|---|---|
| Language Independent | Uses route-based detection instead of hardcoded names like "Wi-Fi" |
| Automated Routing | Routes only corporate IPs through VPN; everything else goes to your local ISP |
| DNS Leak Fix | Restores your preferred DNS (Google / Cloudflare) while VPN is active |
| Smart Detection | Automatically finds active physical adapters and ignores virtual interfaces |
| Subnet Cleanup | Removes VPN-injected routes that conflict with your home/office LAN |
| Global Command | Can be installed as a global fortisplit command for instant access |
Run this command in PowerShell to install FortiSplit globally:
irm https://raw.githubusercontent.com/sakirsek/FortiSplit/main/install.ps1 | iexAfter installation, you can simply type this in any terminal (CMD or PowerShell):
fortisplitTip
If the command is not recognized immediately, please restart your terminal window to refresh the environment variables.
- Download FortiSplit.ps1.
- Connect to your VPN via FortiClient.
- Open PowerShell as Administrator.
- Run the script:
Set-ExecutionPolicy Bypass -Scope Process -Force; .\FortiSplit.ps1
graph TD
A[Start FortiSplit] --> B{Detect Active Internet?}
B -- Yes --> C[Identify Local Adapter via 0.0.0.0 Route]
C --> D[Identify FortiClient VPN Adapter]
D --> E[Set Local Adapter as High Priority]
E --> F[Remove VPN Default Route]
F --> G[Clear Subnet Conflicts]
G --> H[Add Corporate Static Routes]
H --> I[Restore Preferred DNS]
I --> J[Done!]
B -- No --> K[Fallback to Physical Hardware Scan]
K --> D
Important
Re-run after every connection: FortiClient resets all routing and DNS settings every time you connect or reconnect to the VPN. You must run fortisplit again after each reconnection to restore split tunneling.
Open FortiSplit.ps1 and edit the User Configuration section:
Define which IP ranges should go through the VPN tunnel:
$TARGET_NETWORKS = @(
@{ IP = "10.0.0.0"; Mask = "255.0.0.0" } # Most common corporate range
# @{ IP = "172.16.0.0"; Mask = "255.240.0.0" } # Uncomment if needed
)Choose your preferred DNS providers (default is Google + Cloudflare):
$PREFERRED_DNS = @("8.8.8.8", "1.1.1.1")| Problem | Solution |
|---|---|
| "No active FortiClient VPN adapter found" | Connect to VPN first, wait ~10 seconds, then run the script |
| "No active local network adapter found" | Ensure you are connected to the internet. The script uses your active internet route to find the adapter. |
| Permission Denied | The script requires Administrator privileges to modify routing tables. It will request them automatically. |
| Corporate app not working | Ensure the app's IP range is listed in $TARGET_NETWORKS. |
- OS: Windows 10 / 11
- PowerShell: 5.1 or later (pre-installed on Windows)
- Privileges: Administrator
- VPN Client: FortiClient (any version)
Use this script at your own risk.
This script modifies local routing tables and DNS settings. While these changes are temporary and typically reset upon VPN disconnection or reboot, you are solely responsible for ensuring that using this tool complies with your organization's IT security policies and terms of service.
The author(s) shall not be held liable for any security breaches, policy violations, data loss, or network instability caused by the use of this script. This software is provided "as is", without warranty of any kind.
Contributions are welcome! If you have ideas for improvements or find a bug, feel free to open an issue or a pull request.
- Fork the repo
- Create your branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License — see the LICENSE file for details.
If this project helped you, please consider giving it a ⭐ on GitHub!