AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
24.91k stars 1.79k forks source link

Add PXE Support to the DHCP Server #6575

Open kemelzaidan opened 9 months ago

kemelzaidan commented 9 months ago

Prerequisites

The problem

PXE boot is a very useful feature but requires an expensive managed switch.

Proposed solution

Adding PXE support to the DHCP server of Adguard Home would be a valuable feature. This way I would see an advantage to use the DHCP server in Adguard and not in my home router, that despite being an expensive model, supporting mesh and wifi6, does not have PXE support.

Alternatives considered and additional information

I believe that's a simple feature which would bring a lot of value to the user.

fernvenue commented 9 months ago

I think maybe you can do it by yourself manually, follow The dhcp.dhcpv4.options array field part.

kemelzaidan commented 9 months ago

That's nice @fernvenue, but I believe that's a good candidate for the GUI, isn't it? Going through the RFCs documentations pointed at the link you sent above, the only DHCP options I found were siaddr and file. I'd need to test to see if it works...

fernvenue commented 9 months ago

That's nice @fernvenue, but I believe that's a good candidate for the GUI, isn't it?

Yea, that's true, hope we can have more DHCP options on Web UI :)

systemmonkey42 commented 8 months ago

I would love to see this flexibility added, as it would allow me to migrate DHCP and DNS to the same place .

Supporting "PXE" is a can of worms. Options have different meanings for different host types, and different boot stages (I use iPXE for iSCSI boot, and the first state expects 'ipxe.efi' in the 'boot-file' option, while the second stage requires an iPXE configuration file in the 'boot-file' option.

I previously used bind9 for its flexibility, but needed to consolidate and my router only supports dnsmasq..

My environment consists of BIOS and UEFI booting via PXE: (physical and virtual machines)

Also raspberry PI's are boot loaded which requires different options..

Finally, VPN clients (using openvpn in bridged mode) get different DNS servers than regular clients.

As far as I can tell, support for condition options based on 'vendor class'. for example, is impossible with the existing ADGuard DHCP configuration options.

The dnsmasq configuration is a mess, but it looks somewhat like this:

dhcp-vendorclass=BIOS,PXEClient:Arch:00000
dhcp-vendorclass=UEFI32,PXEClient:Arch:00006
dhcp-vendorclass=UEFI,PXEClient:Arch:00007
dhcp-vendorclass=UEFI64,PXEClient:Arch:00009

# Default boot file
dhcp-boot=tag:ipxe,boot.cfg,,10.0.0.10
dhcp-boot=net:UEFI32, tag:!ipxe,i386-efi/ipxe.efi, ,10.0.0.10
dhcp-boot=net:UEFI,   tag:!ipxe,     ipxe.efi.0,   ,10.0.0.10
dhcp-boot=net:UEFI64, tag:!ipxe,     ipxe64.efi,   ,10.0.0.10

# Custom DNS includes adguard, router, google, but is disabled
# on OpenVPN clients.
dhcp-host=00:FF:*:*:*:*,set:openvpn
dhcp-option=openvpn,option:dns-server # No dns for vpn clients - they use local dns only
dhcp-option=!openvpn,option:dns-server,<adguard ip>

dhcp-option=tag:ipxe,encap:175,    1, 5b       # priority code
dhcp-option=tag:ipxe,encap:175,    176, 1b     # no-proxydhcp

# Tag when netbooting Raspberry PI-400
dhcp-host=e4:5f:01:f9:07:4a,set:pi400

# Raspberry PI-400 requires only the boot-server option.  Filename messes up boot
dhcp-boot=tag:pi400,,10.0.0.10

Edit: formatting

realmax44 commented 7 months ago

So, is there any news on this issue? Perhaps an easy-to-implement solution?

flashbackpa commented 6 months ago

Hi, to have pxe boot compatibility would be a giantic plus to the already wonderful adguard ! Please consider adding this support in the near future. Thank you.