Tiny PXE Server簡介
Tiny PXE Server是一款小巧而功能強大的網啟軟件。支持DHCP TFTP HTTP BINL DNS等多個協議,支持grub4dos,pxelinux,ipxe等多個引導器,支持從PXE/gPXE/IPXE啟動,最新版居然能夠直接從互聯網通過http協議啟動,實在逆天。
Tiny PXE Server下載地址:http://erwan.labalec.fr/tinypxeserver/pxesrv.zip
1、啟動IPXE
Tiny PXE Server可以直接加載自定義的外置腳本菜單,所以Tiny PXE Server搭配IPXE啟動,真是絕配,不用搭建linux編譯環境編譯IPXE啟動菜單,或者是翻牆從https://rom-o-matic.eu/網站編譯。IPXE比PXE相比,由於采用了HTTP協議傳輸文件,傳輸速度大大提高。
①雙擊pxesrv.exe啟動Tiny PXE Server,啟動文件選擇ipxe.pxe或者undionly.kpxe,undionly.kpxe僅加載UNDI而不加載PXE,后綴kpxe中的k表示keep UNDI,undionly.kpxe會通過UNDI復用網卡自身PXE軟件棧的驅動。ipxe.pxe不加載UNDI,也不加載PXE,只能通過iPXE自己實現的硬件驅動來操作網卡。如果該網卡不被iPXE支持,就會出錯。
【注意】Tiny PXE Server會把啟動文件所在的目錄設置為root path,root path子目錄下的文件才可以通過http訪問到,root path以上的文件無法訪問。例如:如果把ipxe.pxe放在E:\boot\目錄下,root path=E:\boot\,訪問E:\boot\imgs\目錄下的ISO文件是http://${next-server}/imgs/TonPE_net.iso,而不是http://${next-server}/boot/imgs/TonPE_net.iso,注意root path的設置,文件相對位置關系必須與菜單對應,否則會發生找不到文件的錯誤。
②Filename if user-class=gPXE or IPXE,輸入自定義腳本菜單ipxemenu.ipxe,這是我編寫的ipxe啟動腳本,更詳細的可以參考下載的安裝包pxesrv.zip里面的menu.ipxe。
最新版的啟動文件ipxe.pxe/undionly.kpxe可以從以下地址下載:http://boot.ipxe.org/
IPXE.KRN可以從上面網址中ipxe.iso中提取,用來從linux內核轉到ipxe啟動。
③其他配置Tiny PXE Server會自動配置,基本屬於免配置。注意OPT17(root path)是dhcp root path (例如iscsi, aoe) ,而不是一個file root path,如果不用應該保持空白。
④右擊歷史記錄框可以保存當前配置文件到exe所在目錄的config.ini文件,修改配置文件之后,建議重新啟動Tiny PXE Server,先點右上角的offline,然后單擊online啟動Tiny PXE Server。如果配置文件弄亂了,建議刪除config.ini,然后重新配置並保存。
ipxemenu.ipxe
#!ipxe set menu-timeout 3000 set menu-default tongyonpe_net isset ${ip} || dhcp isset ${next-server} || set next-server 192.168.168.105 :start menu iPXE Boot Menu item --gap -- --------------------------------- iPXE Boot Menu-------------------------------- item tongyonpe_net tongyonpe_net item tongyonpe tongyonpe item tongyon7pe tongyon7pe item grub4dos grub4dos item pxelinux pxelinux item reboot Reboot item exit Exit (boot local disk) item --gap -- ---------------------------------------------------------------------- choose --timeout ${menu-timeout} --default ${menu-default} selected goto ${selected} :tongyonpe_net initrd http://${next-server}/imgs/TonPE_net.iso #chain http://${next-server}/pxelinux.cfg/memdisk raw iso chain http://${next-server}/grub/grub.exe --config-file="map (rd)+1 (0xff);map --hook;chainloader (0xff)" :tongyonpe initrd http://${next-server}/imgs/TonPE.iso #chain http://${next-server}/pxelinux.cfg/memdisk raw iso chain http://${next-server}/grub/grub.exe --config-file="map (rd)+1 (0xff);map --hook;chainloader (0xff)" :tongyon7pe initrd http://${next-server}/imgs/TonPE_V3.3.iso #chain http://${next-server}/pxelinux.cfg/memdisk raw iso chain http://${next-server}/grub/grub.exe --config-file="map (rd)+1 (0xff);map --hook;chainloader (0xff)" :grub4dos chain http://${next-server}/grub/grldr goto start :pxelinux #dhcp dhcp net0 set 210:string tftp://${next-server}/ #set 210:string tftp://${dhcp-server}/ chain ${210:string}pxelinux.0 goto start :reboot reboot :exit exit
2、啟動grub4dos
啟動文件選擇grldr即可,其他留空白。
3、啟動pxelinux
啟動文件選擇pxelinux.0即可,其他留空。
個人覺得玩IPXE<==>grub4dos<==>pxelinux互相切換引導,沒啥意思,選擇哪個引導器就直接讓他做第一引導就是了。
grub4dos通用菜單及相關工具包http://yunpan.cn/cyuuUtUQMfmGN 提取碼 c2ac