[精讚] [會員登入]
11917

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

你可能感興趣的文章

使用GPG檔案加解密 簡易的檔案加解密方式,可以讓你重要的資料包括文字檔加解密。

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

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

[Rocky9] codeignitor4+ nginx+ php8.1-fpm + docker compose 這次的目標是把服務裝在docker,裡面放入 nginx 和 php8.1-fpm的 docker container, 並採用codeignitor4。

Centos7 安裝 docker-composer 及使用 docker compose 是使用docker的利器,可以讓很多的指令用文檔的方式載入。

[Centos7] selinux 修改網頁連線的埠號 想把網頁改到非標準的80埠,在selinux上要如何修改?

隨機好文

HP SAS硬碟leds燈號說明 HP SAS硬碟leds燈號(hp g7/g6系統適用)說明

[jQuery] select 元件的取值及給值 html中的元件select,在jquery中要如何使用?

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

[JAVA] JWS, JWT, JWE, JOSE是什麼? [JAVA] JWS, JWT, JWE, JOSE是什麼?非常的複雜,儘量來搞清楚..

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