TFTP 简单文件传输协议

简 介

简单文件传输协议是一种基于UDP协议的客户端和服务器之间进行简单文件传输的协议,它提供了不复杂、开销不大的文件传输服务。

它使用UDP协议的69号端口作为其传输,不能列出目录内容,无验证或加密机制,被用于在远程服务器上读取或写入文件,因此文件的传输过程也不像FTP协议那样可靠。但是TFTP不需要客户端的权限认证,也就减少了无谓的系统和网络带宽消耗,因此在传输琐碎不大的文件时,效率更加高,目前主要适用于私人的本地网络中,常用于PXE无盘启动,网络设备的设置等。

部署环境:

  • rhel6.5操作系统
  • 服务器IP地址:192.168.100.5
  • rhel6.5的镜像光盘挂载至/mnt/cdrom/

部署服务:

1. 安装xinetd、ftfp-server、tftp软件包

rpm -ivh /mnt/cdrom/Packages/xinetd-2.3.14-39.el6_4.x86_64.rpm
rpm -ivh /mnt/cdrom/Packages/tftp-server-0.49-7.el6.x86_64.rpm
rpm -ivh /mnt/cdrom/Packages/tftp-0.49-7.el6.x86_64.rpm

2. 修改tftp配置文件

vim /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
server_args = -s /var/lib/tftpboot
disable = no //默认的yes修改为no,表示开启
per_source = 11
cps = 100 2
flags = IPv4

3. 添加到系统开机项并启动服务

chkconfig xinetd on
service xinetd start

TFTP的根目录为/var/lib/tftpboot

4. 测试

TFTP 简单文件传输协议

TFTP应用不止于此,一般与其他软件配合使用,如前博文 [亲测可用] PXE无人值守自动装机 的综合应用。

猜你喜欢

转载自blog.51cto.com/10316297/2130065