Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to modify the NIC bind order in Hyper-V Server/Server Core? For some reason, one of our Hyper-V servers decided to reverse the bind order of two of the six NIC ports on the machine, making it inconsistent with all of our other servers (not to mention being out of sequence with the phyical layout of the NICs).

I know this can be done via a network settings GUI in the full server installation, but alas, said GUI does not exist in Server Core. I believe that this will require a direct registry edit, but I am not sure where.

Any help would be appreciated.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

I looked this up because I could really use that. If you are running Core, you probably do not want or have the authority to install extra software, even if it is a CodePlex dig (I have a lot more respect for that than straight up Microsoft garbage). You can do it programmatically with WMI

==== snip - Start of script code Set_Wireless_NIC_IPMetric.vbs script ====
On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

regValueDataMetric = "35"

Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Wireless Network Connection'")

For Each objItem in colItems
strMACAddress = objItem.MACAddress
Wscript.Echo "MACAddress: " & strMACAddress
Next

Set colNetCard = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

For Each objNetCard in colNetCard
If objNetCard.MACAddress = strMACAddress Then
For Each strIPAddress in objNetCard.IPAddress
Wscript.Echo "Description: " & objNetCard.Description
Wscript.Echo "IP Address: " & strIPAddress
Wscript.Echo "IPConnectionMetric: " & objNetCard.IPConnectionMetric
objNetCard.SetIPConnectionMetric(regValueDataMetric)
Next
End If
Next
==== snip - End of VBS script ====

Or, do a one-off from WMIC when you figure out the MAC address or unique identifier of the NIC in question.

# Find the NIC you want.
wmic nicconfig where "ipenabled='true'" get caption, macaddress

# Set it on the NIC of choice.
wmic nicconfig where "ipenabled='true' and macaddress='00:00:00:00:00:AA'" call setipconnectionmetric(METRICYOUWANT)

It returns 0, but I cannot figure out why it does not come up. Maybe you need to reset the NIC.

share|improve this answer

Nvspbind utility will help you: http://code.msdn.microsoft.com/nvspbind

share|improve this answer

Nvspbind is great for many things in addition to this. If you're just looking to rename the interfaces, netsh can do that too.

On a side note; I normally name the Teamed Interfaces for their purpose, so it's consistent across the servers no matter how many NICs, what kind, or whatever. The NIC Teams are 'Mgmt', 'LAN', and 'iSCSI' usually (substitute you favorite names).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.