CentOS 6.0 tftp服务安装与配置,

本文详细介绍了如何在CentOS环境下搭建TFTP服务器,并指导如何使用TFTP客户端进行文件传输,包括安装、配置、权限设置、防火墙关闭、下载内核镜像等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装步骤:

1.

(1) yum install tftp  --> 安装tftp client

(2) yum install tftp-server -->安装tftp server

(3) yum install xinetd -->安装tftp的超级服务守护进程


2. 安装完成,查看一下
[root@localhost CentOS]# rpm -qa|grep tftp
tftp-server-0.42-3.1.el5.centos
tftp-0.42-3.1.el5.centos


3. 修改配置文件,修改如下:
[root@localhost CentOS]# 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 /tftpboot  //修改的地方
disable = no         //修改的地方
per_source = 11
cps = 100 2
flags = IPv4
}


说明:

设置Tftp共享目录:进入/etc/xinetd.d/Tftp文件,修改server_args项中的目录,,disable =no

说明:修改项server_args= -s -c,其中处可以改为你的Tftp-server的根目录,参数-s指定chroot,-c指定了可以创建文件。


注意:共享目录一定不要选择/root这样的特权目录,否则传输文件会失败accwss denied



4.

6. 重启xinetd,并配置tftp开机启动
[root@localhost CentOS]# service xinetd restart
[root@localhost CentOS]# setup     //这里主要是关闭防火墙
修改权限:
[root@localhost /]# chmod 777 /tftpboot/     //这里主要是在./目录下建立了一个tftpboot的目录,更改其目录的权限

重启:
[root@localhost ~]# service xinetd restart






使用TFTP烧写开发板,基于CentOS6.4——ok6410


3)链接好开发板与电脑的网线,打开minicom,将内核镜像烤到设置好的tftp目录。开发上电。(开发板与主机必须在 同一网段)

4)发现不能烧写,查资料后原来要安装客户端:

rpm -vih /mnt/cdrom/Packages/tftp-0.49-7.el6.i686.rpm
然后:

[arm@acer Desktop]$ sudo service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[arm@acer Desktop]$ netstat -a|grep tftp
udp 0 0 *:tftp *:*


#tftp 板子的IP
tftp> mode binary
tftp> put filename

或者tftp -m binary hostip -c put filename,也可以,这个命令在FC6下可行~~

宿主机使用tftp客户端,板子为serve。Linux下tftp默认是采用ASCII方式传送文件的,而映象为二进制,所以要设定为binary模式。


如果烧写不成功,关闭防火墙试试

另外一种方式就是通过norflash模式下载,通过minicom链接开发板上电后选择:

[n] Enter TFTP download mode menu

进入tftp模式,通过[p] Test network (TQ2440 Ping PC's IP)
测试网络联通性。

  1. Enter your selection: p                                                         
  2. TQ2440 ping PC IP:ping 192.168.1.103                                            
  3. dm9000 i/o: 0x20000300, id: 0x90000a46                                          
  4. MAC: 0a:1b:2c:3d:4e:5f                                                          
  5. checksum bad                                                                    
  6. host 192.168.1.103 is alive  
Enter your selection: p                                                       
TQ2440 ping PC IP:ping 192.168.1.103                                          
dm9000 i/o: 0x20000300, id: 0x90000a46                                        
MAC: 0a:1b:2c:3d:4e:5f                                                        
checksum bad                                                                  
host 192.168.1.103 is alive

则说明通了。

下载内核:

  1. Enter your selection: 3                                                         
  2. dm9000 i/o: 0x20000300, id: 0x90000a46                                          
  3. MAC: 0a:1b:2c:3d:4e:5f                                                          
  4. TFTP from server 192.168.1.103; our IP address is 192.168.1.6                   
  5. Filename 'zImage.bin'.                                                          
  6. Load address: 0x30000000                                                        
  7. Loading: checksum bad                                                           
  8. T checksum bad                                                                  
  9. T T T T T T T T T  
Enter your selection: 3                                                       
dm9000 i/o: 0x20000300, id: 0x90000a46                                        
MAC: 0a:1b:2c:3d:4e:5f                                                        
TFTP from server 192.168.1.103; our IP address is 192.168.1.6                 
Filename 'zImage.bin'.                                                        
Load address: 0x30000000                                                      
Loading: checksum bad                                                         
T checksum bad                                                                
T T T T T T T T T

防火墙设置:root下执行setup->Firewall configuration--> Customize->TFTP,空格选中。保存推出。

重新下载:

  1. Enter your selection: 3                                                         
  2. dm9000 i/o: 0x20000300, id: 0x90000a46                                          
  3. MAC: 0a:1b:2c:3d:4e:5f                                                          
  4. TFTP from server 192.168.1.103; our IP address is 192.168.1.6                   
  5. Filename 'zImage.bin'.                                                          
  6. Load address: 0x30000000                                                        
  7. Loading: checksum bad                                                           
  8. #################################################################             
  9.          #################################################################      
  10.          ####################################                                   
  11. done                                                                            
  12. Bytes transferred = 2415772 (24dc9c hex)                                        
  13.                                                                                                                        
  14. NAND erase: device 0 offset 0x200000, size 0x300000                             
  15. Erasing at 0x4e0000 -- 100% complete.                                           
  16. OK                                                                              
  17.                                                                                                                        
  18. NAND write: device 0 offset 0x200000, size 0x24dc9c                             
  19.                                                                                                                        
  20. Writing data at 0x44d800 -- 100% complete.                                      
  21.  2415772 bytes written: OK  
Enter your selection: 3                                                       
dm9000 i/o: 0x20000300, id: 0x90000a46                                        
MAC: 0a:1b:2c:3d:4e:5f                                                        
TFTP from server 192.168.1.103; our IP address is 192.168.1.6                 
Filename 'zImage.bin'.                                                        
Load address: 0x30000000                                                      
Loading: checksum bad                                                         
T #################################################################           
         #################################################################    
         ####################################                                 
done                                                                          
Bytes transferred = 2415772 (24dc9c hex)                                      
                                                                                                                     
NAND erase: device 0 offset 0x200000, size 0x300000                           
Erasing at 0x4e0000 -- 100% complete.                                         
OK                                                                            
                                                                                                                     
NAND write: device 0 offset 0x200000, size 0x24dc9c                           
                                                                                                                     
Writing data at 0x44d800 -- 100% complete.                                    
 2415772 bytes written: OK

下载成功!










评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值