DHCP服务和NIS服务
} } 在配置文件中增加如下内容: subnet 192.168.100.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.100.1; option subnet-mask 255.255.255.0; option domain-name-servers 192.168.20.2; range 192.168.100.128 192.168.100.254; default-lease-time 21600; max-lease-time 43200; } 启动dhcpd服务 [root@xapc ~]# service dhcpd start Starting dhcpd: [ OK ] 步骤二、在dhcp中继代理Linux B上做如下配置: eth0及eth1设置如下: [root@xapc ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:89:5E:16 inet addr:192.168.20.1 Bcast:192.168.20.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe89:5e16/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1415 errors:0 dropped:0 overruns:0 frame:0 TX packets:35 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:161233 (157.4 KiB) TX bytes:4361 (4.2 KiB) Interrupt:185 Base address:0x1400 eth1 Link encap:Ethernet HWaddr 00:0C:29:89:5E:20 inet addr:192.168.100.1 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe89:5e20/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1434 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:164142 (160.2 KiB) TX bytes:840 (840.0 b) Interrupt:169 Base address:0x1480 同Linux C一样检查并安装dhcp软件包 [root@xapc ~]# rpm -q dhcp package dhcp is not installed [root@xapc ~]# mount /dev/cdrom /media mount: block device /dev/cdrom is write-protected, mounting read-only [root@xapc ~]# rpm -ivh /media/Server/dhcp-3.0.1-12_EL.i386.rpm warning: /media/cdrom/Server/dhcp-3.0.1-12_EL.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing... ########################################### [100%] 1:dhcp ########################################### [100%] 修改dhcp中继的配置文件如下: [root@xapc ~]# cat /etc/sysconfig/dhcrelay # Command line options here INTERFACES="eth0 eth1" DHCPSERVERS="192.168.20.2" 启动dhcprelay服务 [root@xapc ~]# service dhcrelay start Starting dhcrelay: [ OK ] 启用ip转发 [root@xapc ~]# echo "1" > /proc/sys/net/ipv4/ip_forward 步骤三、这时,可以在Linux A上进行IP的自动获取. 在dhcp客户端Linux A自动获取IP后,查看dhcp服务器Linux C上的数据库文件: [root@xapc ~]# tail -7 /var/lib/dhcp/dhcpd.leases lease 192.168.20.2 { starts 6 2011/10/28 09:23:32; ends 6 2011/10/28 15:23:32; binding state active; next binding state free; hardware ethernet 00:0c:29:55:3a:2e; } dhcp服务器已经成功为192.168.20.0网段分配IP. 1.4 NIS服务NIS(网络信息服务)也称YP(Yellow Pages)协议,是一个提供目录服务的RPC(远程过程调用)应用服务.NIS简化了UNIX和LINUX桌面客户的管理工作,客户端利用它可以使用中心服务器的管理文件.桌面系统的用户无需建立他们自己的/etc/passwd,他们只简单的使用维护在NIS服务器的文件即可. NIS是一个客户机/服务器系统,ypbind是定义NIS服务器的客户端进程.一旦确定了服务器位置,客户机绑定到了服务器上,客户端的查询都发往服务器.ypserv是回 |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |