主机windows系统,虚拟机linux系统与工控屏arm-linux之间使用tftp进行数据传输

1.保证三个系统之前能互相ping 通
在这里插入图片描述

2.打开windows系统,linux系统的tftp-server
windows使用tftp32工具。
在这里插入图片描述

linux 使用参考以下文章:

重启xinetd服务:
keyue@ubuntu:~$ sudo /etc/init.d/xinetd restart
然后使用命令 netstat -au | grep tftp查看tftp服务器是否开启:
keyue@ubuntu:~$ 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:帮助信息

猜你喜欢

转载自blog.csdn.net/clearhlj/article/details/83786414