主网卡ens192:172.16.35.128/24(子网A)
新增网卡ens224:172.16.38.128/24(子网B)
1. 安装DHCP服务
Rpm -q dhcp-server
dnf install -y dhcp-server
systemctl start dhcpd
systemctl enable dhcpd
2. 主配置文件修改
编辑/etc/dhcp/dhcpd.conf:
option domain-name 'example.com';
default-lease-time 600;
max-lease-time 7200;
authoritative;
shared-network SUPER_SCOPE {
# 子网1配置
subnet 172.16.35.0 netmask 255.255.255.0 {
range 172.16.35.100
172.16.35.200;
option domain-name-servers ns1.internal.example.org;
option domain-name 'internal.example.org';
option routers 172.16.35.2;
option domain-name-servers 8.8.8.8;
option broadcast-address 172.16.35.255;
default-lease-time 600;
max-lease-time 7200;
}
host abc {
hardware ethernet 00:50:56:c0:00:08;
fixed-address 172.16.35.129;
}
新增网卡ens224:172.16.38.128/24(子网B)
1. 安装DHCP服务
Rpm -q dhcp-server
dnf install -y dhcp-server
systemctl start dhcpd
systemctl enable dhcpd
2. 主配置文件修改
编辑/etc/dhcp/dhcpd.conf:
option domain-name 'example.com';
default-lease-time 600;
max-lease-time 7200;
authoritative;
shared-network SUPER_SCOPE {
option domain-name-servers 8.8.8.8;
}
