Windows Server Core 2022--安装DHCP

Posted ganzy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Windows Server Core 2022--安装DHCP相关的知识,希望对你有一定的参考价值。

1.安装 DHCP:

Install-WindowsFeature -Name DHCP

Add-DhcpServerv4Scope -Name 192.168.111.0 -StartRange 192.168.111.50 -EndRange 192.168.111.90 -SubnetMask 255.255.255.0

Set-DhcpServerv4OptionValue -ScopeID 192.168.111.0 -DNSServer 192.168.111.10 -DNSDomain afd.ink -Router 192.168.111.2

Add-DhcpServerInDC -DnsName dc.afd.ink

Get-DhcpServerv4Scope | Select-Object -Property *

2.为SCCM PXE OSD 配置DHCP:

$DhcpHost = DC

$DhcpFQDN = DC.afd.ink

# address of DHCP host

$ScopeID  = 192.168.111.0

# address of PXE host

$Option66 = 192.168.111.11

# Set Vendor Classes:

Add-DhcpServerv4Class -Name "PXEClient (UEFI x64)" -Description "PXEClient:Arch:00007" -Type Vendor -Data "PXEClient:Arch:00007"

Add-DhcpServerv4Class -Name "PXEClient (UEFI x86)" -Description "PXEClient:Arch:00006" -Type Vendor -Data "PXEClient:Arch:00006"

Add-DhcpServerv4Class -Name "PXEClient (Bios x86 & x64)" -Description "PXEClient:Arch:00000" -Type Vendor -Data "PXEClient:Arch:00000"

# Create DHCP Policies (Leaving out the "ScopeId" option will make the policy a server level policy):

Add-DhcpServerv4Policy -Name "PXEClient (UEFI x64)" -Description "UEFI x64 PXE" -Condition OR -VendorClass EQ, "PXEClient (UEFI x64)*" -ComputerName $DhcpFQDN -ScopeId $ScopeID

Add-DhcpServerv4Policy -Name "PXEClient (UEFI x86)" -Description "UEFI x86 PXE" -Condition OR -VendorClass EQ, "PXEClient (UEFI x86)*" -ComputerName $DhcpFQDN -ScopeId $ScopeID

Add-DhcpServerv4Policy -Name "PXEClient (BIOS x86 & x64)" -Description "BIOS x86 & x64 PXE" -Condition OR -VendorClass EQ, "PXEClient (BIOS x86 & x64)*" -ComputerName $DhcpFQDN -ScopeId $ScopeID

# Set Policy Options (If server level policy, do not specify the "ScopeId" option):  

# ....For UEFI x64

#Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x64)" -OptionId 60 -Value PXEClient 

Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x64)" -OptionId 66 -Value $Option66  

Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x64)" -OptionId 67 -Value "smsboot\\x64\\wdsmgfw.efi"  

# ....For UEFI x86

###Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x86)" -OptionId 60 -Value PXEClient  

Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x86)" -OptionId 66 -Value $Option66  

Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x86)" -OptionId 67 -Value "smsboot\\x86\\wdsmgfw.efi"  

# ....For BIOS x86 & x64

Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (BIOS x86 & x64)" -OptionId 66 -Value $Option66  

Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (BIOS x86 & x64)" -OptionId 67 -Value "smsboot\\x64\\wdsnbp.com"  



以上是关于Windows Server Core 2022--安装DHCP的主要内容,如果未能解决你的问题,请参考以下文章

SQL Server Docker 容器能否在 Windows Server core 2022 上运行(“linux”不能在此平台上使用)

Windows Server Core 2022--安装PPTP/L2TP

Windows Server Core 2022--安装AD DS和AD CS证书服务

Switch between Server Core mode and Server GUI mode in Windows Server 2012 R2

Windows Server 2008 Server Core管理

windows Server 2008 R2下Server Core常用命令