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

标签 linux debian dnsmasq

是否可以在 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,0 dhcp-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/

相关文章:

linux - Debian Wheezy 7.5-用户 session 中未加载变量LD_LIBRARY_PATH

nginx - 将 DNS 条目映射到特定端口

linux - linux启动画面添加GUI控制

Linux:复制周日创建的文件

debian - 我应该在 debian 上的 openoffice 中使用什么虚拟 X 服务器?

linux - 在脚本中使用 fish shell 函数

dnsmasq 标签和条件 dns 服务器

dns - 更新到优胜美地后,本地域在断开网络后停止工作

linux - Indy 10.6 在具有管理员权限的 Linux 系统上使用 tcpserver 在客户端断开连接时抛出 Gtk-WARNING

java - 如何在 Intellij IDEA 中将弹出窗口保持在一个屏幕上?