1

Scenario: W7 laptop that in the office is joined to a domain with a static I.P. address, but everywhere else needs DHCP.

What is the best approach for (hopefully during start up) to determine which network configuration to use? I have used batch scripts to manually change the net configuration like:

netsh interface ipv4 set address name="Ethernet" source=static address=xx.xxx.xxx.xxx mask=255.255.255.0 gateway=xx.xxx.xxx.xxx
netsh interface ipv4 set dnsservers name="Ethernet" source=static address=xx.xxx.xxx.xxx primary
netsh interface ipv4 add dnsserver name="Ethernet" address=xx.xxx.xxx.xxx index=2

However, I would like a more intelligent approach. Any suggestions?

4
  • 1
    Don't you use DHCP in the domain or do you need the Laptop to always have the same ip while in the domains network?
    – lsmooth
    Jul 31, 2014 at 16:57
  • 1
    Is that a wired network?
    – kasperd
    Jul 31, 2014 at 17:02
  • @lsmooth - I have both situations on the machines I maintain/support. Most are DHCP but some have to have static I.P. addresses for certain interfaces (e.g. for development purposes, some "workstations" at times have to play the part of servers).
    – Forge4Fun
    Jul 31, 2014 at 18:31
  • I was going for what @Cheekaleek wrote (+1 from me). Using DHCP reservations you can have a "static" IP and just let the laptop on DHCP.
    – lsmooth
    Jul 31, 2014 at 18:34

1 Answer 1

3

You would be better served to use DHCP across the board. If your PC on the domain needs a specific address, you can use DHCP reservations to associate it's MAC to an IP.

However, I do wonder what the need for a static address for a workstation is. I can only imagine this leading to more management issues.

2
  • I agree that DHCP is the best approach for network management. I will revisit DHCP reservations. The need for specific addresses is that I have some developers that require configurations that mimic servers for testing purposes.
    – Forge4Fun
    Jul 31, 2014 at 18:35
  • One additional comment: I have some developers that have multiple vitualbox vms used for this purpose, and will only have one vm operational at a time. Therefore, for configuration simplicity, they use the same static I.P. for all vms. I know this is a potential nightmare, but that's the current situation.
    – Forge4Fun
    Jul 31, 2014 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .