LINUX下搭建DHCP和NIS服务器

运维 系统运维
本文讲述的是LINUX下搭建DHCP和NIS服务器的方法,希望对您有所帮助。

一. 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;

        }

}
  

#p#

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. 启动time和time-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

【编辑推荐】

  1. 安装Solaris后:9个主要设置以及NFS和NIS的配置
  2. linux下NIS服务的配置
  3. Linux NIS Server YPSERV远程拒绝服务攻击漏洞
责任编辑:赵宁宁 来源: DIY部落
相关推荐

2009-09-17 13:23:22

NIS服务器

2011-01-07 09:25:35

LinuxDHCP服务器

2010-08-05 13:56:06

路由器配置

2010-01-20 10:44:01

linux DHCP服务器

2010-08-25 21:34:15

DHCP服务器

2009-09-17 18:07:51

Nis服务器

2009-09-17 18:04:42

Nis服务器

2009-09-17 17:37:05

Nis服务器

2009-09-17 18:05:51

Nis服务器

2010-08-23 17:31:23

LinuxDHCP服务器

2010-09-02 14:09:06

LinuxDHCP服务器

2009-09-17 18:09:53

Nis服务器

2010-08-25 21:42:57

DHCP服务器

2009-08-07 10:05:53

2009-09-11 08:49:09

linuxNIS服务linux配置

2010-09-01 17:15:45

Linux DHCP

2009-09-25 10:13:15

2010-08-30 20:16:25

DHCP服务器

2009-09-17 18:02:06

2012-05-09 10:30:29

RHEL5.7DHCP服务器
点赞
收藏

51CTO技术栈公众号