All Forums
> Bandwidth Manager
> Current topic
How to make different applications use different network connections
Started by Jay
Jay
How to make different applications use different network connections 12 February 2025, 10:44 |
|
Re: How to make different applications use different network connections 12 February 2025, 11:02 |
Admin Registered: 11 years ago Posts: 1 015 |
To achieve the goal of having Oracle VirtualBox VMs use WiFi while everything else uses Ethernet on a Windows 11 computer, you can use a combination of routing rules and interface metrics using built-in Windows feature. Here's how you can approach this:
Windows uses interface metrics to determine the priority of network interfaces. Lower metrics have higher priority. You can set the Ethernet interface to have a lower metric (higher priority) and the WiFi interface to have a higher metric (lower priority).
For that, open Network & Internet settings, click Change adapter options, right-click the Ethernet adapter and select Properties. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties, then Advanced. Uncheck Automatic metric and set a low value (e.g., 10) for its interface metric. Repeat the process for the WiFi adapter and set a higher value (e.g., 20) for its interface metric. This ensures that Ethernet is preferred for general traffic, while WiFi is used as a fallback.
Now simply ensure that VirtualBox is set to use the WiFi adapter for bridged networking, and everything should work as intended.
Windows uses interface metrics to determine the priority of network interfaces. Lower metrics have higher priority. You can set the Ethernet interface to have a lower metric (higher priority) and the WiFi interface to have a higher metric (lower priority).
For that, open Network & Internet settings, click Change adapter options, right-click the Ethernet adapter and select Properties. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties, then Advanced. Uncheck Automatic metric and set a low value (e.g., 10) for its interface metric. Repeat the process for the WiFi adapter and set a higher value (e.g., 20) for its interface metric. This ensures that Ethernet is preferred for general traffic, while WiFi is used as a fallback.
Now simply ensure that VirtualBox is set to use the WiFi adapter for bridged networking, and everything should work as intended.
Jay
Re: How to make different applications use different network connections 13 February 2025, 09:52 |
|
Re: How to make different applications use different network connections 13 February 2025, 10:05 |
Admin Registered: 11 years ago Posts: 1 015 |
In that case you may also need to adjust the routing tables. To route all traffic through a specific interface when both Ethernet and WiFi are connected, use the route command in Windows:
Step 1
Open Command Prompt as Administrator and run:
Step 2
Delete existing default routes to avoid conflicts:
Step 3
To force all traffic through a specific interface (e.g., Ethernet with gateway 192.168.1.1):
Step 4
If you want the change to persist across reboots:
Example
If Ethernet has interface index 7 and gateway 192.168.1.1, run:
If you prefer a more user-friendly approach, you can use third-party tools like:
Step 1
Open Command Prompt as Administrator and run:
route printLook for the interface index (Idx) of the Ethernet and WiFi connections.
Step 2
Delete existing default routes to avoid conflicts:
route delete 0.0.0.0
Step 3
To force all traffic through a specific interface (e.g., Ethernet with gateway 192.168.1.1):
route add 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 1 if <InterfaceIndex>Replace <InterfaceIndex> with the correct index from step 1.
Step 4
If you want the change to persist across reboots:
route -p add 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 1 if <InterfaceIndex>
Example
If Ethernet has interface index 7 and gateway 192.168.1.1, run:
route -p add 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 1 if 7This ensures all traffic goes through Ethernet.
If you prefer a more user-friendly approach, you can use third-party tools like:
- NetBalancer: allows you to set traffic rules for specific applications or IP ranges.
- ForceBindIP: binds specific applications to a network interface.