You are not logged in.

#1 2022-08-15 16:33:52

Registered: 2022-05-12
Posts: 39

Get the TFTP server address from the DHCP configuration

I need to find out the address of the TFTP server that is specified in the DHCP configuration.

When the PC is started on, the computer receives the IP address via DHCP, then downloads the image from the PXE server. During the download of the distribution, I need to run a utility that accesses the Database to the server from which this image was downloaded (where the TFTP server is running).

In theory, it would be possible to register the necessary address of the TFTP server in the downloadable image of the distribution. But the bottom line is that such a scheme exists in various subnets. And specifying its TFTP server for each subnet is an irrational approach. It would be more convenient to get the address of the TFTP server from the DHCP server, which is listed there as next-server.

I found something similar at Busybox.

Is it possible to implement something like this in C/C++ and how can it be done? I don't have any ideas.


#2 2022-08-16 12:59:15

From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Get the TFTP server address from the DHCP configuration

If you post a question here and on stackoverflow[1] it would be nice if you mentioned it.
Doing that can help to avoid duplicate answers.

[1] … figuration

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)


Board footer

Powered by FluxBB