AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1134506
Accepted
phydeauxman
phydeauxman
Asked: 2023-06-22 05:45:22 +0800 CST2023-06-22 05:45:22 +0800 CST 2023-06-22 05:45:22 +0800 CST

Red Hat 7.9 中如何设置变量“pxe_default_server”?

  • 772

我们有一台 RHEL 7.9 服务器,充当为多个子网提供服务的 DHCP/TFTP (PXE) 服务器。以下是 dhcpd.conf 文件的副本(DHCP/PXE 服务器是 XY145.98):

allow bootp;
allow booting;
max-lease-time 1200;
default-lease-time 900;

subnet X.Y.145.96 netmask 255.255.255.224 {
  option routers X.Y.145.126;
  range X.Y.145.100 X.Y.145.105;
  next-server X.Y.145.98;
  filename "pxelinux.0"
}

subnet X.Y.145.144 netmask 255.255.255.248 {
  option routers X.Y.145.145;
  range X.Y.145.146 X.Y.145.150;
  next-server X.Y.145.98;
  filename "pxelinux.0"
}

我们看到的问题是 grub.cfg 正在抓取options router变量的参数IP pxe_default_server,而不是next-server参数。然后使用此 ( pxe_default_server) 定义变量net_default_server参数,我们的 PXE 失败,因为它指向网关 IP 而不是 DHCP/PXE 服务器 IP。如果我们编辑 grub.cfg 文件以将参数硬编码pxe_default_server为等于 DHCP/PXE 服务器的 IP...我们可以正常启动并下载映像。我应该使用不同的参数吗?

redhat
  • 2 2 个回答
  • 63 Views

2 个回答

  • Voted
  1. Best Answer
    Pat
    2023-06-30T05:37:30+08:002023-06-30T05:37:30+08:00

    Grub 肯定会感到困惑,但你的 dhcpd.confg 有问题。

    1. 您有 2 个子网,但您在两个子网中提供相同的“下一个服务器”IP,这意味着对于一个子网,TFTP 服务器可能不可见,具体取决于您的布局。
    2. 您没有定义每个子网的“广播地址”
    3. 您甚至向非 PXE 启动客户端提供 PXE 数据。

    请参阅此处的示例: https ://www.redhat.com/sysadmin/pxe-boot-uefi

    # DHCP Server Configuration File
    #
    #. see /usr/share/doc/dhcp*/dhcpd.conf.example
    #
    #. see dhcpd.conf(5) man page
    
    
    option rfc3442-classless-static-routes code 121 = array of integer 8;
    option ms-classless-static-routes code 249 = array of integer 8;
    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;
    option architecture-type code 93 = unsigned integer 16;
    subnet 192.168.1.0 netmask 255.255.255.0 {
       option routers 192.168.1.0;
       option subnet-mask 255.255.255.0;
       option broadcast-address 192.168.1.255;
    }
    
    subnet 192.168.2.0 netmask 255.255.255.0 {
       option routers 192.168.2.1;
       option subnet-mask 255.255.255.0;
       option broadcast-address 192.168.2.255;
       range 192.168.2.2 192.168.2.254;
    
       class "pxeclients" {
         match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
         next-server 192.168.1.10;
         if option architecture-type = 00:07 {
            filename "shim.efi";
            } else {
            filename "pxelinux/pxelinux.0";
         }
       }
    }
    
    subnet 192.168.3.0 netmask 255.255.255.0 {
       option routers 192.168.3.1;
       option subnet-mask 255.255.255.0;
       option broadcast-address 192.168.3.255;
       range 192.168.3.2 192.168.3.254;
    
       class "pxeclients" {
         match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
         next-server 192.168.1.10;
         if option architecture-type = 00:07 {
            filename "shim.efi";
            } else {
            filename "pxelinux/pxelinux.0";
         }
       }
    }
    
    • 0
  2. VSYS Host
    2023-07-06T16:56:33+08:002023-07-06T16:56:33+08:00
    allow bootp;
    allow booting;
    max-lease-time 1200;
    default-lease-time 900;
    
    subnet X.Y.145.96 netmask 255.255.255.224 {
      option routers X.Y.145.126;
      option pxe-server-name X.Y.145.98;
      range X.Y.145.100 X.Y.145.105;
      next-server X.Y.145.98;
      filename "pxelinux.0";
    }
    
    subnet X.Y.145.144 netmask 255.255.255.248 {
      option routers X.Y.145.145;
      option pxe-server-name X.Y.145.98;
      range X.Y.145.146 X.Y.145.150;
      next-server X.Y.145.98;
      filename "pxelinux.0";
    }
    
    • 0

相关问题

  • 如何设置 Redhat 对 ActiveDirectory 的用户进行身份验证

  • 如何从 RHEL 5 迁移到 CentOS 5?

  • 我应该将 Rails 应用程序部署到哪个目录?

  • 如何移动 MySQL 的数据目录?

  • RHEL 5.3 上可用的 yum 存储库

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve