question

DudiAvrahamov-9071 avatar image
0 Votes"
DudiAvrahamov-9071 asked jiayaozhu-MSFT edited

Create an unattended installation for Hyper-V server 2016 free edition - network settings

Hi friends,

I am trying to create an unattended installation customized ISO for Hyper-V server 2016 free edition.
I've created an autounattend.xml and placed it in the root of the installation ISO (using UltraISO).
After booting from the ISO, installation starts and the autounattend.xml is read.

I'm trying to set the IP settings through the unattend.xml file.
From some reason only the IP address and subnet mask is set. The default gateway isn't set!
Here is the section in my unattend.xml file:
<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>
<!-- Add static IP address (192.168.0.1/24, ffff:1::3/48) & route (12.34.0.0/16) to interface with identifier "Ethernet 1" -->
<Interface wcm:action="add">
<Ipv4Settings>
<DhcpEnabled>false</DhcpEnabled>
<Metric>20</Metric>
<RouterDiscoveryEnabled>true</RouterDiscoveryEnabled>
</Ipv4Settings>
<Ipv6Settings>
<DhcpEnabled>false</DhcpEnabled>
<Metric>30</Metric>
<RouterDiscoveryEnabled>false</RouterDiscoveryEnabled>
</Ipv6Settings>
<Identifier>Ethernet</Identifier>
<UnicastIpAddresses>
<IpAddress wcm:action="add" wcm:keyValue="1">10.165.12.140/24</IpAddress>
</UnicastIpAddresses>
<Routes>
<Route wcm:action="add">
<Identifier>1</Identifier>
<Metric>1</Metric>
<NextHopAddress>10.165.12.0</NextHopAddress>
<Prefix>24</Prefix>
</Route>
</Routes>
</Interface>
</Interfaces>
</component>

Any help will be appreciated!

Thanks,
Dudi.

windows-server-hyper-v
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

I would like to check if the reply could be of help? If yes, please help accept answer, so that others meet a similar issue can find useful information quickly. If you have any other concerns or questions, please feel free to feedback.

Best Regards,
Joan

0 Votes 0 ·

Hi,

Thanks for your reply!

I am glad to hear that you have got your workaround. I would appreciate it if you could help me Accept Answer or you can self accept answer to your own reply. So people who have a similar issue with yours can get their answers more quickly.

Thanks for your understanding and support!

Best regards
Joan


0 Votes 0 ·
jiayaozhu-MSFT avatar image
0 Votes"
jiayaozhu-MSFT answered

Hi,

Thank you for your posting!

Based on your script, it is shown that you have disable DHCP service and enable Router Discovery for Ipv4 setting and disable Router Discovery for Ipv6 setting. If you disable DHCP service for Ipv4, you then need to manually set your default gateway.

1) Here is the example output showing how to configure TCPIP:
https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-tcpip-interfaces-interface-ipv4settings-dhcpenabled

2) You can manually set your default gateway. Here is the guidance:
https://www.dtonias.com/configure-network-settings-windows-server-2016/

Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

Thank you for your support! Hope you have a good day! : )

Best regards
Joan


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DudiAvrahamov-9071 avatar image
0 Votes"
DudiAvrahamov-9071 answered

Thanks for your response!
I've followed the link you have sent (point 1).
I want to configure the DG from the unattended.xml.
It seems like the NextHopAddress element is ignored.
Have you succeeded to configure the DG from an unattended.xml?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

jiayaozhu-MSFT avatar image
0 Votes"
jiayaozhu-MSFT answered DudiAvrahamov-9071 commented

Hi,

Thank you for your patience!

I would like to check if you have solved out your issue and I want to check if your goal is to set a static IP address (disable DHCP) and configure your default gateway from an unattended.xml instead of through using the graphical user interface, right?

If so, in typical MS environment, this goal is obscure as well as undocumented, but I found a sample that successfully configure the DG from an unattended.xml:

https://msfn.org/board/topic/94603-static-ip-address-in-autounattendxml/

(Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)

Thank you for your understanding! Add I would appreciate it if you could help me "Accept Answer".

BR,
Joan


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

My goal is to automate the installation of Hyper-V server and part of this is to give it a static IP settings including DGW and DNS.
Unfortunately this NextHopAddress settings in the unattend.xml didn't work for me to set the DGW.
Anyway, I've decided to use a workaround. I'm now set the DGW and DNS using PowerShell (since I can connect to the server using it's IP address).

0 Votes 0 ·