none
Setting of static TCPIP address not working on target RRS feed

  • Question

  • I am trying to configure a target WES7 SP1 OS to disable DHCP and use a pre-defined static IP address.  In the TCPIP_x86 package I have tried the settings listed below.  I've tried several different permutations for the Identifier, UnicastIpAddress, Metrics, IPv4 w/o IPv6, Modify instead of Add, etc.  In all cases, the network interface comes up with DHCP enabled and is assigned the same address.  Disconnecting the network cable leaves the interface with no IP address.

    Eventually this platform will have 3 NICs and we would like all 3 to be static IPs, but if I can't get the first one to work I have little hope for all 3.  I would also like to assign unique IP addresses to different boards during production.  I imagine that would be solvable with some sort of registry script that pulls the IP addresses from a file/database.  Any other suggestions would be great.

    Appreciate your help!

    Interface

       Action= AddListItem

       Identifier = Local Area Connection (also tried MAC as 00-E0-4B-49-01-F4)

       Ipv4Settings

          Metric = <empty>

          DhcpEnabled = false

          RouterDiscoveryEnabled = <empty>

       Ipv6 Settings = <same as IPv4 above)

       UnicastIpAddress

          IpAddress

             Value = 192.168.50.101/24

             Key = NIC1

             Action = AddListItem

          Routes = <empty>

    Wednesday, June 4, 2014 2:48 PM

Answers

  • Running NETSH is the best solution. You can try using a synch command to set the address with NETSH or run a batch file after OS has been installed.

    www.annabooks.com / www.seanliming.com / Book Author - Pro Guide to WE8S, Pro Guide to WES 7, Pro Guide to POS for .NET

    • Marked as answer by GRacette Tuesday, June 17, 2014 7:29 PM
    Wednesday, June 4, 2014 3:13 PM
    Moderator
  • I created a new RunSynchronous command that executes a netsh script that can set the first network interface to either static or DHCP.  The script is copied to the target in $OEM$ Folders.  This approach let me conveniently change it after booting if needed.  The interesting bits are the netsh commands below.  The RS command is defined in the Deployment package and is executed in pass P4.

    Initially, the command would fail in obscure ways that did not produce anything meaningful in the error logs.  The final solution seemed to be to add the complete path to the netsh command - thinking the path variable is not yet valid in P4.  Not sure if that was the issue, but it now works.  The RS can always be moved to P7 in the FirstLogonCommands setting in Shell-Setup if needed.

    Thanks for the suggestion Sean.  BTW...Finding your WES7 book very helpful.

    Glenn

    @echo off
    REM Script to change WES7 network IP settings to static or DHCP

    set NAME="Local Area Connection"
    set ADDR=192.168.0.101
    set MASK=255.255.255.0
    set GWAY=192.168.0.1

    if "%1" == "static" goto :STATIC
    if "%1" == "dhcp"   goto :DHCP
    goto :error

    :STATIC
    @echo on
    c:\Windows\System32\netsh interface ipv4 set address name=%NAME% source=static address=%ADDR% ^
    mask=%MASK% gateway=%GWAY% store=persistent
    @goto :eof

    :DHCP
    @echo on
    c:\Windows\System32\netsh interface ipv4 set address name=%NAME% source=dhcp store=persistent
    @goto :eof

    :error
    @echo "Syntax: setnic1 [static|dhcp]"

    • Marked as answer by GRacette Tuesday, June 17, 2014 7:29 PM
    Tuesday, June 17, 2014 7:28 PM

All replies

  • Running NETSH is the best solution. You can try using a synch command to set the address with NETSH or run a batch file after OS has been installed.

    www.annabooks.com / www.seanliming.com / Book Author - Pro Guide to WE8S, Pro Guide to WES 7, Pro Guide to POS for .NET

    • Marked as answer by GRacette Tuesday, June 17, 2014 7:29 PM
    Wednesday, June 4, 2014 3:13 PM
    Moderator
  • I created a new RunSynchronous command that executes a netsh script that can set the first network interface to either static or DHCP.  The script is copied to the target in $OEM$ Folders.  This approach let me conveniently change it after booting if needed.  The interesting bits are the netsh commands below.  The RS command is defined in the Deployment package and is executed in pass P4.

    Initially, the command would fail in obscure ways that did not produce anything meaningful in the error logs.  The final solution seemed to be to add the complete path to the netsh command - thinking the path variable is not yet valid in P4.  Not sure if that was the issue, but it now works.  The RS can always be moved to P7 in the FirstLogonCommands setting in Shell-Setup if needed.

    Thanks for the suggestion Sean.  BTW...Finding your WES7 book very helpful.

    Glenn

    @echo off
    REM Script to change WES7 network IP settings to static or DHCP

    set NAME="Local Area Connection"
    set ADDR=192.168.0.101
    set MASK=255.255.255.0
    set GWAY=192.168.0.1

    if "%1" == "static" goto :STATIC
    if "%1" == "dhcp"   goto :DHCP
    goto :error

    :STATIC
    @echo on
    c:\Windows\System32\netsh interface ipv4 set address name=%NAME% source=static address=%ADDR% ^
    mask=%MASK% gateway=%GWAY% store=persistent
    @goto :eof

    :DHCP
    @echo on
    c:\Windows\System32\netsh interface ipv4 set address name=%NAME% source=dhcp store=persistent
    @goto :eof

    :error
    @echo "Syntax: setnic1 [static|dhcp]"

    • Marked as answer by GRacette Tuesday, June 17, 2014 7:29 PM
    Tuesday, June 17, 2014 7:28 PM