1.[root@michaelRPMS]#rpm -ivh dhcp-3.0.1-58.EL4.i386.rpm dhcp-devel-3.0.1-58.EL4.i386.rpm --force
warning: dhcp-3.0.1-58.EL4.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:dhcp ########################################### [ 50%]
2:dhcp-devel ########################################### [100%]
2.[root@michael ~]# rpm -qa | grep dhcp
dhcpv6_client-0.10-14_EL4
dhcp-3.0.1-58.EL4
dhcp-devel-3.0.1-58.EL4
3. [root@michael ~]# vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
option domain-name "fung.com";
option domain-name-servers 192.168.1.1,202.96.128.166,202.96.134.133;
shared-network mynet {
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option time-offset -18000; # Eastern standard Time
range 192.168.1.100 192.168.1.200;
default-lease-time 21600;
max-lease-time 43200;
}
subnet 192.168.5.0 netmask 255.255.255.0 {
option routers 192.168.5.1;
option subnet-mask 255.255.255.0;
range 192.168.5.100 192.168.5.200;
default-lease-time 21600;
max-lease-time 43200;
}
}
4. [root@michael ~]# service dhcpd restart
Shutting down dhcpd: [ OK ]
Starting dhcpd: [ OK ]
5. [root@michael ~]# service dhcpd status
dhcpd (pid 3641) is running...
6. [root@michael ~]# chkconfig --list dhcpd
dhcpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
7.[root@michael ~]# chkconfig --level 35 dhcpd on
8. [root@michael ~]# chkconfig --list dhcpd
dhcpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
9.clietn:
10.[root@michael ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
11. [root@michael ~]# vi /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=
12. [root@michael ~]# vi /etc/sysconfig/dhcrelay
# Command line options here
INTERFACES="接口"
DHCPSERVERS="服务器IP/主机名"
~
13. [root@michael ~]# service dhcrelay restart
14.[root@michael ~]# vi /var/lib/dhcp/dhcpd.leases
# All times in this file are in UTC (GMT), not your local timezone. This is
# not a bug, so please don't ask about it. There is no portable way to
# store leases in the local timezone, so please don't request this as a
# feature. If this is inconvenient or confusing to you, we sincerely
# apologize. Seriously, though - don't ask.
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.0.1
lease 192.168.5.200 {
starts 4 2009/07/30 08:38:37;
ends 4 2009/07/30 14:38:37;
binding state active;
next binding state free;
hardware ethernet 00:1d:60:c8:60:d8;
uid "\001\000\035`\310`\330";
client-hostname "michaelfung";
}
lease 192.168.5.200 {
starts 4 2009/07/30 08:38:42;
ends 4 2009/07/30 08:38:42;
tstp 4 2009/07/30 08:38:42;
binding state free;
}
"/var/lib/dhcp/dhcpd.leases" 50L, 1568C .
本文出自 “michaelfung_专栏” 博客,转载请与作者联系!