[精讚] [會員登入]
12222

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

你可能感興趣的文章

[Centos7] 安裝sphinx+php7 在centos7上安裝sphinx,在PHP7上運作正確

[Linux] mongodb 初步--2/3 我使用mongo 的一些大小事:叢集

[CentOS] 設定和使用quota quota 的觀念已經很老了,不過每次都會忘記所以寫下來,有需要觀念的朋友請參看鳥哥的網站吧

使用dnstop 來觀察dns運作的情形 dnstop是非常方便的工具,可以觀察即時的dns查詢。 安裝 yum install dnstop

[Centos8] 校時ntpdate? 以前常用的ntpdate,在centos8竟然不見了?

[Rocky9] codeignitor4+ php:8.3-apache + docker compose 這次的目標是把服務裝在docker,裡面放入php8.3-apache的 docker container, 並採用codeignitor4作基礎的設置。

隨機好文

使用Google尋找你的手機 這近發現google竟然可以用來找android的手機,而且不需要經過什麼設定或安裝軟體。

[jQuery] textarea 的取值和給值 HTML 的 TEXTAREA 標籤若要用 jquery 取值,不能使用 .text() 或 .html() ,使用 .

[bc] linux 的計算機 bc 設定小數位數、計算π、次方根 linux 的計算機 bc 設定小數位數、計算π、次方根

NETCRAFT發現你的網站及作業系統 NETCRAFT可以發現你的網站及作業系統

[MAC] 安裝APACHE+PHP OS Darwin OpenIDMac1deAir 15.6.0 Darwin Kernel Version 15.6.