1. 程式人生 > >主機windows系統,虛擬機器linux系統與工控屏arm-linux之間使用tftp進行資料傳輸

主機windows系統,虛擬機器linux系統與工控屏arm-linux之間使用tftp進行資料傳輸

1.保證三個系統之前能互相ping 通
在這裡插入圖片描述

2.開啟windows系統,linux系統的tftp-server
windows使用tftp32工具。
在這裡插入圖片描述

linux 使用參考以下文章:

重啟xinetd服務:
[email protected]:~$ sudo /etc/init.d/xinetd restart
然後使用命令 netstat -au | grep tftp檢視tftp伺服器是否開啟:
[email protected]:~$ netstat -au | grep tftp

作者:未名湖畔的落葉
來源:CSDN
原文:https://blog.csdn.net/keyue123/article/details/52658643


版權宣告:本文為博主原創文章,轉載請附上博文連結!

3.在工控屏上使用tftp命令,就可以下載相關檔案
BusyBox tftp使用
BusyBox v1.13.3 (2009-03-25 15:48:45 CST) multi-call binary

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

從伺服器獲得檔案

tftp –g –r filename ipaddr(主機的ip)

上傳檔案:

tftp –p –l filename ipaddr(開發板的ip)

作者:ccskyer
來源:CSDN
原文:https://blog.csdn.net/ccskyer/article/details/6075048
版權宣告:本文為博主原創文章,轉載請附上博文連結!

在這裡插入圖片描述

以上方法完成tftp檔案下載。

補充:安裝tftp伺服器
需要安裝xinetd、tftp和tftp-server 3個軟體
1)如果能上網,通過yum安裝:
sudo yum install xinetd
sudo yum install tftp
sudo yum install tftp-server
2)如果不能上網,可以直接安裝提供的rpm包:
sudo rpm -ivh xinetd-<?xml:namespace prefix = st1 />2.3.14-18.fc9.i386.rpm
sudo rpm -ivh tftp-0.48-3.fc9.i386.rpm
sudo rpm -ivh tftp-server-0.48-3.fc9.i386.rpm
2、配置tftp伺服器
修改/etc/xinetd.d/tftp檔案,將其中的disable=yes改為disable=no。
主要是設定TFTP伺服器的根目錄,開啟服務。修改後的檔案如下:
service tftp
{ socket_type =dgram
protocol =udp
wait =yes
user =root
server =/usr/sbin/in.tftpd
server_args =-s /tftpboot -c
disable =no
per_source =11
cps =100 2
flags =IPv4
}
說明:修改項server_args= -s -c,其中 處可以改為你的tftp-server的根目錄,引數-s指定chroot,-c指定了可以建立檔案。
3、啟動tftp伺服器並關閉防火牆
/etc/init.d/iptables stop //關閉防火牆
sudo /sbin/service xinetd start
或service xinetd restart
/etc/init.d/xinetd start
看到啟動[OK]就可以了
4、檢視tftp服務是否開啟
netstat -a | grep tftp
顯示結果為
udp 0 0 *:tftp :


表明服務已經開啟,就表明tftp配置成功了。
5、tftp使用
複製一個檔案到tftp伺服器目錄,然後在主機啟動tftp軟體,進行簡單測試。
tftp 192.168.1.2
tftp>get
tftp>put
tftp>q
6、tftp命令用法如下
tftp your-ip-address
【進入TFTP操作】
connect:連線到遠端tftp伺服器
mode:檔案傳輸模式
put:上傳檔案
get:下載檔案
quit:退出
verbose:顯示詳細的處理資訊
tarce:顯示包路徑
status:顯示當前狀態資訊
binary:二進位制傳輸模式
ascii:ascii傳送模式
rexmt:設定包傳輸的超時時間
timeout:設定重傳的超時時間
help:幫助資訊