[精讚] [會員登入]
12104

TFTP Server 安裝及使用

讓設備的網路設定檔或是韌體經由TFTP拷備出來,操作的方法

分享此文連結 //n.sfs.tw/10092

分享連結 TFTP Server 安裝及使用@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2020-09-07 11:01:22 最後編修
2016-10-28 12:37:24 By 張○○
 

自動目錄


部分網路設備會有讓裡面的網路設定檔或是韌體經由TFTP拷備出來的功能,例如CISCO的router或可網管的switch。這裡介紹一個在unix-based的OS下,有另一個選擇的tftp server,是個deamon。

安裝 opentftp server

接收端要裝TFTP的SERVER 服務;目的已有WINDOWS版本的TFTP SERVER。
在unix-based的OS下,有另一個選擇的tftp server,叫作 open tftp。除可作為程式用也可當作是deamon角色執行。

[TARBALL安裝]

LINUX下載:

  http://sourceforge.net/projects/tftp-server/

WINDOWS下載:

  https://sourceforge.net/projects/tftputil/

下載後解壓

# cd opentftp
# ls
Licence.txt  opentftpd  opentftpd.cpp  opentftpd.h  opentftp.ini  rc.opentftp  README

[DNF/YUM安裝]

#  dnf install tftp-server

#  yum install tftp-server

設定

# vi opentftp.ini

[LISTEN-ON]
0.0.0.0
[HOME]
/home/axer/routeconf
[LOGGING]
Errors
[ALLOWED-CLIENTS]
192.168.0.1-192.168.0.254
[TFTP-OPTIONS]
'保留預設,不必更動

yum或dnf 的安裝設定檔在 /etc/xinetd.d 中請建立一個檔案叫 tftp.ini

# touch /etc/xinetd.d/tftp.ini

防火牆/selinux

預設監聽 69/UDP 防火牆記得打開

範例 開啟同網段來源傳入 RUNTIME

# firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="163.X.X.0/24" port port="69" protocol="udp" accept'

永久生效

# firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="163.X.X.0/24" port port="69" protocol="udp" accept' --permanent

 

selinux調整以下設定

# setsebool -P tftp_anon_write 1

執行

# ./opentftpd -v

要結束按 Ctrl-C

查看監聽情形

# netstat -au
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
udp        0      0 diamond.tcc.edu.tw:tftp     *:*
udp        0      0 localhost.localdomain:tftp  *:*

防火牆要開 69/udp
-A RH-Firewall-1-INPUT -p udp -m udp --dport tftp -j ACCEPT

Cisco Router 指令拷背設定檔出來

TANET-TCC-R6K#copy running-config tftp
Address or name of remote host []? 10.0.10.1 <====輸入ip
Destination filename [tanet-tcc-r6k-confg]? 20071207.txt  <====輸入檔名
!!!!!!!!!!!
48635 bytes copied in 9.868 secs (4929 bytes/sec)
如此就能順利的將網路設備上的設定檔備份下來。

在DLINK SW下指令拷背設定檔出來

#upload cfg_toTFTP ip位址 檔名
範例
DGS-3324SR:4#upload cfg_toTFTP 10.0.10.1 dlinksw
Command: upload cfg_toTFTP 10.0.10.1 dlinksw

 Connecting to server................... Done.
 Upload configuration................... Done.


原文寫於 2007.12.12 整理於 2009-10-12 11:32:31 編修

END

你可能感興趣的文章

SELinux 常用指令和檔案 在Redhat系列中,Centos5以後加入了selinux,他並沒有這麼可怕,不必每次看到Selinux ,就想把他

[Centos7] 使用網路安裝 Centos7 使用網路來安裝Centos7,雖然這不是什麼新鮮事,但可以省你的磁碟空間或光碟片

[CENTOS7] 使用 logrotate 來整理mongo日誌檔 解決 mongo 的日誌檔不斷長大的問題

[Centos] 查看網路的流量 介紹 sar, iftop, nethogs, 和 vnstat 等流量監控程式

[Centos7] HTTPS/SSL憑證的SELINUX設置 把申請來的憑證檔放到指定的位置後,沒辦法啟動,怎麼辦?

[Centos7] 安裝phpMyAdmin Centos 7有新的方式可以安裝phpmyadmin,不必再採用過去的tarball安裝法。

隨機好文

安裝SPHINX支援中文 新版本的 sphinx 和舊版不同,網路上很多範例和教學是不能用的。此文是安裝和設定方法分享

[CodeIgniter3] 解決無法上傳特定檔案(.sb2)的問題 上傳時出現The filetype you are attempting to upload is not allowed,要怎麼解決?

世紀帝國征服者新版本--被遺忘的帝國 世紀帝國征服者新版本--被遺忘的帝國 世紀二代的征服者是精典遊戲中的精典,aofe更好玩...

精讚的版面變化 ▓此文僅作為舊文的記錄▓ 這篇文章為了紀念改版完成而撰寫。 原本的部落格是民國97年的作品,那時還是用舊有的技術來寫,很

正則表達式:Email名稱防止連續輸入點(.)及下底線(_) Email的名稱中要允許特殊符號,但又不允許連續出現的正則表達式