I frequently have a need to use small VMS to quickly prototype things. And lately I have been all deep in Server 2012.
Just to give myself some extra pain I have also been using Server Core whenever I have no absolute need for a GUI (getting off that Windows graphical console point-and-click bandwagon).
My latest adventure is to quickly create a DHCP Server.
Just to get this running is really rather painless in the end. And figuring out the proper PowerShell commands was pretty straightforward as well.
Begin with a Server 2012 Core installation.
Make sure it has a manually assigned IP. ( you can use SCVMM 2012 SP1 CTP1/2 – or Set-NetIPAddress ).
Add the DHCP role:
Create a scope:
Add-DhcpServerv4Scope –StartRange 192.168.1.5 –EndRange 192.168.1.254 –SubnetMask 255.255.255.0 –Name “192.168.1.x” –State Active
Believe it or not. That is it. Just create a VM and test it.
Mind you, this is just a DHCP server, I did not do any Active Directory integration or extra DHCP custom scope configuration. I figure that will come in due time.
Okay, lets do a couple settings, especially for Provisioning Server fans.
Set-DhcpServerv4OptionDefinition –OptionId 66 –DefaultValue 192.168.1.2
Set-DhcpServerv4OptionDefinition –OptionId 67 –DefaultValue ARDBP32.BIN
Lets suppose you want to change the IP range. First you must know the ScopeId, as that is required by the Set-
Set-DhcpServerv4Scope –ScopeId <> –StartRange 192.168.1.100 –EndRange 192.168.1.254
If you want the DHCP server to respond to both DHCP and BOOTP then you can change that option as well:
Set-DhcpServerv4Scope –ScopeId <> –Type Both