TFTP是用來下載遠程檔案的最簡單網路通訊協定,基於UDP協議完成。
使用RedHat Linux 9中的第3張光碟片。以下是root登入操作
(1)安裝TFTP-server
# mount /mnt/cdrom
# cd /mnt/cdrom/RedHat/RPMS
# rpm -ivh tftp-*.i386.rpm
# cd ~
# umount /mnt/cdrom
(2)修改檔案
# vi /etc/xinetd.d/tftp
service tftp
{
socket_type =dgram
protocol =udp
wait =yes
user =root
server =/usr/sbin/in.tftpd
server_args =-s /home/liuby/tftpboot -c # 修改 注:-s指定的目錄,-c表示可以建立檔案
disable =no # 修改
per_source =11
cps =100 2
flags =IPv4
}
(3)啟動服務
建立TFTP Server 伺服器
# mkdir -m 777 /home/liuby/tftpboot
# service xinetd restart
(4)在命令列下 setup 在system services中(或ntsysv)選擇tftp,命令列lokkit關閉firewall
(5)重新啟動TFTP
# service xinetd restart
(6)測試
# tftp 192.168.0.2
tftp>get
tftp>put
tftp>q
(7)目標板測試(以下目標板上操作)
假設伺服器/home/liuby/tftpboot下有zImage,或交叉編譯的應用程式helloworld.o等
# tftp 192.168.0.2
tftp>get helloworld.o
tftp>q
# chmod +x helloworld.o
# ./helloworld.o
(8)mpc8349板下載server(59.64.155.12)的hello.o檔案
# tftp -g 59.64.155.12 -r hello.o
# chmod +x hello.o
# ./hello.o
+++++++++++++++++++++++++++++++++++++++++++++++