How To Add the DHCP Server Role with netsh
What is DHCP? An IP address is dynamically assigned from a server that contains a pool of addresses. The server leases the computer one of the available addresses for a specified amount of time. Once the specified time has expired, the computer renews the lease or requests a new IP address.
To install the DHCP Server role do the following
- At a command prompt, complete the following steps by typing:
- Start the dhcp service with the following command: start /w ocsetup DHCPServerCore
- Set the service type to automatic by entering sc config dhcpserver start= auto
- To start the dhcp service type: net start dhcpserver
- Authorize the DHCP server in Active Directory by typing: netsh dhcp add server DC1.seowebz.local 192.168.8.9
- Add a scope by typing: netsh dhcp server \\DC1 add scope 192.168.8.0 255.255.255.0 SCOPENAME
- Add a lease range by typing: netsh dhcp server \\DC1 scope 192.168.8.0 add iprange 192.168.8.150 192.168.8.199
- Add the default gateway by setting optionvalue 3: netsh dhcp Server \\DC1 Scope 192.168.8.0 set optionvalue 3 IPADDRESS 192.168.8.1
- Add the DNS servers by setting optionvalue 6: netsh dhcp Server \\DC1 Scope 192.168.8.0 set optionvalue 6 IPADDRESS 192.168.8.2 192.168.8.3