[精讚] [會員登入]
11875

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

你可能感興趣的文章

[CentOS] 改錯fstab 無法開機怎麼辦? Linux 改錯fstab 無法開機怎麼辦?

[Centos7] audit 服務 在紅帽和suse的linux中有一個audit這樣的daemon,寫入的是核心層的記錄。

移除ssl 私鑰的密碼 現在用ssl產生私鑰會需要設定密碼,但是私鑰有密碼,啟動apache會失敗。

[postfix] open /etc/postfix/main.cf: Permission denied 等錯誤 遇到開啟 /etc/postfix/main.cf: Permission denied 等錯誤解決

PHP for sphinx 函式庫安裝 PECL/sphinx PHP>= 5.2.2 已經能原生支援 sphinx,可是預設的沒有裝,我們得自己裝才能用

[Centos7 8] postfix+DKIM 設定 信件總是被退?希望別的mail server相信我寄出的信?那麼你可以設定dkim。

隨機好文

談借錢 人借錢時手心向上頭向下,人還錢時手心向下頭向上

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

TFTP Server 安裝及使用 讓設備的網路設定檔或是韌體經由TFTP拷備出來,操作的方法

[PHP] 檢查IP是否在某個網段內 mtachcidr 要檢查IP是否在某個網段內,要寫幾行?10行?5行? 不用,只要2行。以下是我寫的 code /** * matchCI

原來KNOW-HOW這麼不值啊~~ 我把網路線拔了又插回去,把交換器重開,斷線的問題就解決了,所花的時間30秒..