免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1119 | 回复: 0
打印 上一主题 下一主题

LINUX下搭建DHCP和NIS服务器 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-18 22:03 |只看该作者 |倒序浏览



一. 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. 启动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



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/60434/showart_1133444.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP