一、DHCP安装配置

1.安装配置DHCP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 安装DHCP
yum -y install dhcp-sever

# 编辑DHCP配置文件
vim /etc/dhcp/dhcpd.conf

# 内容如下
ddns-upadte-style none;
ignore client-updates;
subnet 192.168.60.0 netmask 255.255.255.0 {
range 192.168.60.50 192.168.60.100;
option subnet-mask 255.255.255.0;
option routers 192.168.60.2;
option domain-name-servers 192.168.60.14;
default-lease-time 3600;
}

# 启动DHCP,DHCP服务的配置文件为空,只有配置后才能启动
systemctl start dhcpd
systemctl enable dhcpd

2.测试

1
2
3
4
# windows测试
ipconfig /release
ipconfig /renev

3.设置MAC地址绑定IP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# MAC地址绑定IP

ddns-update-style none;
ignore client-updates;
subnet 192.168.60.0 netmask 255.255.255.0 {
range 192.168.60.50 192.168.60.100;
option subnet-mask 255.255.255.0;
option routers 192.168.60.2;
option domain-name-servers 192.168.60.14;
default-lease-time 3600;
host test {
hardware ethernet 00:0c:29:20:9D:47;
fixed-address 192.168.60.100;
}
}

二、参数及作用