Linux中的DHCP的安装与配置

1,DHCP的安装 
(1)挂载安装光盘 
image_1cqa2g1rrltlior1h91s271s5054.png-18.1kB
(2)yum安装dhcp 
image_1cqa2itqeqreqpccjm41g8k25h.png-10.5kB 
2,配置DHCP服务

    • 主配置文件:/etc/dhcp/dhcpd.conf
    • 执行程序:/uer/sbin/dhcpd./uer/sbin/dhcrelay是中继命令的位置
    • 服务脚本:/etc/init.d/dhcpd、中继的服务脚本/etc/init.d/dhcrelay
    • 执行参数配置:/etc/sysconfig/dhcpd

DHCP 中继配置:/etc/sysconfig/dhcrelay 
(1)修改配置文件:/etc/dhcp/dhcpd.conf 
image_1cqa39m0t1lao9mh3k0hde12616e.png-4kB 
image_1cqa3dqvtkrl1p55suq1q80112d6r.png-20.4kB

image_1cqa3jtj4840cmr2rp4fs19bf7o.png-11.4kB

image_1cqa4037biao1d1d4vh1a8vs9r85.png-17.3kB
DHCP配置文件大概由三部分组成 
(1)全局配置 
(2)分发范围 
(3)指定固定电脑获取固定地址 
image_1cqa54uuj1n5h16221d8iagd1kb68i.png-36.8kB

image_1cqab49g3rkk10dh11771bqtcnk8v.png-13.8kB

image_1cqabkl0rq6c1kk01li1li4akobs.png-17.1kB 
修改后的配置文件 
image_1crc6b82u1n4b1tf61ibv1m561cm29.png-47.3kB

image_1crc6d7tb1gi1214m9313uul9m.png-6.9kB 
下面测试 
image_1crc6jldd6os12fd6ab11hc1des13.png-50.8kB

image_1crc6nvui1knpek6sv63c1r720.png-28.8kB

设置给一台主机指定IP地址 
image_1crc7pshi1qsm13ivpt21um6i0437.png-32.3kB

image_1crc7rhisps68ks18s27ef15fe44.png-10.4kB

image_1crc7sh1vhdi183tdn113a34v24h.png-22.8kB