At this point,
we will set up our basic TFTP server and perform a
file download to see for ourselves.
I won't detail the entire TFTP setup,
but will say that you need a pair of packages.
TFTPD is the TFTP server daemon and xinetd is a wrapper
application that governs the TFTP service.
With both packages installed,
I've created a TFTP file in the xinetd service directory.
In case you missed it, the file path is shown in the bottom left corner.
In the service tftp block, I've included a basic TFTP server configuration.
Of note, the server option identifies the TFTP binary,
which runs the TFTP server behind the scenes.
The server_args option identifies the command line
arguments passed into the TFTPD binary,
which includes the top-level FTP directory.
To learn about the other minor options,
please reference the package documentation on xinetd and TFTPD.
For good measure, I'll restart the xinetd service,
which uses a specific xinetd binary, followed by the restart keyword.
With that complete, let's move to the client.
Our handy lftp client does not support TFTP
operations at the time of this recording,
but there is a tftp-hpa packages that does.
The built-in TFTP application is rather weak, and I suggest installing tftp-hpa.
I'm showing the version number on the screen.
You cannot pass in a file as with LFTP,
but we can write a simple shell script to automate the conversation.
Just be sure the script has the proper execute permissions.
Let's examine the script.
The script is only one line long.
It uses the TFTP command, followed by the host name of the TFTP server.
The -v option enables verbose mode, which provides some extra debugging detail,
but nowhere near as much as LFTP.
The -c option specifies the commands to run from the TFTP prompt,
but since we don't want this to be interactive,
we specify the get operation to download R1.cfg.
We can execute the script in standard Bash fashion
by using the dot slash prefix, as this folder is not in my shell path.
The output is quite terse.
The first line indicates a successful control session
being established on UDP port 69.
The second line shows a download of R1.cfg from that server.
The last line is a rollup of how much data was transferred and how long it took.
In order to see all the ephemeral ports,
we will need to check out the packet capture.
Let's quickly ensure the file was downloaded successfully before continuing.
This looks right to me, and I hope you see the value in having such a simple utility available.