Show Table of Contents
30.2. 網路開機設定
下一步,請複製啟始安裝所需的檔案至
tftp 伺服器,因此在客戶端要求這些檔案時能夠在伺服器上找到。tftp 伺服器通常與輸出安裝程式樹的網路伺服器相同。
BIOS 與 EFI 的 PXE 開機配置步驟並不相同。Power Systems 伺服器需要獨立的 yaboot 配置步驟。
30.2.1. 為 BIOS 配置 PXE Boot
- 如果您尚未安裝 tftp-server,請執行
yum install tftp-server。 - 在
/etc/xinet.d/tftp裡的 tftp-server 配置檔案中,請將disabled參數從yes改為no。 - 配置 DHCP 伺服器使用開機映像檔(包含 SYSLINUX)。(如果您沒有 DHCP 伺服器,請參閱《Red Hat Enterprise Linux 建置指南‧DHCP 伺服器》。
/etc/dhcp/dhcpd.conf的範例配置看起來會像:option space pxelinux; option pxelinux.magic code 208 = string; option pxelinux.configfile code 209 = text; option pxelinux.pathprefix code 210 = text; option pxelinux.reboottime code 211 = unsigned integer 32; subnet 10.0.0.0 netmask 255.255.255.0 { option routers 10.0.0.254; range 10.0.0.2 10.0.0.253; class "pxeclients" { match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 10.0.0.1; if option arch = 00:06 { filename "pxelinux/bootia32.efi"; } else if option arch = 00:07 { filename "pxelinux/bootx64.efi"; } else { filename "pxelinux/pxelinux.0"; } } host example-ia32 { hardware ethernet XX:YY:ZZ:11:22:33; fixed-address 10.0.0.2; } } - 您現在需要 ISO 映像檔中 SYSLINUX 套件的
pxelinux.0檔案。要存取這檔案,請以 root 身分執行以下指令:mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,rocp -pr /mount_point/Packages/syslinux-version-architecture.rpm /publicly_available_directoryumount /mount_point將套件解壓縮:rpm2cpio syslinux-version-architecture.rpm | cpio -dimv - 在
tftpboot中建立pxelinux目錄,並將pxelinux.0複製至此目錄:mkdir /var/lib/tftpboot/pxelinuxcp publicly_available_directory/usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux - 在
pxelinux中建立pxelinux.cfg目錄:mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg - 在這目錄中建立配置檔案。這檔案應該名為
default或根據 IP 位址命名。舉例來說,如果您的電腦 IP 位址為 10.0.0.1,那麼檔名應該為0A000001./var/lib/tftpboot/pxelinux/pxelinux.cfg/default的範例配置看起來像:default vesamenu.c32 prompt 1 timeout 600 display boot.msg label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz append initrd=initrd.img label vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodeset label rescue menu label ^Rescue installed system kernel vmlinuz append initrd=initrd.img rescue label local menu label Boot from ^local drive localboot 0xffff label memtest86 menu label ^Memory test kernel memtest append -
欲知指定安裝來源的指示,請參閱〈節 7.1.3, “額外開機選項”〉。 - 將 splash 映像檔複製到
tftp根目錄:cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/pxelinux/splash.xpm.gz - 複製開機映像擋到
tftp根目錄:cp /path/to/x86_64/os/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/rhel6/ - 重新開機,在提示符號出現時,選擇網路裝置作為開機裝置。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.