Chinaunix首页 | 论坛 | 博客
  • 博客访问: 169124
  • 博文数量: 14
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 650
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-26 01:38
文章分类

全部博文(14)

文章存档

2011年(1)

2008年(13)

我的朋友
最近访客

分类: LINUX

2008-08-18 22:03:07

 

 

. DHCP服务器配置

 

1.安装DHCP服务软件包

RHEL4第四张光盘,dhcp-3.0.1-12_EL.i386.rpm

挂载 mount /dev/cdrom /media/cdrom/

安装DHCP

rpm -ivh /media/cdrom/RedHat/RPMS/dhcp-3.0.1-12_EL.i386.rpm

 

2. dhcp.conf配置文件解析

复制样例文件到 /etc/

cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf

配置实例

Ddns-update-style interim;

Ignore client-updates;

 

Subnet  10.0.0.0  netmask  255.0.0.0  {       

# --- default gateway

        option routers                   10.0.0.0.1”;

        option subnet-mask              “255.0.0.0”;

     

#       option nis-domain                “domain.org”;

#       option domain-name              "domain.org";

#       option domain-name-servers       10.0.0.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 10.0.0.100 10.0.0.200;

        default-lease-time 21600;

        max-lease-time 43200;

"/etc/dhcpd.conf" 31L, 852C                                   1,1         

        # 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;

        }

}

 

3. 多网络接口时需要配置文件

  /etc/sysconfig/dhcpd

  DHCPDARGS=[网络接口]

 

4. 启动dhcpd服务

  Service dhcpd start

 

5. 客户端配置动态获取IP

 

. NIS服务器配置

 

1. 安装NIS服务软件包

默认安装NIS服务器查询和管理工具软件

  ypbind-1.17.2-3

  yp-tools-2.8-7

  NIS服务器RPM包,位于第一张盘 ypserv-2.13-5.i386.rpm

 

2. 启动timetime-udp服务

   Chkconfig time on

   Chkconfig time-udp on

重启xinetd

 

3. 建立NIS域名 

 Nisdomainname nisserver

 启动自动加载

 Echo /bin/nisdomainname nisserver >> /etc/rc.d/rc.local

 Echo  ‘NISDOMAIN=nisserver’  >>  /etc/sysconfig/network

 

4. 设置ypserv.cond服务配置文件

1 ypserv.conf 文件配置“/etc/ypserv.conf

2 手工建立securenets安全配置文件 /var/yp/securenets”

      Host 127.0.0.1

      255.0.0.0/10.0.0.0

 

5. 启动NIS服务器

启动 Portmap ; ypserv ; yppasswdd 三个服务

 

6. 构建NIS数据库

 /usr/lib/yp/ypinit -m

 

 

. NIS客户端配置

 

1. 安装NIS客户端软件包(默认已安装)

   ypbind-1.17.2-3

   yp-tools-2.8-7

 

2. 设置hosts文件

   echo ’10.0.0.10  localhost.localdomain’  >> /etc/hosts

 

3. 建立NIS域名

   Nisdomainname nisclient

   启动自动加载

   Echo /bin/nisdomainname nisclient >> /etc/rc.d/rc.local

   Echo  ‘NISDOMAIN=nisclient’  >>  /etc/sysconfig/network

 

4. 设置yp.conf配置文件

  Echo  ‘domain  [域名]  server  [主机名] ’  >> /etc/yp.conf

 

5. 设置/etc/nsswitch.conf文件使用NIS

   Passwd:      files nis

   Shadow:      files nis

   Group:       files nis

   Hosts:        files nis dns

 

6.启动ypbind服务

  Portmap ; ypbind启动这两个服务

 

7. NIS客户机测试与NIS服务器连接

  命令:   yptest  测试NIS服务器的域名,主机,数据库,内容。

          ypwitch –x  查看NIS服务器数据库和映射文件名称

          ypcat –x  同上

 

8. NIS客户端登陆

  提示:登陆失败,关闭防火墙。

  命令:service iptables stop

 

阅读(751) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~