[精讚] [會員登入]
12267

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] 安裝及使用postfix,設定虛擬帳號及轉寄 使用postfix來設定虛擬帳號及轉寄

[Rocky Linux] 安裝gitlab gitlab+docker compose+ nginx 安裝Gitlab並結合nginx當網頁伺服器

[Centos7] 新的防火牆firewalld Centos7新的防火牆firewalld 和前面的iptables有很大的不同

[Centos8] 利用nmcli 設定ipv4 位址 Centos7之後修改網路設定變得比較麻煩一點,此篇介紹使用nmcli指令的方法

[Centos6] 安裝wordpress Centos 6下安裝wordpress,非常簡單

[Centos6 7] 掛載磁碟 只是掛載新磁碟

隨機好文

Linux shell 的date表示法 linux下SHELL中的date表示法

設計的工作絕不接受比價 拿買陽春麵的價格想買牛肉麵,寧願倒掉也不賣

[AS3] FLASH 引入外部as檔 FLASH AS3中,若要引用另外撰寫的 class(*.as) 檔案,該如何處理?

[AS3] 變數型態 基本類型宣告 as3 有下列幾種基本類型:string, int, number, object, boolean, n

我的便利帶變垃圾袋--談預付制 預付制說穿了,就是對賣家極有利,對買家極小利的消費經營模式。