gpt4 book ai didi

linux - dnsmasq - 每个 macaddress 的不同 tftp-root

转载 作者:太空狗 更新时间:2023-10-29 11:12:38 25 4
gpt4 key购买 nike

是否可以在 dnsmasq.conf 中处理不同的 tftp-roots?

类似于:如果 MAC=19-4B-90-DA-1C-C3然后 tftp-root=/tftpbootAB

IF MAC=19-4B-90-DE-1C-B6然后 tftp-root=/tftpbootCD

我在手册中找不到这个。

我只找到类似的东西:dhcp-match=set:bios,option:client-arch,0dhcp-boot=tag:efi-x86_64,"efi64/syslinux.efi"

但不适用于带有 tftp-root 的线路

最佳答案

我也在寻找这个,并在 man dnsmasq 中找到了解决方案。有一个选项:

--tftp-unique-root[=ip|mac]
Add the IP or hardware address of the TFTP client as a path component on the end of the TFTP-root. Only valid if a tftp-root is set and the directory exists. Defaults to adding IP address (in standard dotted-quad format). For instance, if tftp-root is "/tftp" and client 1.2.3.4 requests file "myfile" then the effective path will be "/tftp/1.2.3.4/myfile" if /tftp/1.2.3.4 exists or /tftp/myfile otherwise. When "=mac" is specified it will append the MAC address instead, using lowercase zero padded digits separated by dashes, e.g.: 01-02-03-04-aa-bb Note that resolving MAC addresses is only possible if the client is in the local network or obtained a DHCP lease from us.

/etc/dnsmasq.conf 中的代码片段如下所示(示例):

enable-tftp
tftp-root=/tftpboot
tftp-unique-root=mac
pxe-service=0,"Raspberry Pi Boot"

然后创建目录:

~$ sudo mkdir -p /tftpboot/19-4b-90-da-1c-c3
~$ sudo mkdir -p /tftpboot/19-4b-90-de-1c-b6

并将您想要的特定设备(mac 地址)的启动文件放入其子目录中。

关于linux - dnsmasq - 每个 macaddress 的不同 tftp-root,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40008276/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com