TFTP+DHCP+NFS+FTP实现网络安装Linux

实施原理:TFTP+DHCP+NFS+VSFTPD

利用TFTP广播,使客户端获得相应的安装信息

利用DHCP来获取网络地址信息

利用NFS共享安装过程中需要的TFTP文件

利用FTP来下载安装过程中的光盘信息

实施步骤:

(一):安装YUM,以简化服务器搭建时RPM包的安装

(1)挂载光盘,并进入目录安装ftp,

[root@localhost Server]# rpm -ivh vsftpd-2.0.5-12.el5.i386.rpm

(2)将光盘内容复制到/var/ftp/pub/

[root@localhost RHEL_5.2 i386 DVD]# cp -R /media/RHEL_5.2\ i386\ DVD/* /var/ftp/pub/

(3) 安装套件yum、createrepo

[root@localhost Server]# rpm -ivh yum-3.2.8-9.el5.noarch.rpm

[root@localhost Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm

(4)制作解决依赖性问题

[root@localhost Server]# createrepo -g /var/ftp/pub/Server/repodata/comps-rhel5-server-core.xml /var/ftp/pub/Server/

[root@localhost Server]# createrepo –g /var/ftp/pub/VT/repodata/comps-rhel5-vt.xml /var/ftp/pub/VT/

[root@localhost Server]# createrepo -g /var/ftp/pub/Cluster/repodata/comps-rhel5-cluster.xml /var/ftp/pub/Cluster

[root@localhost Server]# createrepo -g /var/ftp/pub/ClusterStorage/repodata/comps-rhel5-cluster.xml /var/ftp/pub/ClusterStorage/

(4)配置yum库

[root@localhost Server]# cp -p /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/base.repo

[root@localhost Server]# vim /etc/yum.repos.d/base.repo

[server]

name=Red Hat Enterprise Linux-server

baseurl=ftp://192.168.1.254/pub/Server

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release

[vt]

name=Red Hat Enterprise Linux-vt

baseurl=ftp://192.168.1.254/pub/VT

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Cluster]

name=Red Hat Enterprise Linux-cluster

baseurl=ftp://192.168.1.254/pub/Cluster

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[clusterstorage]

name=Red Hat Enterprise Linux-clusterStorage

baseurl=ftp://192.168.1.254/pub/ClusterStorage

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

~至此yum安装已经完成了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/26687.html