2

on my network its already exist a router that do dhcp, boot in this network i need to boot a diskless system that use pxe to boot from network, while the pxe server is using dnsmasq to serve O/S, but currently this dnsmasq act as dhcp server too, so there are multiple dhcp server on the same network

how to run pxe server without act as dhcp server by using dnsmasq ?

this is my command line to dnsmasq, somehow if i dont specify dhcp ip range, the client wont receive IP and wont boot

dnsmasq --enable-tftp --tftp-root=/var/state/dnsmasq/root \
--dhcp-boot=pxelinux.0,"$IP",$IP \
--dhcp-range=192.168.1.10,192.168.1.252,proxy,2552.255.255.0,192.168.1.255 --log-dhcp \
--dhcp-option=3,192.168.1.1
uray
  • 245
  • 4
  • 7
  • 2
    why use dnsmasq at all? just install and run a tftp server and you're done. Of course, you must enable pxe/bootp feature in dhcp part of your router, and set it to the tftp server. – Dani_l Jul 20 '14 at 12:13
  • the problem is that bootp server doesn't have exact IP, its an USB linux which get his IP from router's DHCP, if i plug it, it act as pxe server to boot another disk-less linux – uray Jul 20 '14 at 12:35
  • so running with dnsmasq without dhcp feature will help you how? you still must inform the pxe card of it's next server (tftp server address). I assume the usb disk can connect to different servers.. you should start a new question asking how can a usb linux always get a guaranteed same address (even though it's mac may change) from a dhcp server – Dani_l Jul 20 '14 at 13:00
  • 1
    otherwise, simply add a reservation in the dhcp, and direct pxe/bootp to the reserved ip. or add a static ip in the usb and don't call the dhcp at all. either way, dnsmasq will not help if you insist on another dhcp but no deterministic IP address – Dani_l Jul 20 '14 at 13:03
  • @Dani_l my USB linux, is act as pxe & tftp server too, so no need to tell another tftp server as itself is the server. what i need to solve is, how to make my dnsmasq only serving as proxy dhcp, so it ask the real dhcp server which IP is free, then dnsmasq give it to its client, but use dnsmasq bootp IP and get file from dnsmasq tftp server – uray Jul 20 '14 at 16:15
  • Simply put- dnsmasq is not designed and can't act as a dhcp relay/forwarder. certainly it can't both be a dhcp client and rebuild any dhcp answer with itself as 'next server'. You would have to modify it's code for that. – Dani_l Jul 21 '14 at 01:48

2 Answers2

2

Lets consider the already in place DHCP server and your PXE server reside on different PCs.

In this case the DHCP component of the PXE server must be configured as a proxyDHCP and there will be no conflicts with the main DHCP.

You can configure dnsmasq as proxyDHCP.

# This range(s) is for the public interface, where dnsmasq functions
# as a proxy DHCP server providing boot information but no IP leases.
# Any ip in the subnet will do, so you may just put your server NIC ip here.
dhcp-range=10.160.31.10,proxy
Pat
  • 3,519
  • 2
  • 17
  • 17
1

You need a BOOTP and TFTP server. You could set "next-server" to your current DHCP server setting to your TFTP server too. You won't be able to run remote boot without correct BOOTP server set to TFTP server (next-server).

First you need a BOOTP/DHCP server to setup the client network configuration and inform what server will be used for PXE/TFTP server. Then you need a PXE/TFTP server to host PXE files, it's two different services which dnsmasq handles.

denisvm
  • 222
  • 1
  • 4