標(biāo)簽:
1、查看系統(tǒng)有沒(méi)有安裝DHCP:rpm -ql dhcp
2、如果沒(méi)有安裝,則進(jìn)行安裝:yum install dhcp
3、配置DHCP:
vim /etc/dhcp/dhcpd.conf
#1.整體的環(huán)境配置
ddns-update-style none; //不要更新DNNS的設(shè)定
ignore client-updates; //忽略客戶端的DNS
default-lease-time 7200; //預(yù)設(shè)租約為2個(gè)小時(shí) 60*60*2=7200秒
max-lease-time 14400; //最大租約為4個(gè)小時(shí)
option routers 172.16.1.1; //網(wǎng)關(guān)
option domain-name “dhcp-server”; // 服務(wù)器名稱
option domain-name-servers 202.96.128.166; //DNS 服務(wù)器
#2.動(dòng)態(tài)分配IP,即地址池
subnet 172.16.1.0 netmask 255.255.255.0 {
range 172.16.1.100 172.16.1.200; //分配的IP范圍
}
4.配置監(jiān)聽的網(wǎng)卡
vim /etc/sysconfig/dhcpd
DHCPDARGS=”eth1″ //內(nèi)網(wǎng)卡
5.啟動(dòng)DHCP服務(wù)并設(shè)置成開機(jī)啟動(dòng)
/etc/init.d/dhcpd start
chkconfig dhcpd on
6.租約地址池查看:
cat /var/lib/dhcp/dhcp.leases
|