none
NETSH problems

    Question

  • I'm trying to make some connection changes via NETSH.  Can anyone tell me if these work for you?

    I'm on build 5384.

    netsh interface set interface name="Local Area Connection 3" newname="LAN"
    No more data is available.

    netsh interface ipv4 set winsserver "Local Area Connection 3" source=static address="none"
    The parameter is incorrect

    For the WINS command, it works if I try to set an address, but what I'm trying to do is remove it. 

    I was able to make both of these changes in Server 2003's netsh.exe (though with slightly different syntax for the WINS command).

    Wednesday, September 06, 2006 2:27 PM

Answers

  • Hi,

    Hmm, perhaps one of our other fixes solved that and you can use the name string in the set commands now. I'll have to look into that more.

    Correct, renaming network adapters will not work on Server Core because of the dependency issue I mentioned above. We are trying to get some changes made to solve this, but it may not be possible. Agreed, it will make the scripts more invovled on Server Core to determine which network is which.

    Ok, just wanted to verify before we banged our heads against teh wall trying to make it work when it never would.

    To set the multiple DNS Servers, you need to include the index= parameter, for example:

    netsh interface ipv4 add dnsserver name="#" address=192.168.100.1 index=1

    netsh interface ipv4 add dnsserver name="#" address=192.168.100.2 index=2

    The winsserver issue appears to be a bug, I can reproduce it on both Server and Server Core. What does work is:

    • after setting your IP address to static, all wins servers are removed
    • you can set a static wins server address and change it, you just can't set it to none.

    I'll file a bug on the issue.

    Thanks,

    Andrew

     

     

     

    Friday, September 08, 2006 12:28 AM
    Owner

All replies

  • Hi,

    On Server Core you need to use the "Idx" number for the interface instead of the name. To get this, run:

    netsh interface ipv4 show interfaces

    The output will be along the lines of:

    Idx  Met   MTU               State          Name
    ---  ---     -----               -----------  -------------------
      1   50     4294967295  connected    Loopback Pseudo-Interface 1
     10   20   1500               connected    Local Area Connection

    In the above commands, replace "Local Area Connection 3" with the cooresponding Idx value on your computer. For example, to set a static ip address you would use:

    netsh interface ipv4 set address name="Idx" source=static address=StaticIP mask=SubnetMask gateway=DefaultGateway

    Hope that helps,

    Andrew

     

    Wednesday, September 06, 2006 4:46 PM
    Owner
  • I'm afraid that it still doesn't work, even with the IF number.  I ran the following from a batch file, the exact commands and output are below.

    Running the winsserver command by either IF number or name will work as long as I am setting a WINS server address.  It's the delete operation that appears to be the issue.  This "none" keyword worked in 2003 and it is listed in the 5384 help text.

    C:\Temp>netsh interface ipv4 show interfaces 

    Idx  Met   MTU   State        Name
    ---  ---  -----  -----------  -------------------
      1   50 4294967295  connected    Loopback Pseudo-Interface 1
      4   10   1500  connected    Local Area Connection 3


    C:\Temp>netsh interface set interface name="4" newname="LAN" 
    No more data is available.

     

    C:\Temp>netsh interface ipv4 set winsserver name="4" source="static" address="none" 
    The parameter is incorrect.

    Wednesday, September 06, 2006 6:29 PM
  • While I've got your attention, I'm also having trouble setting a secondary DNS server address with NETSH.  I've tried commas, semicolons and spaces as delimiters.

    netsh interface ipv4 set dnsserver name="4" source="static" address="127.0.0.1,192.168.235.10"

    Is there an online reference guide I should be consulting?

    Wednesday, September 06, 2006 8:02 PM
  • Hi,

    Sorry, I was looking at your second command and it didn't even register that your first command in your posting was renaming the connection name. That will not work on Server Core, using the name (e.g. Local Area Connection 3) in anyway will not work. Using the name in anyway has a dependency on the network control panel as that is where the APIs to work with the name reside. Therefore, you always need to use the ID # with netsh on Server Core.

    As far as teh winsserver and dnsserver settings are concerned have you set a static IP Address? If the IP address isn't set to static, it won't let you set any of the other settings to static. The error message is misleading.

    Thanks,

    Andrew

    Thursday, September 07, 2006 5:23 PM
    Owner
  • I'll take the name references out of my scripts as you advise, but FYI, I am able to perform NETSH operations by name on a core server.  Just this morning I ran the following successfully on build 5384:

    SET INTERFACE=Local Area Connection 4
    netsh interface ipv4 set   address name="%INTERFACE%" source="static" address="192.168.235.12" mask="255.255.255.0" gateway="192.168.235.2"
    netsh interface ipv4 set dnsserver name="%INTERFACE%" source="static" address="192.168.235.11"

    Regarding the renaming issue, my command from post #3 in this thread does use the index, not the name.  The same error is still returned.  Are you saying that it is impossible to rename adapters on server core (at least via NETSH)?  If so, I would think that this will greatly complicate scripting operation (never being able to depend on a consistent label like "DMZ" for multiple nodes in a farm).

    netsh interface set interface name="4" newname="LAN" 
    No more data is available.

    Regarding the WINS issue, here is some output, demonstrating that I do have a static configuration and that referencing by index has no effect on the issue.

    C:\Temp>netsh interface ipv4 show interfaces

    Idx  Met   MTU   State        Name
    ---  ---  -----  -----------  -------------------
      1   50 4294967295  connected    Loopback Pseudo-Interface 1
      5   10   1500  connected    Local Area Connection 4


    C:\Temp>ipconfig /all

    .  . .

    Ethernet adapter Local Area Connection 4:

       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : VMware Accelerated AMD PCNet Adapter
       Physical Address. . . . . . . . . : 00-0C-29-72-88-12
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::447b:8a4d:af22:3e97%5(Preferred)
       IPv4 Address. . . . . . . . . . . : 192.168.235.12(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.235.2
       DNS Servers . . . . . . . . . . . : 192.168.235.11
       NetBIOS over Tcpip. . . . . . . . : Enabled

    C:\Temp>netsh interface ipv4 set winsserver name="5" source="static" address="none" 
    The parameter is incorrect.

    Thanks for your help,

    Hugh

    Thursday, September 07, 2006 6:04 PM
  • Hi,

    Hmm, perhaps one of our other fixes solved that and you can use the name string in the set commands now. I'll have to look into that more.

    Correct, renaming network adapters will not work on Server Core because of the dependency issue I mentioned above. We are trying to get some changes made to solve this, but it may not be possible. Agreed, it will make the scripts more invovled on Server Core to determine which network is which.

    Ok, just wanted to verify before we banged our heads against teh wall trying to make it work when it never would.

    To set the multiple DNS Servers, you need to include the index= parameter, for example:

    netsh interface ipv4 add dnsserver name="#" address=192.168.100.1 index=1

    netsh interface ipv4 add dnsserver name="#" address=192.168.100.2 index=2

    The winsserver issue appears to be a bug, I can reproduce it on both Server and Server Core. What does work is:

    • after setting your IP address to static, all wins servers are removed
    • you can set a static wins server address and change it, you just can't set it to none.

    I'll file a bug on the issue.

    Thanks,

    Andrew

     

     

     

    Friday, September 08, 2006 12:28 AM
    Owner
  • Many thanks.  I hadn't realized that there were "ADD" and "DELETE" commands as well as "SET".

    By using the following, I was able to clear out the WINS entry.  Note the use of "delete" instead of "set".

    netsh interface ipv4 delete winsserver name="4" address="all"

    Perhaps the change should just be to the online help text.

    Hugh

    Friday, September 08, 2006 2:22 PM
  • Hi,

    You're welcome. I just heard back on the bug, the above is the way to set the winsserver. Apparently, despite what the help says, none isn't supported. They haven't decided if it will be, or the help fixed.

    Thanks,

    Andrew

    Friday, September 08, 2006 10:34 PM
    Owner
  • Hi,

     

    I am also trying to set a static IP on Server Core using netsh commands. However, I see only a loopback interface. I dnt see local area connection interface at all. Setting IP on loopback - though it sets the static IP, DHCP is still enabled and finally am not able to make the connection.

     

    Any suggestions on how to the the local area connection interface?

     

    Thanks,

     

    - Bindu

    Thursday, November 01, 2007 4:33 PM
  •  bindu_v wrote:
    I see only a loopback interface. I dnt see local area connection interface at all.

     

    Bindu,

     

    This would probably mean your network interface card (NIC) isn't properly recognized or your version of Microsoft Windows Server 2008 doesn't include a driver for it.

    Thursday, November 01, 2007 6:17 PM
  • I see VMware in there, install VMware tools, the drivers are in there..

    Friday, February 22, 2008 12:59 AM
  • Dear guys, I'm just a beginner in this issues.

     

    Please, I installed the Server Core in a old Dimension 8100 with two NICs an inbuilt 3C920 (3c905c) and a 3c905b-tx and I have no Network. Previously, I installed Windows 2008 Server, GUI version, with no problem, Both NICs worked. Later I installed Server Core and I've no NICs. The command:

     

    netsh interface ipv4 show interfaces

     

    Shows this output:

     

    Idx  Met   MTU               State          Name
    ---  ---     -----               -----------  -------------------
      1   50     4294967295  connected    Loopback Pseudo-Interface 1

     

    No more info. I do suppose that the NICs are not being recognized. So, it rises a question on how do I install the drivers? The problem is that I have no network at all, so I can't use RD.

     

    Thanks in advance, Alfredo

     

    Wednesday, May 07, 2008 5:44 PM
  • Dear Guys,

     

    I kept following the issue and I found the answer.

     

    I loaded the drivers, using pnputil ....but not the oemsetup.inf (which dindn't load) but the W9X90X.INF, the Windows 9x version. It loaded and the cad was recognized.

     

    I already made the configuration on the card...

     

    Thanks a lot anyway.

     

    Alfredp

    Wednesday, May 07, 2008 6:23 PM