- 论坛徽章:
- 0
|
DHCP服务器的安装
在配置好试验环境之后,我们使用SecureCRT软件使用主机的XP系统进行远程登陆,这样做的目的是方便我们在遇见一些问题的时候可以很方便的将错误代码复制出来,能更好的解决问题。
启动SecureCRT,点击文件》快速连接,在出来的界面,主机名填写要登陆的服务器IP地址,之后会弹出一个输入账号密码的对话框,我们填写Linux服务器的账号密码即可登陆。
我们要做的是DHCP服务器,挂载CentOS系统光盘
[root@a /]# mount /dev/cdrom /mnt 挂载光盘
mount: block device /dev/cdrom is write-protected, mounting read-only 提示挂载成功,属性为只读.
[root@a /]# cd /mnt/CentOS/ 进入光盘中RPM包的目录
[root@a CentOS]# ll|grep dhcp 筛选下DHCP相关rpm包
-rw-r--r-- 1 500 500 886673 Sep 20 2009 dhcp-3.0.5-21.el5.i386.rpm
-rw-r--r-- 1 500 500 134095 Sep 20 2009 dhcp-devel-3.0.5-21.el5.i386.rpm
-rw-r--r-- 1 500 500 196530 Sep 20 2009 dhcpv6-1.0.10-17.el5.i386.rpm
-rw-r--r-- 1 500 500 125887 Sep 20 2009 dhcpv6-client-1.0.10-17.el5.i386.rpm
-rw-r--r-- 1 500 500 62038 Sep 20 2009 libdhcp-1.20-10.el5.i386.rpm
-rw-r--r-- 1 500 500 249562 Sep 20 2009 libdhcp4client-3.0.5-21.el5.i386.rpm
-rw-r--r-- 1 500 500 383828 Sep 20 2009 libdhcp4client-devel-3.0.5-21.el5.i386.rpm
-rw-r--r-- 1 500 500 93172 Sep 20 2009 libdhcp6client-1.0.10-17.el5.i386.rpm
-rw-r--r-- 1 500 500 125786 Sep 20 2009 libdhcp6client-devel-1.0.10-17.el5.i386.rpm
-rw-r--r-- 1 500 500 70990 Sep 20 2009 libdhcp-devel-1.20-10.el5.i386.rpm
-rw-r--r-- 1 500 500 226279 Sep 20 2009 sblim-cmpi-dhcp-0.5.5-35.el5.i386.rpm
-rw-r--r-- 1 500 500 9989 Sep 20 2009 sblim-cmpi-dhcp-devel-1-35.el5.i386.rpm
-rw-r--r-- 1 500 500 22886 Sep 20 2009 sblim-cmpi-dhcp-test-1-35.el5.i386
[root@a CentOS]# rpm -ivh dhcp-3.0.5-21.el5.i386.rpm 安装软件包
warning: dhcp-3.0.5-21.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:dhcp ########################################### [100%]
Dhcpd的配置文件在/etc/dhcpd.conf,我们试着去看一下这个配置文件
[root@a CentOS]#chkconfig –level 35 dhcpd on 设置dhcp服务开机自动运行
[root@a CentOS]# vi /etc/dhcpd.conf
我们将会看到如下的内容,
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
#
请注意黑体的部分,大意是让我们去查看/usr/share/doc/dhcp*/dhcpd.conf.sample,那我们就别傻愣着了,去看看吧
[root@a CentOS]# vi /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample
看到的内容如下:
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
} |
|