IPv6 UEFI PXE boot

Loading

哪些網卡支援 PXE IPV6 Boot 呢!! 根據 Intel 官方網站 http://www.intel.com/support/network/sb/cs-028553.htm 說明了! “UEFI Drivers Compatible with IPv6” 也就是說要支援 IPv6 PXE Boot 的網卡,環境必須在 UEFI 下.傳統的 Intel® Boot Agent for Legacy BIOS 就不在其支援列表中了.


UEFI Drivers Compatible with IPv6

Intel® Ethernet UEFI drivers are compatible with IPv6 and remote boot solutions using UEFI such as iSCSI and PXE. Use the latest UEFI driver to ensure IPv6 compatibility.
Intel® Boot Agent for legacy BIOS

Systems with legacy BIOS can continue to use Intel® Boot Agent. Intel Boot Agent is compliant to PXE standard version 2.1, which is defined as part of the IPv4 protocol suite. The IPv4 and IPv6 protocol suites can coexist within the same network infrastructure; therefore, the Intel® Boot Agent PXE solution can be used in an IPv6 environment. Intel has no plans to updateIntel® Boot Agent for IPv6.

Intel Boot Agent features are now part of the Intel® Ethernet Connections Boot Utility.

什麼是 uEFI!! 什麼是 PXE!! 可以參考下列聯結~

  • uEFI
    Extensible Firmware Interface (EFI) 的功能就類似傳統 BIOS ,他是 OS 與硬體之間溝通介面. 不過相較於傳統的 BIOS EFI 他的架構更模組化,功能更強大.EFI 的架構是由 Intel 提出的, 目前是交由 Unified EFI Forum 來管理.也就是我們現在所稱的 Unified Extensible Firmware Interface (UEFI)
  • PXE
    PXE (Preboot eXecution Environment) 是透過網路來安裝作業系統,在網卡上有一塊 ROM(firmware) 裡面存放了一些基本的網路協定如:Internet Protocol (IP), User Datagram Protocol (UDP), Dynamic Host Configuration Protocol (DHCP) 以及 Trivial File Transfer Protocol (TFTP) 透過這一些協定使得 PXE 可以進行網路的存取進一步安裝作業系統.

IPv6 PXE Server 設定步驟 (實驗環境為 RHEL6)

  1. 設定固定 IPV6 位址
  2. 設定 DHCP6 , IPV6 Table (Firewall)
  3. 設定 RADVD , IPv6 Forwarding
  4. 設定 TFTP
  5. grub.efi 檔案

Q : 那 IPv6 PXE 開機時到底是用哪一種方式獲取 IPv6 位址??
A: 目前實驗的結果是 DHCPv6 與 RADVD 都需要開啟.

  1. PXE 設定固定 IPV6 位址
    我們不能使用 IPV6 的 link-local address 所以要手動設定固定 ipv6 address (3ffe:501:ffff:100::1) ,我們可以透過修改 /etc/sysconfig/network-scripts/ifcfg-* (RHEL) 或是直接用 #NetworkManager ( https://benjr.tw/10728 ) 工具來設定.

    [root@benjr ~]# ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:F6:4D:73  
              inet addr:192.8.1.1  Bcast:192.8.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:fef6:4d73/64 Scope:Link
              inet6 addr: 3ffe:501:ffff:100::1/64 Scope:Global
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1226688 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1392610 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:102208468 (97.4 MiB)  TX bytes:7696863052 (7.1 GiB)
    
  2. 設定 DHCP6 , IPV6 Table (Firewall)
    DHCPv6 設定如下, DHCPv6 設定說明請參考 https://benjr.tw/10651

    [root@benjr ~]# cat /etc/dhcp/dhcpd6.conf
    #
    # DHCPv6 Server Configuration file.
    #   see /usr/share/doc/dhcp*/dhcpd6.conf.example
    #   see dhcpd.conf(5) man page
    #
    
      default-lease-time 2592000;
      preferred-lifetime 604800;
      option dhcp-renewal-time 3600;
      option dhcp-rebinding-time 7200;
      option dhcp6.bootfile-url code 59 = string;
      option dhcp6.name-servers 3ffe:501:ffff:100::1;
      option dhcp6.info-refresh-time 21600;
      dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases";
    
      subnet6 3ffe:501:ffff:100::/64 {
    	  range6 3ffe:501:ffff:100::10 3ffe:501:ffff:100::100;
    	  range6 3ffe:501:ffff:100:: temporary;
    	  prefix6 3ffe:501:ffff:100:: 3ffe:501:ffff:111:: /64;
    	  
    	  option dhcp6.bootfile-url "tftp://[3ffe:501:ffff:100::1]/grub.efi";
    	 }
    
    [root@benjr ~]# chkconfig dhcpd6 on
    [root@benjr ~]# service dhcpd6 start
    

    ip6tabels (firewall) 預設會擋到 port 546 與 547 (客戶端主要使用 UDP port 546 而服務器端使用 UDP port 547) 所以需要關閉 (或是開放這兩個埠來使用)

    [root@benjr ~]# chkconfig ip6tables off
    [root@benjr ~]# service ip6tables stop
    
  3. 設定 RADVD , IPv6 Forwarding
    RADVD 設定如下, RADVD 設定說明請參考 https://benjr.tw/94906

    [root@benjr ~]# cat /etc/radvd.conf
    # NOTE: there is no such thing as a working "by-default" configuration file. 
    #       At least the prefix needs to be specified.  Please consult the radvd.conf(5)
    #       man page and/or /usr/share/doc/radvd-*/radvd.conf.example for help.
    #
    #
    interface eth0
    {
    	AdvSendAdvert on;
    	MinRtrAdvInterval 30;
    	MaxRtrAdvInterval 100;
    	prefix 3ffe:501:ffff:100::/64
    	{
    		AdvOnLink on;
    		AdvAutonomous on;
    		AdvRouterAddr off;
    	};
    };
    
    [root@benjr ~]# chkconfig radvd on
    [root@benjr ~]# service radvd start
    

    啟動 radvd 需要把 ipv6 fordward 打開. ipv6 fordward 跟 ipv4 的設定檔一樣儲存在 /etc/sysctl.conf

    [root@benjr ~]# vi /etc/sysctl.conf
    # Uncomment the next line to enable packet forwarding for IPv6
    #  Enabling this option disables Stateless Address Autoconfiguration
    #  based on Router Advertisements for this host
    net.ipv6.conf.all.forwarding=1
        
    [root@benjr ~]# sysctl -p
    net.ipv4.ip_forward = 1
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.default.accept_source_route = 0
    kernel.sysrq = 0
    kernel.core_uses_pid = 1
    net.ipv4.tcp_syncookies = 1
    error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
    error: "net.bridge.bridge-nf-call-iptables" is an unknown key
    error: "net.bridge.bridge-nf-call-arptables" is an unknown key
    net.ipv6.conf.all.forwarding = 1
    kernel.msgmnb = 65536
    kernel.msgmax = 65536
    kernel.shmmax = 68719476736
    kernel.shmall = 4294967296
    
  4. 設定 TFTP
    [root@benjr ~]# cat /etc/xinetd.d/tftp 
    # default: off
    # description: The tftp server serves files using the trivial file transfer \
    #	protocol.  The tftp protocol is often used to boot diskless \
    #	workstations, download configuration files to network-aware printers, \
    #	and to start the installation process for some operating systems.
    service tftp
    {
    	disable          = no
    	socket_type      = dgram
    	protocol         = udp
    	wait             = yes
    	user             = root
    	server           = /usr/sbin/in.tftpd
    	server_args      = -s /var/lib/tftpboot
    	per_source       = 11
    	cps              = 100 2
    	flags            = IPv6
    }
    [root@benjr ~]# service xinetd restart
    

    tftp 設定要修改成 flags = IPv6 (會同時支援 Ipv4 與 IPv6),如果你遇到 PXE 顯示 tftp 錯誤時,可以參考 tftp 常見的錯誤訊息 https://benjr.tw/94695

  5. UEFI – grub.efi 檔案
    關於 uEFI PXE Boot 有一個很大的關鍵是使用對的 開機 檔案.之前有使用過 IPv4 UEFI 的開機檔為 BOOTX64.efi 請參考 https://benjr.tw/16115,但 IPV6 UEFI 需要使用 grub.efi (位於 RedHat / CentOS ISO – /boot/efi/EFI/redhat/ 目錄).

    [root@benjr ~]# cp /boot/efi/EFI/redhat/grub.efi /var/lib/tftpboot/grub.efi
    

    若 Client 可以得到 IPV6 Address 但 PXE 開機還是失敗,大概都是這個檔案造成的,需要上官方網站看是否有更新檔.grub.efi 這個檔案是由 grub-0.97-77.el6.x86_64 套件提供.解開時需要使用 rpm2cpio 與 cpio .

    [root@benjr ~]# find / -name grub.efi
    /boot/efi/EFI/redhat/grub.efi
    [root@benjr ~]# rpm -qf /boot/efi/EFI/redhat/grub.efi
    grub-0.97-77.el6.x86_64
    [root@benjr ~]# rpm2cpio grub-0.97-77.el6.x86_64 | cpio -div
    

    grub.efi 還要搭配 efidefault 設定檔一起使用

    [root@benjr ~]# vi /var/lib/tftpboot/efidefault
    #debug --graphics
    default=0
    timeout 5000
    #hiddenmenu
    title RHEL6.8-64
    root (nd)
    	kernel /rhel6.8/vmlinuz  
    	initrd /rhel6.8/initrd.img
    
    title RHEL6.5-64
    root (nd)
    	kernel /rhel6/vmlinuz  
    	initrd /rhel6/initrd.img
    

    將開機所需的 kernel 和 initrd 檔案複製到 “/tftpboot/linux-install/rhel6 目錄下

    上面的設定是 Redhat 環境,如果要設定 Ubuntu 的環境可以參考這一篇 http://blog.widodh.nl/2015/11/pxe-boot-over-ipv6-with-ipxe/

    至於 EFI + Legacy PXE Boot 在 IPv6 的環境是不是可以整合在一起,我不確定,可以試試看,之前試過 EFI + Legacy PXE Boot 在 IPv4 , IPv6 的環境 https://benjr.tw/16194

沒有解決問題,試試搜尋本站其他內容

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料