大网数据广告活动
服务器运维问答

Defining a new location for syslinux configuration files when setting up PXELinux

· 52CE 我爱测

I am working on a mock up of a PXE server for the place I work. I am trying to put the image files and configuration file in places that keep things a little more organized. Even though my dhcpd.conf specifies the configuration o…

问题原文

原帖链接 · AtomicPorkchop · CC BY-SA 3.0

I am working on a mock up of a PXE server for the place I work. I am trying to put the image files and configuration file in places that keep things a little more organized. Even though my dhcpd.confspecifies the configuration options needed to tell PXELinux where to look for config files it still does not find said files.

Here is what my /etc/dhcp/dhcpd.conf looks like, this is where I imagine the issue is.

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 arch                     code 93 = unsigned integer 16;

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;

ddns-update-style none;

option domain-name "lab.solignis.com";
option domain-name-servers ns01.lab.solignis.com;

default-lease-time 600;
max-lease-time 7200;

authoritative;
log-facility local7;

subnet 192.168.147.0 netmask 255.255.255.0 {
        range 192.168.147.100 192.168.147.254;
        option subnet-mask 255.255.255.0;
        option routers 192.168.147.2;
        option broadcast-address 192.168.147.255;
        default-lease-time 600;
        max-lease-time 7200;

        class "pxeclients" {

                match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
                next-server 192.168.147.10;

                if option arch = 00:00 {
                        option pxelinux.configfile "common.cfg";
                        option pxelinux.pathprefix "/configs/";
                        filename "/pxelinux/images/BIOS/pxelinux.0";
                } elsif option arch = 00:06 {
                        #option pathprefix "/configs/";
                        #option configfile "/EFIx64/default";
                        filename "/images/EFIx64/syslinux.efi";
                } elsif option arch = 00:07 {
                        #option pathprefix "/configs/";
                        #option configfile "/EFIx64/default";
                        filename "/images/EFIx64/syslinux.efi";
                } elsif option arch = 00:09 {
                        #option pathprefix "/configs/";
                        #option configfile "/EFIx64/default";
                        filename "/images/EFIia32/syslinux.efi";
                }
        }

}

Parts of the config were compiled from various parts of documentation, the parts that are commented out are old pieces that I have not fixed yet disregard those. For now I just want to get standard BIOS working (arch = 00:00).

Here is what my file structure looks like for my tftpboot directory.

server01@server01:/var/lib/tftpboot$ tree
.
└── pxelinux
    ├── configs
    │   └── common.cfg
    └── images
        ├── BIOS
        │   ├── ldlinux.c32
        │   └── pxelinux.0
        ├── EFIia32
        │   └── syslinux.efi
        └── EFIx64
            └── syslinux.efi

6 directories, 5 files

I was pretty sure I have it setup right for pxelinux but it does not see the config file so something is not configured right. Can anyone provide an idea of what I misconfigured? I have been banging my head on this all day.

已采纳解答

原帖链接 · Pat · CC BY-SA 3.0

Note that the configfile is relative to the pathprefix:

            if option arch = 00:00 {
                    option pxelinux.configfile "common.cfg";
                    option pxelinux.pathprefix "/pxelinux/configs/";
                    filename "/pxelinux/images/BIOS/pxelinux.0";

this will look for a config file called /pxelinux/configs/common.cfg on the TFTP server.

if this fails just get a Wireshark traffic capture and see the TFTP file requests and where they are pointing to.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。