How to specify network configuration in an unattend.xml file

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