How to use tftp commands on the configuration tftp server and Development Board in ubuntu10.04

Source: Internet
Author: User
In ubuntu10.04, configure the tftp server and the tftp command on the development board. in ubuntu10.04, configure the tftp server: Step 4: install the software required by tftp. Install tftp-hpa and tftpd-hpa. The former is the client, and the latter is the Service Program. enter sud under the terminal... configuration of tftp server in ubuntu 10.04 and use of tftp commands on the development board tftp server in ubuntu 10.04: Step 4: install the software required for tftp. First, install tftp-hpa and tftpd-hpa. The former is the client and the latter is the Service Program. enter sudo apt-get install tftp-hpa tftpd-hpa on the terminal, install tftp-hpa and tftpd-hpa. Then you need to install xinetd, enter sudo apt-get install xinetd in the terminal, and install xinetd. Step 2: Configure related service files. Go to The etc folder (cd/etc/) in the root directory and check whether there is an xinetd in the directory. conf file. if not, create a new one. If yes, check the content to see if it is consistent with the following. if not, modify the content as follows: # Simple configuration file for xinetd # Some ULTS ults, and include/etc/xinetd. d/defaults {# Please note that you need a log_type line to be able to use log_on_success ont-size: 12pt; "># log_type = SYSLOG daemon info} includedir/etc/xinetd. step d: configure the tftp server command: sudo vim/etc/default/tftpd-hpa to change the content to #/et C/default/tftpd-hpa TFTP_USERNAME = "tftp" TFTP_DIRECTORY = "/tftpboot" # This is the working directory of your tftp server. modify it by yourself. Note that when creating a working directory, it is recommended to modify the permission to 777. run the sudo chmod 777/tftpboot TFTP_ADDRESS = "0.0.0.0: 69" TFTP_OPTIONS = "-l-c-s" step 4th: enter xinetd. d folder (cd xinetd. d) check whether there is a tftp file. if not, create a new file. If yes, check whether the content is consistent with the following. if not, modify the content as follows: service tftp {socket_type = dgram wait = yes disable = no user = root protocol = udp server =/usr/sbin/in. tftpd server _ Args =-s/tftpboot # log_on_success + = pid host duration # log_on_failure + = HOST per_source = 11 cps = 100 2 flags = IPv4} the server_args line is used to configure the storage location of server files, that is, when tftp transmission is performed, all files are searched from this folder Step 1: modify the permissions of the required folder. The folder to be modified is the folder that stores the server file mentioned in the previous step. take my configuration file as an example to create a folder (sudo mkdir/tftpboot ), then, you can set it to sudo chmod 777/tftpboot with the loose access permissions, or set it to the appropriate permissions. Step 2: restart the service. Sudo service tftpd-hpa restart, which is also a step I often neglect. After configuring the tftp configuration file, you need to restart xinetd and enter sudo/etc/init in the terminal. d/xinetd reload, reload the process, and enter sudo/etc/init. d/xinetd restart and restart the service. Remember, you need to restart the service every time you modify the configuration file. Execution order: sudo service tftpd-hpa restartsudo/etc/init. d/xinetd reloadsudo/etc/init. d/xinetd restart conclusion: you can build a tftp server through the above four steps. you can perform a test locally first. Take my configuration file as an example. First, create a file in/tftpboot, and enter the content as needed. Then, enter a directory that is not/tftpboot (the reason is to avoid confusion, because the file to be retrieved is stored in the current directory by default), and then enter sudo tftp localhost in the terminal, enter the tftp command line (you can enter help to view the functions of the command and command) and enter get file. If no prompt is displayed, the transfer is successful, enter q to exit the tftp command, and a file is displayed in the current directory. the content of the file is consistent with that of the new file. You can also input put xx in the tftp command to upload the xx file to the server folder. If everything is okay, an available tftp server will be successfully built. The above test is for local testing. if you want to transmit tftp to another computer or development board, enter sudo tftp xxx (IP address of the target computer or development board) on the terminal ), in addition, we also need to disable the built-in firewall of ubuntu (as mentioned in the book). I directly unmount the firewall (sudo apt-get remove iptables), because I think for Linux, there may be no need for a firewall. at least so far I have not been attacked... Of course, if you want to connect to a computer or Development Board in another Lan for transmission, you also need to change the ip addresses of these machines to the same segment. Now, you can use the tftp protocol to transfer files between the computer and the Development Board. The current purpose is to download the Linux kernel and file system to the development board. If a friend finds out my shortcomings, he can give it to me. we can also discuss it. However, I want to emphasize that all these configurations are for ubuntu and may be different for other systems. How to use tftp on the development board: Usage: tftp [OPTION]... HOST [PORT] Transfer a file from/to tftp server Options: -l FILE Local FILE-r FILE Remote FILE-g Get file-p Put file-B SIZE Transfer blocks of SIZE octets [root @ FriendlyARM] # tftp-l/home/test. c-r/test. c-g 192.168.1.103 note: it indicates/tftpboot/test on the remote host. c. download it to the/home/directory of the development board and change it to test. c file... -L: localhost-r: remote-g: get 192.168.1.103 is the same as the remote host ip address. to upload a local file to the remote server, set-g to-p, p indicates put...
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.