How to make different applications use different network connections

Started by Jay

I have a Windows 11 computer with both WiFi and Ethernet. I want the Oracle VirtualBoxes to use the WiFi and I want everything else to use the Ethernet. Can Bandwidth Manager, or any of your products, let me hard-code the network route?
SoftPerfect Support forum - Ann avatar image
Ann

Re: How to make different applications use different network connections   12 February 2025, 11:02

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.
I had been told to do the Interface metric trick before, but it still does not work. I still have traffic that should be on the Ethernet trying to get out on the WiFi. Maybe I set the values wrong? I set the low value to 0 and the high value to 1000 or something like that.
SoftPerfect Support forum - Ann avatar image
Ann

Re: How to make different applications use different network connections   13 February 2025, 10:05

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:
route print
Look 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 7
This 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.
However, the above method using route and interface metrics should suffice for your needs without additional software.

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 ********   ********  ********  **     **  **     ** 
 **     **  **        **        ***   ***  **     ** 
 **     **  **        **        **** ****  **     ** 
 ********   ******    ******    ** *** **  **     ** 
 **         **        **        **     **  **     ** 
 **         **        **        **     **  **     ** 
 **         ********  ********  **     **   *******  

Message: