Skip to content

script to change the network/ethernet/network interface priority 🌐

License

Notifications You must be signed in to change notification settings

jasonfoknxu/switch-ethernet-windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Switch Ethernet (PowerShell)

A simple script to change the priority of two Network Interfaces (NICs).

Useful for switching between two networks or change the priority of Ethernet and Wi-Fi.

✨ Requirements

  • Text Editor
  • PowerShell
  • Only support Windows
  • Admin Permission
  • Basic technical knowledge

📓 How To Use?

  1. Open the ps1 file with text editor
  2. Open setting / control panel to view the name of both NIC
  3. Change the $net1_name & $net2_name to your NIC's name, change the $check_ip_url if you want
  4. Create a shortcut to the script powershell -f <PATH_OF_THE_SCRIPT> (For example, powershell -f "C:\Users\jasonfoknxu\Documents\switch-ethernet.ps1")
  5. Right-click the shortcut ➡️ Properties ➡️ Shortcut (tab) ➡️ Advanced ➡️ Select Run as Administrator
  6. Execute the script by clicking the shortcut
  7. Input 1 to select first network, 2 for the second network, 0 for returning back to default (auto)
  8. Done

⭐ Example

Two NIC

There are two networks, the name are LAN and Wi-Fi

You can select your favorite IP checking server or empty ($check_ip_url = "") to disable IP checking

The config would be like the following:

$net1_name = "LAN"
$net2_name = "Wi-Fi" 
$check_ip_url = "https://api.ipify.org"

⚙️ How it works?

The script will change the Interface Metric of target NIC to lower, another NIC to higher Metric

About

script to change the network/ethernet/network interface priority 🌐

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published