You are not logged in.

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

alexanderzhirov
Member
Registered: 2022-05-12
Posts: 39
Website

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.

Offline

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

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

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] https://stackoverflow.com/questions/733 … 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)

Offline

Board footer

Powered by FluxBB