windows2019服务器迁移DHCP服务到CentOS7
windows2019服务器迁移DHCP服务到CentOS7
1、powershell导出服务器全部作用域 Get-Dhcpserverv4Scope -computername WIN-D2F3V83UDDG >> Scope-ip.txt
2、powershell 导出服务器全部保留IP Get-Dhcpserverv4Scope -computername WIN-D2F3V83UDDG | Get-DhcpServerv4Reservation -computername WIN-D2F3V83UDDG >> Reservation-ip.txt
3、powershell 导出排除的IPv4地址范围 Get- Dhcp Serverv4ExclusionRange >> Exclusion-ip.txt
4、修改配置文件 vi /etc/dhcp/dhcpd.conf
dhcpd.conf
option definitions common to all supported networks...
option domain-name "crland.hk"; option domain-name-servers 10.108.50.130;
default-lease-time 86400; max-lease-time 86400;
Use this to enble / disable dynamic dns updates globally.
ddns-update-style none;
If this DHCP server is the official DHCP server for the local
network, the authoritative directive should be uncommented.
authoritative;
Use this to send dhcp log messages to a different log file (you also
have to hack syslog.conf to complete the redirection).
log-facility local7;
This is a very basic subnet declaration.
#CentOS7服务器直连网段 subnet 10.108.50.128 netmask 255.255.255.224 { } #网段IP分配测试 subnet 10.108.50.32 netmask 255.255.255.224 { range 10.108.50.34 10.108.50.62; option routers 10.108.50.33; }
Fixed IP addresses can also be specified for hosts. These addresses
should not also be listed as being available for dynamic assignment.
Hosts for which fixed IP addresses have been specified can boot using
BOOTP or DHCP. Hosts for which no fixed address is specified can only
be booted with DHCP, unless there is an address range on the subnet
to which a BOOTP client is connected which has the dynamic-bootp flag
set.
#分配静态IP测试 host test { hardware ethernet C8:5B:76:A7:4D:9F; fixed-address 10.108.51.44; }
5、重启CentOS7 DHCP服务 systemctl restart dhcpd.service
6、查看CentOS7 DHCP状态 systemctl status dhcpd.service