Setting Network Interface Priority On Windows 8 with PowerShell

Yesterday I posted a blog on Setting Network Interface Priority on Windows 8 with the GUI, today I am going to show you how to do it with PowerShell.

Firstly you are going to have to run PowerShell at an elevated prompt, to do this, simply right click on the icon and click “Run as Administrator”

Type Get-NetIPInterface to get a list of all the network interfaces on your system. The 2 interfaces we are looking for are Ethernet and Wi-Fi, both on IPv4

Get-NetIPInterface


The Interface Metric is set to auto, and have been assigned 10 for the Ethernet and 20 for the Wi-Fi

To change this type the following to set the interface metric on the Ethernet interface to 5

Set-NetIPInterface -InterfaceAlias Ethernet -AddressFamily IPv4 -InterfaceMetric 5


Now change the Wi-Fi interface to 1

Set-NetIPInterface -InterfaceAlias Wi-Fi -AddressFamily IPv4 -InterfaceMetric 1


Now if we check the Get-NetIPInterface you will see that the interface metric for the adaptors Ethernet and Wi-Fi have changed to 5 and 1 respectively


You can also specify either IP4 or IP6 by changing the AddressFamily to either IPv4 or IPv6

Remember: You must do this for all active NICs to make sure they are in the right order.

@PCVirus_AU
Titan Solutions

Advertisements

About Phill McSherry
Phill McSherry has been working in the Australian IT industry for over 20 years and is the technical manager and solutions architect for managed services provider Titan Solutions - www.titansolutions.com.au

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: