Jump to content

Assigning a Static IP Address


Recommended Posts

Alright, I've been at this for several hours. I for the life of me cannot get a static IP set to this machine (Server 2012) after my sysprep reboot takes place.

Anyone see an issue with my Syntax / setup or any pointers to try and debug why the settings wont stick?

I have noted the MAC address and it does indeed match the address showed in ipconfig /all.

Thanks!!

<?xml version="1.0" encoding="UTF-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend">    <settings pass="oobeSystem">        <component name="Microsoft-Windows-TCPIP"                   processorArchitecture="amd64"                   publicKeyToken="31bf3856ad364e35"                   language="neutral"                   versionScope="nonSxS"                   xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >            <Interfaces>                <Interface wcm:action="add">                    <Ipv4Settings>                        <DhcpEnabled>false</DhcpEnabled>                    </Ipv4Settings>                    <UnicastIpAddresses>                        <IpAddress wcm:action="add"                                   wcm:keyValue="1" >                            10.128.36.186/24                        </IpAddress>                    </UnicastIpAddresses>                    <Ipv6Settings>                        <DhcpEnabled>false</DhcpEnabled>                    </Ipv6Settings>                    <Identifier>00-50-56-A9-6E-E3</Identifier>                    <Routes>                        <Route wcm:action="add">                            <Identifier>1</Identifier>                            <Prefix>0.0.0.0/0</Prefix>                            <NextHopAddress>10.128.36.1</NextHopAddress>                        </Route>                    </Routes>                </Interface>            </Interfaces>        </component>        <component name="Microsoft-Windows-International-Core"                   processorArchitecture="amd64"                   publicKeyToken="31bf3856ad364e35"                   language="neutral"                   versionScope="nonSxS"                   xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >            <InputLocale>en-US</InputLocale>            <SystemLocale>en-US</SystemLocale>            <UILanguage>en-US</UILanguage>            <UILanguageFallback>en-US</UILanguageFallback>            <UserLocale>en-US</UserLocale>        </component>        <component name="Microsoft-Windows-Shell-Setup"                   processorArchitecture="amd64"                   publicKeyToken="31bf3856ad364e35"                   language="neutral"                   versionScope="nonSxS"                   xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >            <AutoLogon>                <Password>                    <Value>MyPazsw0rd</Value>                    <PlainText>true</PlainText>                </Password>                <Enabled>true</Enabled>                <LogonCount>3</LogonCount>                <Username>Administrator</Username>            </AutoLogon>            <OOBE>                <HideEULAPage>true</HideEULAPage>                <NetworkLocation>Work</NetworkLocation>                <ProtectYourPC>1</ProtectYourPC>            </OOBE>            <TimeZone>Pacific Standard Time</TimeZone>        </component>    </settings></unattend>
Edited by Yzöwl
Code tags added
Link to comment
Share on other sites


Try putting the identifier right after the add action: <- edited, see below.

 

Try re-ordering the entries according to MS documentation linked in following post.

 

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Well am not expert but with command line you can make it so if you still having troubles :

 

Create a SetupComplete.cmd here : %WINDIR%\Setup\Scripts\

 

Let say this 
IP : 10.128.36.1

Mask : 255.255.255.240

Default gateway : 192.168.0.1

Gateway Metric : 1
 

Add this line 

 
netsh interface ip set address name="Local Area Connection" static 10.128.36.1 255.255.255.240 192.168.0.1 1
Link to comment
Share on other sites

 

Try putting the identifier right after the add action:

Have you seen any instance where re-arranging the XML does anything? By design, it shouldn't, as everything should be parsed prior to being used.

 

Well, there is a given order on MS pages:

https://technet.microsoft.com/en-us/library/ff715739.aspx

The settings in Interface must be added in the following order: Ipv4Settings, Ipv6Settings, Identifier, UnicastIpAddresses, and then Routes. After saving your Unattend file in Windows SIM, verify in the XML file that the output is shown in the correct order, as shown in the XML example below.

 

(and BTW I just realized that I posted wrong info, my bad  :blushing: ) I am correcting my previous post, the order is:

  1. Ipv4Settings
  2. Ipv6Settings
  3. Identifier
  4. UnicastIpAddresses
  5. Routes

jaclaz

Link to comment
Share on other sites

So I took your advice and updated my XML and still no dice. This is driving me nuts Thank you for your feedback nonetheless :).

Updated:

<?xml version="1.0" encoding="UTF-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend">    <settings pass="oobeSystem">        <component name="Microsoft-Windows-TCPIP"                   processorArchitecture="amd64"                   publicKeyToken="31bf3856ad364e35"                   language="neutral"                   versionScope="nonSxS"                   xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >            <Interfaces>                <Interface wcm:action="add">                    <Ipv4Settings>                        <DhcpEnabled>false</DhcpEnabled>                    </Ipv4Settings>                    <Ipv6Settings>                        <DhcpEnabled>false</DhcpEnabled>                    </Ipv6Settings>                    <Identifier>00-50-56-A9-6E-E3</Identifier>                    <UnicastIpAddresses>                        <IpAddress wcm:action="add"                                   wcm:keyValue="1" >                            10.128.36.186/24                        </IpAddress>                    </UnicastIpAddresses>                    <Routes>                        <Route wcm:action="add">                            <Identifier>1</Identifier>                            <Prefix>0.0.0.0/0</Prefix>                            <NextHopAddress>10.128.36.1</NextHopAddress>                        </Route>                    </Routes>                </Interface>            </Interfaces>        </component>        <component name="Microsoft-Windows-International-Core"                   processorArchitecture="amd64"                   publicKeyToken="31bf3856ad364e35"                   language="neutral"                   versionScope="nonSxS"                   xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >            <InputLocale>en-US</InputLocale>            <SystemLocale>en-US</SystemLocale>            <UILanguage>en-US</UILanguage>            <UILanguageFallback>en-US</UILanguageFallback>            <UserLocale>en-US</UserLocale>        </component>        <component name="Microsoft-Windows-Shell-Setup"                   processorArchitecture="amd64"                   publicKeyToken="31bf3856ad364e35"                   language="neutral"                   versionScope="nonSxS"                   xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >            <AutoLogon>                <Password>                    <Value>MySuperSecretPassw0d1!</Value>                    <PlainText>true</PlainText>                </Password>                <Enabled>true</Enabled>                <LogonCount>3</LogonCount>                <Username>Administrator</Username>            </AutoLogon>            <OOBE>                <HideEULAPage>true</HideEULAPage>                <NetworkLocation>Work</NetworkLocation>                <ProtectYourPC>1</ProtectYourPC>            </OOBE>            <TimeZone>Pacific Standard Time</TimeZone>        </component>    </settings></unattend>
Edited by Yzöwl
Code tags added AGAIN
Link to comment
Share on other sites

I don' t know. :unsure:

Maybe the issue is with putting it into the OOBE pass (it shoudl be AFAIK in specialize pass) see:

https://technet.microsoft.com/en-us/library/cc749307(v=ws.10).aspx

 

 

specialize
Creates and applies system-specific information. For example, you can configure network settings, international settings, and domain information.

 

 

For the rest it seems to me OK, recheck with this, I finally found the reference I remembered (what i had improperly posted before):

http://blogs.technet.com/b/rdepagne/archive/2008/11/15/how-to-specify-network-configuration-in-an-unattend-xml-file.aspx

(you could try setting just the IPv4 values as in the above, otherwise I am short of ideas :( )

 

jaclaz

Link to comment
Share on other sites

@nhall@emc.org, Could you please note that I found it necessary to make changes to your opening message, despite that you appear to have repeated the problem in your latest message, (which I have also fixed).

Please do not do the same again, thank you.

Link to comment
Share on other sites

@nhall@emc.org, Could you please note that I found it necessary to make changes to your opening message, despite that you appear to have repeated the problem in your latest message, (which I have also fixed).

Please do not do the same again, thank you.

I'll add code tags moving forward.

Link to comment
Share on other sites

I don' t know. :unsure:

Maybe the issue is with putting it into the OOBE pass (it shoudl be AFAIK in specialize pass) see:

https://technet.microsoft.com/en-us/library/cc749307(v=ws.10).aspx

 

 

specialize

Creates and applies system-specific information. For example, you can configure network settings, international settings, and domain information.

 

 

For the rest it seems to me OK, recheck with this, I finally found the reference I remembered (what i had improperly posted before):

http://blogs.technet.com/b/rdepagne/archive/2008/11/15/how-to-specify-network-configuration-in-an-unattend-xml-file.aspx

(you could try setting just the IPv4 values as in the above, otherwise I am short of ideas :( )

 

jaclaz

Intrestin, Ill give that a shot today and let you know. Thanks Jaclaz.

Link to comment
Share on other sites

JacLaz, I got it!!

 

Thank you sir!!!!

 

<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"><settings pass="oobeSystem"><component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">        <InputLocale>en-US</InputLocale>        <SystemLocale>en-US</SystemLocale>        <UILanguage>en-US</UILanguage>        <UILanguageFallback>en-US</UILanguageFallback>        <UserLocale>en-US</UserLocale>    </component>    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><AutoLogon><Password><Value>MyPass$</Value><PlainText>true</PlainText></Password><Enabled>true</Enabled><LogonCount>3</LogonCount><Username>Administrator</Username>        </AutoLogon>        <OOBE>            <HideEULAPage>true</HideEULAPage>            <NetworkLocation>Work</NetworkLocation>            <ProtectYourPC>1</ProtectYourPC>        </OOBE>        <TimeZone>Pacific Standard Time</TimeZone>    </component></settings><settings pass="specialize">    <component name="Microsoft-Windows-TCPIP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">         <Interfaces>            <Interface wcm:action="add"><Ipv4Settings> <DhcpEnabled>false</DhcpEnabled></Ipv4Settings><Ipv6Settings> <DhcpEnabled>false</DhcpEnabled></Ipv6Settings><Identifier>00-50-56-A9-6E-E3</Identifier><UnicastIpAddresses> <IpAddress wcm:action="add" wcm:keyValue="1">10.128.36.186/24</IpAddress></UnicastIpAddresses><Routes> <Route wcm:action="add"><Identifier>1</Identifier><Prefix>0.0.0.0/0</Prefix><NextHopAddress>10.128.36.1</NextHopAddress> </Route></Routes>            </Interface>         </Interfaces>      </component></settings></unattend> 
Link to comment
Share on other sites

 

JacLaz, I got it!!

 

Thank you sir!!!!

 

Good :), you are welcome :thumbup.

 

@St.Thomas Tripredacus ;)

Now we have a documented example :yes:, when it comes to the good MS guys, what is stated as "by design" often means "we messed up (BIG) and we try to cover our backs through mis- or under- document" a feature.

More seriously, what I found "queer" is that something that was found out in 2008 or so has not seemingly been fixed till now, according also to the comments on the given blog post:

http://blogs.technet.com/b/rdepagne/archive/2008/11/15/how-to-specify-network-configuration-in-an-unattend-xml-file.aspx

I do understand how all the good IT guys use DHCP and dynamic IP addresses, and that it is rare to want to have static IP addresses nowadays, particularly in a server environment, and also the netsh workaround posted by aXeSwY would work fine.

Still it seems to me like a bug in the WAIK which is worth of note.

 

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...