I've got an issue where a Windows 2008 R2 Standard (SP1) server loses its static IP configuration upon a reboot. It's a sysprep'd image.
The following steps reproduces the problem:
- Using the SAC, set the IP using 'i'
- Use the Win32 EnableStatic() method to set an IP (and then SetGateways()) through PowerShell
- Reboot
The machine boots up with the following configuration:
Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : [...] Autoconfiguration IPv4 Address. . : 169.254.152.31 (incorrect) Subnet Mask . . . . . . . . . . . : 255.255.0.0 (incorrect, was set to /24) Default Gateway . . . . . . . . . : 1.1.1.1 (correct)
Occasionally, the gateway is also incorrect (0.0.0.0)
The images have a script that runs 'netsh int ip reset' after sysprep finishes (before the reboot), so it appears that does not solve the issue. (the problem also happens without this step)
After the reboot, using 'i' on the SAC resolves the issue permanently. (But I'd like to know the root cause as having to run 'i' again isn't ideal)
I actually had a customer that had a similar issue from an image from our PXE server. I spent months banging my head against the desk to figure out why. We ended up deciding that the customer just needed to reinstall as we cannot find the root cause. To this day the customer is still running that OS. What we did do was had a powershell script that runs on startup that configures the interface as a work around and the customer has been happy ever since but we have a note on there account for this issue.
Why not just use the route command with the -p (persist) flag.
route -p add mask
This will ensure the route survives a reboot.
I would try using netsh to set your NIC settings rather than the GUI to see if that helps.
Problem could be registry related. Take a look at the key for your nic in hklm\ccc\services and see if it shows all of your static settings.