Blog of Renaud Depagne

Blog written in english by a french consultant working for Microsoft Consulting Services in France

How to specify network configuration in an unattend.xml file

How to specify network configuration in an unattend.xml file

  • Comments 7
  • Likes

I recently faced a problem for deploying Windows Server 2008 servers using WAIK when specifying the gateway in the IP V4 networking configuration. This article may avoid you the time of searching and hopefully finding the solution to the problem of what seems a bug in WAIK.

If you want to specify only an IP address in an unattend.xml file, it is straightforward : use WAIK to automatically generate a unattend.xml file and it works.

But if you want to add a gateway, you get in trouble using WAIK : even if you manage to find the syntax to use, the generated xml file doesn’t work, and looking at the help and examples in the help files is useless : examples for this specific case were surely never tested, they just do not work.

The workaround is to modify the unattend.xml file which was badly generated by WAIK by moving the line containing the identification of the networking card up to the correct position.

You can do this with Notepad.

The file below is correct after having been manually modified :

            <Interfaces>

                <Interface wcm:action="add">

                    <Ipv4Settings>

                        <DhcpEnabled>false</DhcpEnabled>

                    </Ipv4Settings>

                    <Identifier>Local Area Connection</Identifier>

                    <UnicastIpAddresses>

                        <IpAddress wcm:action="add" wcm:keyValue="1">10.123.242.51/24</IpAddress>

                    </UnicastIpAddresses>

                    <Routes>

                        <Route wcm:action="add">

                            <Identifier>0</Identifier>

                            <Prefix>0.0.0.0/0</Prefix>

                            <Metric>20</Metric>

                            <NextHopAddress>10.123.242.1</NextHopAddress>

                        </Route>

                    </Routes>

                </Interface>

            </Interfaces>

 

You first must move the line identifying the networking card (<Identifier>Local Area Connection</Identifier>) up to the line as in the example above, just below </Ipv4Settings>.

 

Then the syntax for the gateway should respect the following :

·        The line containing the Prefix tag should contain 0.0.0.0/0 as above

·        There must be a line containing the Identifier tag. I have tested it with the values 0 and 1 and it works. It may work with other values but I have lost enough time around this problem, I have not tried other values

·        Of course, there must be a line containing the NextHopAddress tag containing the address of the gateway

·        The line containing the Metric tag may be present as in the example above, or not be present, it works in either case

 

Comments
  • Great post.  How on earth did you find the bug with the identifier tag?  Do you know if this has been reported to MS so they fix the WAIK tool?

  • Well it's 2013 and Microsoft still has not fixed this problem! Clearly nobody must be using static IPs....

  • Using unattend.xml on a Windows Server 2012 R2 does not work with Static IP neither. WAIK does not generate valid xml.

  • Using unattend.xml on a Windows Server 2012 R2 does not work with Static IP neither. WAIK does not generate valid xml.

  • Using unattend.xml on a Windows Server 2012 R2 does not work with Static IP neither. WAIK does not generate valid xml.

  • Using unattend.xml on a Windows Server 2012 R2 does not work with Static IP neither. WAIK does not generate valid xml.

  • Renau's tweak works.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment