Centos安装DHCP

发表于 2020-12-28  246 次阅读


ping www.hubat.cn//确保网络正常
yum -y install dhcp
//在线安装DHCP组件
scp -p /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample

/etc/dhcpd/dhcpd.conf

cd /etc/dhcp
vi dhcpd.conf

#dhcp.conf

ddns-update-style interim;ignore client-updates;

subnet 192.168.247.0//定义子网
netmask 255.255.255.0 {
//定义子网掩码
range 192.168.247.200 192.168.247.210;
//定义子网范围
option domain-name-servers ns.example.org;
//定义要分配的dns服务器地址
option domain-name "example.org";
//定义要分配的域名
option routers 192.168.247.104;
//定义网关
option subnet-mask 255.255.255.0;

default-lease-time 600;

max-lease-time 7200;

host master {

hardware ethernet 08:00:27:2C:30:8C;//网卡
fixed-address 192.168.247.206;//静态IP }vi /etc/rc.d/init.d/dhcpd//

修改用户跟用户组
user=root
group=root
service dhcpd restart//重启DHCP

本站文章基于国际协议BY-NA-SA 4.0协议共享;
如未特殊说明,本站文章皆为原创文章,请规范转载。

0