shell脚本安装DHCP
Posted tanxiaojuncom
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell脚本安装DHCP相关的知识,希望对你有一定的参考价值。
#! /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
以上是关于shell脚本安装DHCP的主要内容,如果未能解决你的问题,请参考以下文章