#! /bin/bash
#这是安装DHCP的shell脚本
echo "安装DHCP"
yum -y install dhcp
echo "修改配置文件"
cat << EOF > /etc/dhcp/dhcpd.conf
option domain-name "crushlinux.com";
option domain-name-servers 114.114.114.114, 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.200.0 netmask 255.255.255.0 {
range 192.168.200.10 192.168.200.110;
option routers 192.168.200.2;
}
EOF
echo "开启服务,设置为开机自启动"
systemctl start dhcpd
systemctl enable dhcpd
原文地址:https://www.cnblogs.com/tanxiaojuncom/p/11405106.html
时间: 2024-10-13 16:40:56