LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-15-2022, 12:24 PM   #1
alexanderzhirov
LQ Newbie
 
Registered: May 2022
Distribution: Solus
Posts: 16

Rep: Reputation: 0
How to 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.
 
Old 08-15-2022, 04:01 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,017

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
Most of the time the IP addresses scroll on screen. If not then monitor with wireshark or go to server for it's config??
 
Old 08-15-2022, 04:59 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,747

Rep: Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982
Quote:
Originally Posted by alexanderzhirov View Post
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.
Not sure how C/C++ comes into play here...the system isn't booted to a point where it could run a program, if it's only doing a PXE/network boot. But I do know if you're using a Cisco device, you can set up a TFTP helper address on the router. Older article, but still valid I think:
https://community.cisco.com/t5/routi...r/td-p/1552749

Not sure that DHCP can do this by itself; IANA docs list DHCP option #66 as a TFTP server name field.
 
  


Reply

Tags
c++, clang, dhcp, tftp



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
in.tftp pxelinux.0_ fails with TFTP open timeout deadeyes Linux - Server 1 05-28-2010 10:07 AM
TFTP open timeout talking to dual interface DHCP Server stuart_cherrington Linux - Networking 6 01-08-2010 12:07 PM
after re-create tftp dir, tftp doesn't work anymore lastguy Linux - Networking 2 11-16-2007 03:33 PM
tftp issue, unable to transfer kernel image using tftp to boot ltsp-client noobs4linux Linux - Networking 1 02-07-2007 01:53 AM
TFTP-Problem: TFTP timed out Bikerpete Linux - General 2 08-14-2003 05:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration