PXE Server build DHCP

PXE(preboot execute environment,預啓動執行環境)是由Intel公司開發的最新技術,工做於Client/Server的網絡模式,支持工做站經過網絡從遠端服務器下載映像,並由此支持經過網絡啓動操做系統,在啓動過程當中,終端要求服務器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)協議下載一個啓動軟件包到本機內存中執行,由這個啓動軟件包完成終端(客戶?)基本軟件設置,從而引導預先安裝在服務器中的終端操做系統。PXE能夠引導多種操做系統,如:Windows95/98/2000/windows2003/windows2008/winXP/win7/win8,linux等。node

  以上來自百度,工廠在測試服務器時,sled(待測服務器)由於出廠的需求,不可能安裝系統。可是爲了測試組裝完成後的sled是否知足出貨的要求,則又必須使用操做系統進行檢測,使用工具進行出貨配置的更新。這邊陷入了一個困境。解決方式:配置PXE服務器,使用PXE引導UUT端啓動後,UUT端經過網絡把啓動系統須要的內核和文件系統download本地內存,UUT端即可以正常啓動系統,無需安裝,不佔用sled硬盤資源,無污染,方便管理。linux

 

這裏介紹一下在RedHat6.2下搭建PXE服務器的具體作法。ios

PXE 服務器windows

須要軟件1,DHCPD 2 tftp-server 3 xinetd 4 syslinux-tftpboot服務器

三個軟件均可以在安裝鏡像中找到,或者安裝時選擇所有安裝。網絡

#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample  
#
# ddns-update-style interim;
DHCPDARGS=eth0;
option space PXE;
option PXE.mtftp-ip               code 1 = ip-address;
option PXE.mtftp-cport            code 2 = unsigned integer 16;
option PXE.mtftp-sport            code 3 = unsigned integer 16;
option PXE.mtftp-tmout            code 4 = unsigned integer 8;
option PXE.mtftp-delay            code 5 = unsigned integer 8;
option PXE.discovery-control      code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr   code 7 = ip-address;

ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp; 
class "pxeclients" {
    match if substring (option vendor-class-identifier,0,9)="PXEClient";
    vendor-option-space PXE;
    option PXE.mtftp-ip 0.0.0.0;
    filename "pxelinux.0";
    }

subnet 192.168.123.0 netmask 255.255.255.0 {
#    option routers                        192.168.70.1;
    option broadcast-address               192.168.123.255;
    option subnet-mask                   255.255.255.0;
    
    option nis-domain                "domain.org";
    option domain-name              "domain.org";
    #option domain-name-servers        server;

    option time-offset              -18000; # Eastern Standard Time
    # --- 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 192.168.123.10 192.168.123.250;
    
    default-lease-time 60;    
    max-lease-time 240;
    }

以上是dhcpd.conf,DHCPD服務的配置文檔,裏面具體參數所表明的含義能夠百度,或者參考鳥哥的私房菜服務器架設篇less

DHCP主要是給UUT端分配一個可用的IP,之後UUT端使用分配的IP才能夠從服務器得到須要的資源。dom

相關文章
相關標籤/搜索