Use of your own TFTP Server software on Mac

Source: Internet
Author: User
Tags file transfer protocol

1. TFTP protocol

The Simple File transfer Protocol trivial files Transfer Protocol (TFTP) is a simple, low-overhead file Transfer protocol based on the UDP protocol that allows a client get or put file to be on a remote host. Because of its overhead, TFTP is used to boot the computer, such as a router that does not have a large storage capacity. That's why many routers use TFTP as a way to upgrade. This agreement is interesting, if interested, please refer to the following two URLs:

Chinese Wiki or english Wiki

RFC 1350 the TFTP PROTOCOL (REVISION 2)

2, Mac Configuration and start TFTP1) configuration

The Mac comes with TFTP by default. Configuration file location:/system/library/launchdaemons/tftp.plist.

To modify the configuration file, remove the following two lines:

<key>Disabled</key><true/>

Add the following configuration (optional), which is to add the-l option:

<array>    <string>/usr/libexec/tftpd</string>    <string >-i</string>    <string>-l</string>    <string >/Private/tftpboot</string></array>

Brief description:

I,-i option to turn on unsafe mode. The-l option uses syslog to log all requests. For instructions please refer to: Man tftpd (Open terminal, enter this command to see).

II,/private/tftpboot is the default path, need to change its read and write permissions (very important), execute the command:

777 /private/tftpboot

2) Start

sudo launchctl load-f/system/library/launchdaemons/tftp.plist
sudo launchctl start com.apple.tftpd

Execute the top two, if there is no error, then the start is successful. If you want to see the log, you can use the following command:

Tail-f/var/log/system.log

The resulting log should be as follows:

Mar  7: ***.localsudo[589]:   * * *: tty=ttys000; Pwd=/users** *; User=root; Command=/bin/launchctl load-f/system/library/launchdaemons/tftp.plist

Mar  7: £º ***.local sudo[591]:   * * *: tty=ttys000; Pwd=/users** *; User=root; Command=/bin/launchctl start Com.apple.tftpdMar  7 14:04:09 ***.local tftpd[593]: Recvfrom:resource temporarily Unavailablemar  7 14:04:09 * * * com.apple.xpc.launchd[1] (com.apple.tftpd[593]): Service exited with abnormal code:1 

This position seems to have an error, but does not affect the use, if there are experts please advise how to deal with.

3) Close
sudo launchctl unload-f/system/library/launchdaemons/tftp.plistsudo launchctl stop com.apple.tftpd

3. Use of TFTP protocol

After starting the TFTP server, we can use TFTP to connect to the server and get or submit the file. Below, use the command line to demonstrate:

 ***:~ ***$ tftptftp  > connect Localhosttftp  > statusconnected to localhost. Mode:netascii verbose:off tracing:offrexmt -interval: 5  seconds, Max-timeout: 25   secondstftp  > Verboseverbose mode on.tftp  > get  1  .txtgetting  from  Localhost:1 . txt to 1  .txt [netascii]received  9  bytes in   0.0  seconds [inf bits/sec]tftp  > Quit 

Simple note: we get 1.txt (/private/tftpboot/1.txt) files from the TFTP server via TFTP.

Connect Host-name [port] to the server. For other commands please refer to: Man tftp.

4. Use TFTP to Tp-link firmware upgrade

If the above steps have been successfully completed, then using the Mac TFTP to Tp-link upgrade is very simple, just need to go to the Tp-link website to search your router's corresponding firmware download, and then put the bin file in the/private/tftpboot directory, and enter the router 192.168.1.1, and then the firmware upgrade, a few clicks on the button will be done. Please feel free to send them all.

Original link: http://www.it165.net/os/html/201503/11922.html

Use of your own TFTP Server software on Mac

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.