yum -y install dhcp &>/dev/null
read -p "需要分配的网段:" dou
read -p "分配网络的区域:" yan ru
read -p "请输入网关:" yun
cat << END > /etc/dhcp/dhcpd.conf
option domain-name "example.org";
option domain-name-servers 202.106.0.20,8.8.8.8;
read -p "需要分配的网段:" dou
read -p "分配网络的区域:" yan ru
read -p "请输入网关:" yun
cat << END > /etc/dhcp/dhcpd.conf
option domain-name "example.org";
option domain-name-servers 202.106.0.20,8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
max-lease-time 7200;
subnet $dou netmask 255.255.255.0 {
range $yan $ru;
option routers $yun;
}
END
systemctl start dhcpd
systemctl enable dhcpd
range $yan $ru;
option routers $yun;
}
END
systemctl start dhcpd
systemctl enable dhcpd