无忧启动论坛

 找回密码
 注册
搜索

悬赏贴:如何通过dnsmasq实现bios和uefi双网启菜单

查看数: 5190 | 评论数: 10 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2021-10-21 04:30

正文摘要:

本帖最后由 tigerhuang 于 2021-10-21 10:26 编辑 赏金是不少于2年的免费科学上.网或我的800本论坛积分 我的ARM路由器上跑着FreshTomato系统(一种简化版的Linux系统),其内置的Dnsmasq版本号是2.85,Dnsmasq的 ...

回复

2011liuyun 发表于 2022-1-9 22:23:23
  1. # /etc/dnsmasq.conf

  2. # Disable DNS Server
  3. port=0

  4. # Enable DHCP logging
  5. log-dhcp

  6. # Respond to PXE requests for the specified network;
  7. # run as DHCP proxy
  8. bind-interfaces
  9. interface=eth0
  10. dhcp-range=172.16.6.221,172.16.6.240,24h
  11. dhcp-option=3,172.16.6.254
  12. dhcp-option=6,172.16.1.11,172.16.1.12

  13. dhcp-match=set:x86-32,option:client-arch,0
  14. dhcp-boot=tag:x86-32,Boot/pcbios/ipxe.bios

  15. dhcp-match=set:IA64,option:client-arch,2
  16. dhcp-boot=tag:IA64,efi/ipxe-i386.efi

  17. dhcp-match=set:efi-x86_32,option:client-arch,6
  18. dhcp-boot=tag:efi-x86_32,efi/ipxe-i386.efi

  19. dhcp-match=set:efi-x86_64,option:client-arch,7
  20. dhcp-boot=tag:efi-x86_64,Boot/efi/ipxe.efi

  21. dhcp-match=set:efi-x86_649,option:client-arch,9
  22. dhcp-boot=tag:efi-x86_649,Boot/efi/ipxe.efi

  23. dhcp-match=set:ipxe,175
  24. dhcp-boot=tag:ipxe,Boot/init.txt

  25. enable-tftp
  26. tftp-root=/mnt/data/www
复制代码


我的配置文件 dhcp模式
2011liuyun 发表于 2022-1-9 22:18:59
本帖最后由 2011liuyun 于 2022-1-9 22:22 编辑
  1. # Known working dnsmasq version 2.85 config for iPXE proxydhcp usage
  2. # Debug logging
  3. # log-debug

  4. # Enable DHCP logging
  5. log-dhcp

  6. # Disable DNS server
  7. port=0

  8. # send disable multicast and broadcast discovery, and to download the boot file immediately
  9. # DHCP_PXE_DISCOVERY_CONTROL, should be vendor option? Needs more understanding and source
  10. dhcp-option=vendor:PXEClient,6,2b

  11. # This range(s) is for the public interface, where dnsmasq functions
  12. # as a proxy DHCP server providing boot information but no IP leases.
  13. # Any ip in the subnet will do, so you may just put your server NIC ip here.
  14. dhcp-range=172.16.6.211,proxy

  15. interface=eth0
  16. # bind-dynamic - remove interface and use this instead to listen everywhere?
  17. # Disable re-use of the DHCP servername and filename fields as extra
  18. # option space. That's to avoid confusing some old or broken DHCP clients.
  19. dhcp-no-override

  20. #dhcp-match=set:<tag>,<option number>|option:<option name>|vi-encap:<enterprise>[,<value>]
  21. #dhcp-boot=[tag:<tag>,]<filename>,[<servername>[,<server address>|<tftp_servername>]]

  22. # Based on logic in https://gist.github.com/robinsmidsrod/4008017
  23. # iPXE sends a 175 option, checking suboptions
  24. dhcp-match=set:ipxe-http,175,19
  25. dhcp-match=set:ipxe-https,175,20
  26. dhcp-match=set:ipxe-menu,175,39
  27. # pcbios specific
  28. dhcp-match=set:ipxe-pxe,175,33
  29. dhcp-match=set:ipxe-bzimage,175,24
  30. dhcp-match=set:ipxe-iscsi,175,17
  31. # efi specific
  32. dhcp-match=set:ipxe-efi,175,36
  33. # combination
  34. # set ipxe-ok tag if we have correct combination
  35. # http && menu && iscsi ((pxe && bzimage) || efi)
  36. tag-if=set:ipxe-ok,tag:ipxe-http,tag:ipxe-menu,tag:ipxe-iscsi,tag:ipxe-pxe,tag:ipxe-bzimage
  37. tag-if=set:ipxe-ok,tag:ipxe-http,tag:ipxe-menu,tag:ipxe-iscsi,tag:ipxe-efi

  38. #pxe-service=[tag:<tag>,]<CSA>,<menu text>[,<basename>|<bootservicetype>][,<server address>|<server_name>]
  39. #pxe-prompt=[tag:<tag>,]<prompt>[,<timeout>]
  40. # these create option 43 cruft, which is required in proxy mode
  41. # TFTP IP is required on all dhcp-boot lines (unless dnsmasq itself acts as tftp server?)
  42. pxe-service=tag:!ipxe-ok,X86PC,PXE,Boot/pcbios/ipxe.bios,172.16.6.211
  43. pxe-service=tag:!ipxe-ok,IA32_EFI,PXE,Boot/efi/snponlyx32.efi,172.16.6.211
  44. pxe-service=tag:!ipxe-ok,BC_EFI,PXE,Boot/efi/ipxe.efi,172.16.6.211
  45. pxe-service=tag:!ipxe-ok,X86-64_EFI,PXE,Boot/efi/ipxe.efi,172.16.6.211

  46. # later match overrides previous, keep ipxe script last
  47. # server address must be non zero, but can be anything as long as iPXE script is not fetched over TFTP
  48. # dhcp-boot=tag:ipxe-ok,http://boot.ipxe.org/demo/boot.php,,0.0.0.1
  49. dhcp-boot=tag:ipxe-ok,Boot/init.txt,,172.16.6.211

  50. # To use internal TFTP server enabled these, recommended is otherwise atftp
  51. enable-tftp
复制代码

我的配置文件 proxydhcp模式
tigerhuang 发表于 2022-1-9 08:48:17
未完成的歌 发表于 2022-1-8 12:38
我以前的帖子里面有

以前的看过了,没找到.
未完成的歌 发表于 2022-1-8 12:38:05
我以前的帖子里面有

点评

以前的看过了,没找到.  详情 回复 发表于 2022-1-9 08:48
shys 发表于 2021-10-23 11:09:36
哈哈 99年
mrzhonghb 发表于 2021-10-21 18:50:44
顶一下
2010hook 发表于 2021-10-21 18:39:29
要求增加到99年啊
2011slkj 发表于 2021-10-21 09:17:06
顶个人气
fenly 发表于 2021-10-21 08:59:57
等待赏金猎人
lily9718 发表于 2021-10-21 06:10:15
帮顶

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-12 05:40

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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