linux搭建TFTP服務

1.安裝tftp服務和客戶端

sudo apt-get install xinetd tftp tftpd

2.配置

vim /etc/xinetd.d/tftp
內容以下:vim

service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /home/lyb/tftpshare/
        disable                 = no
        per_source              =11
        cps                     = 100 2
        flags                   = IPv4
}

3.建立tftp共享目錄

1.建立服務器目錄
mkdir /home/lyb/tftpshare/
2.而後修改目錄權限
chmod 777 /home/lyb/tftpshare/
3.重啓xinetd服務
sudo /etc/init.d/xinetd restart(若是啓動失敗先關閉防火牆 service iptables stop)

4.測試驗證功能

1)本機測試

從新啓動一個終端,
輸入命令 tftp 192.168.1.11(個人虛擬機ip)進入tftp,
輸入get test,這樣就能夠獲取到test文件,
輸入q退出tftp

以下圖所示:
服務器

2)開發板測試

2440開發板的uboot能夠支持tftp下載功能,在uboot命令行輸入:socket

tftp 0x30000000  uImage_4.3

以下圖所示。
測試

相關文章
相關標籤/搜索