iKuai爱快流控路由

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 215|回复: 3
打印 上一主题 下一主题

[网络设置] DHCP的功能加强一点点

[复制链接]
跳转到指定楼层
楼主
发表于 2023-11-14 20:44:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
需求建议
目前版本: 3.7.7 x64 Build202311080959
使用环境: 企业事业单位 
需求程度: 我好紧急的
联系方式(仅官方人员可见): 您无权查看此信息
类似功能截图: -
本帖最后由 xiaohhl 于 2023-11-14 20:53 编辑

最近才了解到DHCP参数如此之多。官方人员也改善到很强大的程度了。现在发现还是有点需求未满足。这些功能主板都带,那说明需求是挺有用的

最好是能像OPENVPN一样,有个附加配置功能,这样可以避免经常修改或增加功能。具体需求(根据请求DHCP的附带参数而提供相应的dhcp-bootoption67】,说明如下
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
沙发
 楼主| 发表于 2023-11-14 20:46:43 | 只看该作者
https://wiki.archlinux.org/title/Dnsmasq
To simply send one file:

dhcp-boot=lpxelinux.0
To send a file depending on client architecture:

pxe-service=x86PC,"PXELINUX (BIOS)",bios/lpxelinux
pxe-service=X86-64_EFI,"PXELINUX (EFI)",efi64/syslinux.efi

In case pxe-service does not work to identify the architecture (especially for UEFI-based clients), combination of dhcp-match and dhcp-boot can be used. See RFC 4578 2.1 for more client-arch numbers for use with dhcp boot protocol.

dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:efi-x86,option:client-arch,6
dhcp-match=set:bios,option:client-arch,0
dhcp-boot=tag:efi-x86_64,efi64/syslinux.efi
dhcp-boot=tag:efi-x86,efi32/syslinux.efi
dhcp-boot=tag:bios,bios/lpxelinux.0
板凳
 楼主| 发表于 2023-11-14 20:47:57 | 只看该作者
(抄过来的)
https://www.jianshu.com/p/f9070d76892a
ipxe启动原理:
网卡在进行pxe启动时会进行第一次dhcp请求,并附带client-arch选项。如果系统使用普通bios模式启动,那么client-arch就是0;如果是x86 uefi启动,就是7或者9;如果是arm64 uefi启动,就是11。
dnsmasq会给为请求打上tag,例如dhcp-match=set:x64-uefi,option:client-arch,7,如果发现请求有这个tag,就推送对应的启动文件,例如dhcp-boot=tag:aarch64-uefi,ipxe-x86_64.efi。此时,主机就会使用tftp协议去下载ipxe,并且执行。
当ipxe开始运行后,ipxe会再次进行dhcp请求,并且带上参数175。dnsmasq收到这个请求后,会推送boot.ipxe,就是下面这两行:
dhcp-match=set:ipxe,175  dhcp-boot=tag:ipxe,boot.ipxe
而boot.ipxe就是ipxe的主配置文件。boot.ipxe里面还会引用其他配置文件,ipxe也将一一加载。
至此,ipxe已经成功加载并且获取到了配置文件。


地板
 楼主| 发表于 2023-11-14 21:00:17 | 只看该作者
openwrt 只要在/etc/dnsmasq.conf下添加

dhcp-match=set:bios,option:client-arch,0
dhcp-match=set:x64-uefi,option:client-arch,7
dhcp-match=set:x64-uefi,option:client-arch,9
dhcp-match=set:aarch64-uefi,option:client-arch,11
dhcp-match=set:ipxe,175

dhcp-boot=tag:x64-uefi,ipxe-x86_64.efi
dhcp-boot=tag:bios,ipxegrldr
dhcp-boot=tag:aarch64-uefi,ipxe-x86_64.efi
dhcp-boot=tag:ipxe,ipxe-boot.ipxe

即可达到需求
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /2 下一条

QQ|小黑屋|手机版|Archiver|论坛规章制度|iKuai Inc. ( 京ICP备13042604号 )

GMT+8, 2024-6-11 06:19

Powered by Discuz! X3.3

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表