DHCP简单配置

Posted 皮特王同学

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DHCP简单配置相关的知识,希望对你有一定的参考价值。

DHCP是什么?

DHCP动态主机地址管理协议(Dynamic Host Configuration Protocol)是一种基于UDP协议且仅限用于局域网内使用的网络协议,最主要的用途是为局域网内部设备或网络供应商自动分配IP地址等网卡参数,通常会应用在大型的局域网环境中或局域网内存在比较多的移动办公设备。

安装与配置

[[email protected] ~]# cat /etc/redhat-release 
CentOS release 6.6 (Final)
[[email protected] ~]# uname -rm
2.6.32-504.el6.x86_64 x86_64
[[email protected] ~]# yum install -y dhcp
[[email protected] ~]# vim /etc/dhcp/dhcpd.conf
dns-update-style none;
ignore client-updates;
subnet 172.16.1.0 netmask 255.255.255.0 {

range 172.16.1.50 172.16.1.150;
option subnet-mask 255.255.255.0;
option routers 172.16.1.88;
option domain-name-servers 172.16.1.88;
default-lease-time 21600;
max-lease-time 43200;

}
[[email protected] ~]# /etc/init.d/dhcpd start
[[email protected] ~]# chkconfig dhcpd on

 分配固定IP

[[email protected] ~]# vim /etc/dhcp/dhcpd.conf

ddns-update-style none;
ignore client-updates;
subnet 172.16.1.0 netmask 255.255.255.0 {

range 172.16.1.50 172.16.1.150;
option subnet-mask 255.255.255.0;
option routers 172.16.1.88;
option domain-name-servers 172.16.1.88;
default-lease-time 21600;
max-lease-time 43200;

host test {
hardware ethernet 00:0c:29:b0:c3:bb;
fixed-address 172.16.1.100;
}

}

[[email protected] ~]# /etc/init.d/dhcpd restart

以上是关于DHCP简单配置的主要内容,如果未能解决你的问题,请参考以下文章

DHCP工作流程与简单配置

DHCP的简单配置

dhcp的简单应用

DHCP简单配置

简单实验:DHCP配置

Linux命令:dhcp配置