一、通过yum方式安装dhcp,关于yum配置请参考”config yum”
[[email protected] ~]#yum -y install dhcp
二、修改dhcpd.conf配置文件,此例内网为192.168.1.0/24,网关是192.168.1.1,DHCP IP范围是192.168.1.200至192.168.1.230,DNS服务器用202.45.84.67。
[[email protected] ~]#vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 202.45.84.67;
range dynamic-bootp 192.168.1.200 192.168.1.230;
default-lease-time 604800;
max-lease-time 1209600;
authoritative;
}
host ibmt30 {
hardware ethernet 00:09:6B:30:3D:B3;
fixed-address 192.168.1.200;
}
host andy {
hardware ethernet 00:19:66:1b:7f:7a;
fixed-address 192.168.1.201;
}
三、让dhcpd服务开机启动:
[[email protected] ~]#chkconfig dhcpd on
四、手动启动dhcpd服务:
[[email protected] ~]#service dhcpd start
五、OK!