【待修改】
TFTP服务搭建
1、检查安装
#rpm -qa|grep tftp-server
如果没有则安装xinetd服务与tftp-server
#yum install xinetd
#yum install tftp-server
2、设置tftp配置文件
#vi /etc/xinetd.d/tftp
修改内容有二
一是,将server_args的tftpboot路径改为根目录(需要手工新建)
二是将disable改为no
server_args = -s /tftpboot
disable = no
3、
根据路径新建tftpboot#mkdir /tftpboot
修改tftpboot权限,可读可写#chmod +rw /tftpboot
或者将tftpboot权限最大化#chmod 777 /tftpboot
重启服务#systemctl restart xinetd
设置开机自启动#systemctl enable xinetd
4、
检查tftp服务开启状态#systemctl status xinetd
查看tftp是否启动#netstat -a | grep tftp
出现udp 0 0 0.0.0.0:tftp 0.0.0.0:*
为正常启动
5、本地测试tftp
#cd /tftpboot
#touch aaa
#cd /home
#touch bbb
#tftp 172.16.24.227
tft>get aaa
tft>put bbb
tft>q
以上语句内容为:
在tftpboot内新建aaa,在home内新建bbb ,链接本机IP,将aaa从TFTP的共享文件夹tftpboot中下载到当前文件夹home,将bbb从当前文件夹home中上传到共享文件夹tftpboot中,退出。
结果为tftpboot与home文件夹中都有aaa和bbb两个文件。
6、使用TFTP
开发板与主机通过网线直连。
开发板上操作:使用printenv查看网络设置
使用setenv 设置三个参数serverip(主机系统IP) ipaddr (开发板IP) gatewayip(网关IP)
保证三个参数在同个网段中。
saveenv保存设置
开发板ping主机IP,ping通即可下载。
注:虚拟机需与主机桥连