centOS配置tftp服务

1.安装tftp client和tftp server

yum install tftp

yum install tftp_server

2.修改tftp配置文件

vi /etc/xinetd.d/tftp

# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd

#tftp根目录/var/lib/tftpboot,添加-c参数表示可以创建目录
server_args = -s /var/lib/tftpboot -c

#tftp默认不开启服务,需要把disable改成no
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

3.创建tftp根目录,并修改权限

mkdir /var/lib/tftpboot

chmod -R 777 /var/lib/tftpboot

4.关闭防火墙

先查看防火墙状态:service iptables status

关闭防火墙:service iptalbes stop

5.重启xinetd服务

service xinetd restart

6.查看服务是否启动

netstat -a |grep tftp

注释:tftp是使用udp协议来实现的。

7.修改selinux策略

vi /etc/sysconfig/selinux

把selinux改为disabled

8.tftp测试

登录tftp服务器:tftp ser_ip(服务器IP)

get file 从服务器下载文件

put file 上传文件到服务器

 9.嵌入式linux通过windows下的tftp32d.exe上传下载文件
1)在tftp32d.exe设置好服务器根目录
2)在tftp32d.exe设置好当前windows的IP地址
3)从windows下载文件到linux:tftp -r filename -g win_ip
4)从linux上传文件到windows:tftp -l filename -p win_ip