Linux下DHCP服务器的构建攻略

charthyf 2007-12-13

本来在Linux下研究DNS服务器架设的,最近一直看DNS的书,头都大了,想换个来玩玩,就选DHCP了,原以为应该要花个一天才能搞定的,结果只看了一下理论,一下子就搞定可,真是太简单了。原来还想找本专门研究DHCP的书来看看,深入下去看看的,结果都找不到,汗,原来Linux下DHCP真是是这么简单么?

1、OS系统版本
[root@server ~]# more /etc/RedHat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

2、查看Linux系统是否已经安装DHCP服务端软件
[root@server ~]# rpm -qa | grep dhcp
dhcpv6_client-0.10-14_EL4

3、将光盘mount上去,然后安装DHCP服务端软件
[root@server ~]# mount /media/cdrom
mount: block device /dev/hdc is write-protected, mounting read-only
[root@server RPMS]# find /media/cdrom -name "dhcp*"
/media/cdrom/RedHat/RPMS/dhcpv6-0.10-14_EL4.i386.rpm
/media/cdrom/RedHat/RPMS/dhcpv6_client-0.10-14_EL4.i386.rpm
/media/cdrom/RedHat/RPMS/dhcp-3.0.1-58.EL4.i386.rpm
/media/cdrom/RedHat/RPMS/dhcp-devel-3.0.1-58.EL4.i386.rpm
[root@server RPMS]# rpm -ivh /media/cdrom/RedHat/RPMS/dhcp-3.0.1-58.EL4.i386.rpm
[root@server RPMS]# rpm -qa | grep dhcp
dhcp-3.0.1-58.EL4
dhcpv6_client-0.10-14_EL4

到这儿已经安装成功了,哈哈

4、查看一下,都有那些文件
[root@server RPMS]# rpm -ql grep dhcp
...
/etc/dhcpd.conf ----------------------------dhcp配置文件
/etc/rc.d/init.d/dhcpd
/etc/rc.d/init.d/dhcrelay
/etc/sysconfig/dhcpd
/etc/sysconfig/dhcrelay
/usr/bin/omshell
/usr/sbin/dhcpd
/usr/sbin/dhcrelay
/usr/share/doc/dhcp-3.0.1
/usr/share/doc/dhcp-3.0.1/README
/usr/share/doc/dhcp-3.0.1/RELNOTES
/usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample-----dhcp配置文件的模板
/usr/share/man/man1/omshell.1.gz
/usr/share/man/man5/dhcp-eval.5.gz
/usr/share/man/man5/dhcpd.conf.5.gz
/usr/share/man/man5/dhcpd.leases.5.gz
/usr/share/man/man8/dhcpd.8.gz
/usr/share/man/man8/dhcrelay.8.gz
/var/lib/dhcp
/var/lib/dhcp/dhcpd.leases -----------------分配IP的那个日志文件

相关推荐