如何在RHEL 5上安装和配置DHCP服务器
时间:2019-08-20 17:58:12 来源:igfitidea点击:
动态主机配置协议(DHCP)是一种客户机/服务器协议,它帮助客户机自动、动态地分配ip地址机器。
DHCP服务器在UDP端口67上运行,DHCP客户端在UDP端口68上运行。
安装和配置DHCP服务器的步骤
(1)安装DHCP包:
yum install dhcpd (in Redhat based OS)
(2)编辑/etc/dhcpd.conf文件:
vi /etc/dhcpd.conf
(3)配置/etc/dhcpd.conf文件:
内容如下:
ddns-update-style interim; ignore client-updates; subnet 10.1.1.0 netmask 255.255.255.0 { range 10.1.1.66 10.1.1.199; # --- default gateway option routers 10.1.1.1; option subnet-mask 255.255.255.0; option ip-forwarding off; #option nis-domain "domain.org"; #option domain-name "domain.org"; option domain-name-servers 222.x.x.x, 222.y.y.y; option broadcast-address 10.255.255.255; #option time-offset 39600; # Eastern Standard Time #option netbios-name-servers 10.1.1.1; # --- Selects point-to-point node (default is hybrid). Dont change this unless # -- you understand Netbios very well option netbios-node-type 8; default-lease-time 1209600; max-lease-time 1209600; }
(4)然后重启dhcpd服务
service dhcpd restart
dhcp默认的端口是67和68。