分类: LINUX
2008-08-18 22:03:07
一. DHCP服务器配置
1.安装DHCP服务软件包
RHEL4第四张光盘,dhcp-
挂载 mount /dev/cdrom /media/cdrom/
安装DHCP包
rpm -ivh /media/cdrom/RedHat/RPMS/dhcp-
2. dhcp.conf配置文件解析
复制样例文件到 /etc/
cp /usr/share/doc/dhcp-
配置实例
Ddns-update-style interim; Ignore client-updates; Subnet # --- default gateway option routers “ option subnet-mask “255.0. # option nis-domain “domain.org”; # option domain-name "domain.org"; # option domain-name-servers # 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-boot default-lease-time 21600; max-lease-time 43200; "/etc/dhcpd.conf" # 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-
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/
5. 启动NIS服务器
启动 Portmap ; ypserv ; yppasswdd 三个服务
6. 构建NIS数据库
/usr/lib/yp/ypinit -m
三. NIS客户端配置
1. 安装NIS客户端软件包(默认已安装)
ypbind-
yp-tools-2.8-7
2. 设置hosts文件
echo ’
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
Shadow: files
Group: files
Hosts: files
6.启动ypbind服务
Portmap ; ypbind启动这两个服务
7. NIS客户机测试与NIS服务器连接
命令: yptest 测试NIS服务器的域名,主机,数据库,内容。
ypwitch –x 查看NIS服务器数据库和映射文件名称
ypcat –x 同上
8. NIS客户端登陆
提示:登陆失败,关闭防火墙。
命令:service iptables stop