Windows Server Core 2022--(2)安装DHCP

网友投稿 843 2022-09-17

Windows Server Core 2022--(2)安装DHCP

Windows Server Core 2022--(2)安装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"

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:#yyds干货盘点# 查看局域网的空闲IP
下一篇:元组、列表也能比较大小(元组中的元素可按值的大小排序)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~