Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a TFTP server

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to build a TFTP server, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

TFTP server building

Install servers, clients, and daemons

# sudo apt-get install tftp-hpa tftpd-hpa xinetd

Server configuration

First, create a tftpboot in the root directory and change the property to any user readability:

# cd /

# sudo mkdir tftpboot

# sudo chmod 777 tftpboot

Then, go to the directory / etc/xinetd.d/, and create a new file tftp in it, adding the specified contents to the tftp file:

# cd / etc/xinetd.d/

# sudo vi tftp

Add the following to the tftp file

Service tftp

{

Disable = no 138

Socket_type = dgram

Protocol = udp

Wait = yes

User = root

Server = / usr/sbin/in.tftpd

Server_args =-s / tftpboot-c

Per_source = 11

Cps = 100 2

}

Finally, modify the configuration file / etc/default/tftpd-hpa to

TFTP_USERNAME= "tftp"

TFTP_DIRECTORY= "/ tftpboot"

TFTP_ADDRESS= "0.0.0.0Vol 69"

TFTP_OPTIONS= "--secure-l-c-s"

Note: change "TFTP_DIRECTORY" to the path where the new tftpboot directory is located.

Restart the service,

# sudo / etc/init.d/xinetd reload

# sudo / etc/init.d/xinetd restart

# sudo / etc/init.d/tftpd-hpa restart

Test server

Test it and create a new file under the / tftpboot folder

# touch abc

Go to another folder

# tftp 192.168.2.51 (192.168.2.51 is native IP)

# tftp > get abc

If you can download the server, you can use tftp to download the file after connecting the development board with PC through the network cable.

The tftp command is used as follows

Tftp your-ip-address

Enter the TFTP operation:

Connect: connecting to a remote tftp server

Mode: file transfer mode

Put: uploading files

Get: downloading files

Quit: exit

Verbose: displays detailed processing information

Tarce: displays the package path

Status: displays current status information

Binary: binary transfer mode

Ascii:ascii transfer mode

Rexmt: sets the timeout for packet transmission

Timeout: sets the timeout for retransmission

Help: help information

?: help information

Uboot uses tftp

(1)。 Connect the network port of the host and the development board with a network cable, and copy the compiled kernel image uImage and device tree files to the tftpboot directory.

(2)。 Enter the uboot phase, modify the environment variables and save:

Setenv ethaddr e6:97:d9:0c:f7:7a sets MAC

Setenv serverip 192.168.2.51 sets the IP of the tftp server

Setenv ipaddr 192.168.2.85 sets the local IP

Setenv image imx6qdl/zImage sets the kernel image to be downloaded locally on the tftp server

Setenv fdt_file imx6qdl/imx6q-s3-sabresd.dtb sets the device tree downloaded to the local on the tftp server

Setenv nfs_rootfs/ nfs_rootfs/imx6qdl-rootfs sets the NFS file system location

Saveenv

(3)。 Select Network Startup from the uboot menu

Restart the development board, and after u-boot starts, quickly press any key to enter the uboot menu.

-- Main Menu

0-- exit to uboot shell

1-- select boot mode

Enter serial number 1 to enter the startup type selection option

-- BOOT MODE Menu

0-- exit to upper menu

1-- boot from net

2-- boot from emmc

On how to build a TFTP server to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report