歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> Linux網管123---第8章.備份及回存程序-3.Cisco路由器組態備

Linux網管123---第8章.備份及回存程序-3.Cisco路由器組態備

日期:2017/3/6 15:44:42   编辑:關於Unix
在我工作的地方,我們透過廣域網路連接距離很遠的幾個地點。這些地方利用Cisco路由器透過ISDN連接, 或在其他例子,Centrexdatacircuits提供Internet及WAN連結。Cisco路由器產品允許網路伺服器透 過TFTP(“TrivialFileTransferProtocol”)讀寫組態檔。無論何 在我工作的地方,我們透過廣域網路連接距離很遠的幾個地點。這些地方利用 Cisco 路由器透過 ISDN 連接,
或在其他例子, Centrex data circuits 提供 Internet 及 WAN 連結。 Cisco 路由器產品允許網路伺服器透
過 TFTP (“Trivial File Transfer Protocol”) 讀寫組態檔。無論何時當路由器組態變更,在 Linux 伺服器
上儲存其組態檔很重要,因為這樣才能維護備份。
請注意 Red Hat 預設是 disable TFTP 服務,因為如果組態不正確這可能變成安全上的漏洞。 TFTP daemon
允許任何人無須進行稽核就可以讀寫檔案。我個人的做法是建立一個 ``/tftpboot/' 目錄,由 root 所擁有,
然後修改位於``/etc/inetd.conf'檔已有的組態列,指向該檔案位置:
tftpd dgram udp wait root /usr/sbin/tcpd in.tftpd /tftpboot



注意: 在上面那一行末端加上 ``/tftpboot' 路徑,明確地指出允許 TFTP daemon 存取的檔案位置。雖然您
也可以略過這一部份,並且允許 TFTP 存取您系統上任何一部份的檔案,既然 TFTP 有安全上的風險,這可
能是很遭的主意。

一但您 enable TFTP 服務,別忘了鍵入:
killall -HUP inetd


上面的指令重新啟動 INETD daemon 以辨認出您在 inetd.conf 檔中所做的任何變更。

要建立路由器組態備份檔牽涉到3個步驟的程序 : 設定寫入到一個已存在檔(或建立一個新的)的許可,寫入備份
檔,然後重新設定限制存取該檔案。下面是一個路由器組態備份的例:
mail:~# cd /tftpboot
mail:/tftpboot# chmod a+w xyzrouter-confg
chmod: xyzrouter-confg: No such file or directory
mail:/tftpboot# touch xyzrouter-confg
mail:/tftpboot# chmod a+w loyola-confg
mail:/tftpboot# telnet xyzrouter

Escape character is '^]'.
User Aclearcase/" target="_blank" >ccess Verification
Password: ****
xyzrouter> enable
Password: ****
xyzrouter# write network
Remote host []? 123.12.41.41
Name of configuration file to write [xyzrouter-confg]?
Write file xyzrouter-confg on host 123.12.41.41? [confirm]
Building configuration...
Writing xyzrouter-confg !! [OK]
xyzrouter# exit
Connection closed by foreign host.

mail:/tftpboot# chmod a-wr,u+r xyzrouter-confg
mail:/tftpboot# exit



當路由器出現失效的情形 (例如因為打雷發生的突波所導致),這些備份檔可以幫助重新載入路由器組態,
從組態檔恢復牽扯到3個步驟的程序 : 設定既有檔案的許可,載入檔案,然後重新設定限制存取該檔案。下
面是路由器組態恢復的例
mail:~# cd /tftpboot
mail:/tftpboot# chmod a+r xyzrouter-confg
mail:/tftpboot# telnet xyzrouter

Escape character is '^]'.
User Access Verification
Password: ****
xyzrouter> enable
Password: ****
xyzrouter# config network
Host or network configuration file [host]?
Address of remote host [255.255.255.255]? 123.12.41.41
Name of configuration file [xyzrouter-confg]?
Configure using loyola-confg from 123.12.41.41? [confirm]
Loading xyzrouter-confg from 123.12.41.41 (via BRI0): !
[OK - 1265/32723 bytes]
xyzrouter# write
xyzrouter# exit
Connection closed by foreign host.

mail:/tftpboot# chmod a-wr,u+r xyzrouter-confg
mail:/tftpboot# exit

Copyright © Linux教程網 All Rights Reserved