pxe安裝centos(1)

本文沒有加入kickstart,是手動安裝重網絡安裝,這樣能讓自己更理解pxe安裝的原理。

本文的服務端環境是centos6.4,客戶端可以是centos5和6的任意一個版本,要注意的是安裝32位的就要拷貝32位的isolinux,不要用64位的。安裝centos5的就用centos5的isolinux,不能用centos6,個人認爲應該是每個大版本,安裝的目錄結構都有些變化。


一、簡單原理介紹

無光驅服務器通過PXE網卡啓動,從dhcp服務器獲取IP 通過tftp 下載pxelinux.0文件找到pxelinux.cfg裏的配置文件,按配置文件找着vmlinuz和intrd.img引導centos進入安裝界面,之後選擇NFS方式安裝系統。

二、搭建環境

非虛擬機,直接就是物理環境server:centos6.4 ip:10.50.1.7

三、安裝配置

安裝軟件yum –y install dhcp* nfs* tftp* 

  1. tfpt的配置

    vim /etc/xinetd.d/tftp

service tftp

{


        disable                 = no  #默認沒有這一行的,默認就是disable=yes

        socket_type             = dgram

        protocol                = udp

        wait                    = yes

        user                    = root

        server                  = /usr/sbin/in.tftpd

        server_args             = -u nobody -s /tftpboot #這裏修改一下加個-u nobody

        disable                 = yes                 #/tftpboot也是自己定義的,記得新建它

        per_source              = 11

        cps                     = 100 2

        flags                   = IPv4

}

重啓xinetd服務 service xinetd restart

加入開開啓啓動 chkconfig  tftp on

2.配置NFS

先掛載系統鏡像mount -o loop /system_iso/CentOS-6.4-x86_64-bin-DVD1.iso /systemabc

echo "/tftpboot" > /etc/exports

echo "/systemabc" >> /etc/exports

exportfs -a

service nfs restart

showmount -e 127.0.0.1


3.hdpc的配置

ddns-update-style interim;

ignore client-updates;

allow booting;

allow bootp;

subnet 10.50.0.0 netmask 255.255.248.0 {

option routers 10.50.0.1;

option subnet-mask 255.255.248.0;

option domain-name-servers 10.50.1.7;

option time-offset -18000;

range dynamic-bootp 10.50.0.21 10.50.0.50;

default-lease-time 21600;

max-lease-time 43200;

next-server 10.50.1.7;                                    #這裏指向的tftp服務器,我這裏是本機ip

filename "/pxelinux.0";                                    #這裏是放在tftp服務根目錄的一個pxe啓動文件,必須

                                                                          #這個文件必須存在才能啓動

}


4.pxe的配置

find / -name pxelinux.0                 #pxelinux.0找不到,需要安裝syslinux,centos6一般

                                                        #在/usr/share/syslinux/pxelinux.0

cp /usr/share/syslinux/pxelinux.0 /tftpboot

mkdir /tftpboot/pxelinux.cfg

cp -a /systemabc/isolinux/* /tftpboot

mv /tftpboot/isolinux.cfg /tftpboot/pxelinux.cfg/default


四.按F11(F12)選擇從網絡啓動

進入開啓選單,選擇1,

選擇通過NFS安裝

10.50.1.7

/systemabc

就開始手動設置安裝系統了



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章