tftp – Use TFTP protocol to transfer files between local computer and tftp server

The TFTP (Trivial File Transfer Protocol) command is a simple file transfer protocol that uses UDP (User Datagram Protocol) to transfer files between a local computer and a remote TFTP server. It is commonly used to transfer firmware updates, configurations, and other small files between network devices. The TFTP protocol does not provide authentication or encryption, so it is not recommended for transferring sensitive data.

Overview

To use the TFTP command, the syntax is as follows:

tftp [options] [host]

Here, options are the command-line options, and host is the remote TFTP server’s IP address or hostname.

To upload a file to the TFTP server, use the -put option:

tftp -put [local_file] [remote_file]

Here, local_file is the file to upload from the local computer, and remote_file is the filename to use on the remote TFTP server.

To download a file from the TFTP server, use the -get option:

tftp -get [remote_file] [local_file]

Here, remote_file is the filename on the remote TFTP server, and local_file is the filename to use on the local computer.

Examples

To upload a file named firmware.bin to a TFTP server at IP address 192.168.1.100, use:

tftp -put firmware.bin 192.168.1.100

To download a file named config.txt from a TFTP server at hostname tftp.example.com, use:

tftp -get config.txt tftp.example.com

## Options
The following options are available for the TFTP command:

| Option | Description |
|--------|-------------|
| -c     | Use ASCII transfer mode instead of binary |
| -g     | Use `get` mode (same as `-get` option) |
| -p     | Use `put` mode (same as `-put` option) |
| -r     | Use `recv` mode (same as `-get` option) |
| -t     | Set the timeout value in seconds (default is 5) |
| -v     | Verbose output (print status messages during transfer) |

## Troubleshooting tips
- If you receive an error message such as "timeout occurred" or "transfer timed out," try increasing the timeout value using the `-t` option.
- If you are unable to connect to the TFTP server, ensure that the server is running and that you have the correct IP address or hostname.
- If you are unable to transfer files, ensure that the file permissions are set correctly and that the file is not currently in use by another process.

## Notes
- The TFTP command is included in most Linux distributions by default.
- The TFTP protocol is not secure and should not be used to transfer sensitive data.
- For more advanced file transfer capabilities, consider using SCP or SFTP instead.