标签:dhcp服务 内存 配置 net sub idt .sh otp server
一键搭建dhcpd服务脚本
[root@dhcp-server~]# cat auto_install_dhcpd.sh
#!/bin/sh
. /etc/init.d/functions
#安装dhcpd服务,并配置其配置文件
yum -y install dhcp &>/dev/null
cat /dev/null >/etc/dhcp/dhcpd.conf
cat > /etc/dhcp/dhcpd.conf << EOF
ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;
default-lease-time 201600;
max-lease-time 43200;
option routers 10.0.0.254;
subnet 10.0.0.0 netmask 255.255.255.0 {
range dynamic-bootp 10.0.0.100 10.0.0.150;
#next-server 10.0.0.6;
#filename "/data/sys/kickstart/ks.cfg";
#filename "pxelinux.0";
}
EOF
#启动dhcpd服务并设置开启自启动
systemctl enable dhcpd.service
systemctl start dhcpd.service
#检查服务是否正常
if [ $? -eq 0 ]
then
action "dhcpd.service is OK" /bin/true
else
action "dhcpd.service is false" /bin/false
fi
使用Windows客户端查看dhcp-client端获取地址正常

其他:
标签:dhcp服务 内存 配置 net sub idt .sh otp server
原文地址:https://www.cnblogs.com/blog-tim/p/10697706.html