2018年3月26日 星期一

Quick installation using DHCP(使用DHCP功能進行快速安裝)


In this example, you will use DHCP and your FortiGate’s default configuration to securely connect your internal network to the Internet in two simple steps.

在此範例中,您只需要做兩個簡單的步驟,就能使用DHCP功能以及FortiGate的初始設定來安全地連接您的內部網路(Internal network)以及網際網路(Internet)。

(簡單來說,就是利用DHCP功能讓FortiGate設備能夠快速啟用,提供基本防護。)
(需要預先跟ISP業者講好使用DHCP功能,讓FortiGate連接到小烏龜時,可以自動向ISP取得IP,同時,由於FortiGate在internal部分的初始設定就有啟用DHCP功能,底下的電腦只要接上就能自動取得DHCP派發的IP,所以才能做到快速連接,立即使用。)

This recipe has the following requirements:
這個方法有以下幾點需求:

  • An ISP that provides connectivity with DHCP and accepts DHCP requests without authentication.
    可提供DHCP連線功能並能接受無驗證DHCP請求的ISP業者(通常為中華電信)
  • A FortiGate with a default configuration that includes a DHCP server on the lan (or internal) interface and a security policy that securely allows all sessions from the Internal network to reach the Internet.
    一台具有基本設定的FortiGate,基本設定包含以下兩點:
    1:在lan介面存在DHCP server
    2:防火牆規則允許內部網路(Internal)接觸到網際網路(Internet)
  • Your network uses IPv4 to connect to the FortiGate and Internet.
    您的網路使用IPv4網路來連接FortiGate及網際網路(Internet)

1. Connecting the FortiGate to your ISP and the internal network

將FortiGate連接到ISP及網際網路上



Connect the FortiGate wan interface to your ISP-supplied equipment.

將FortiGate的Wan端連接到您的ISP業者提供的設備(通常為中華電信的小烏龜)

Connect the internal network to the FortiGate’s default lan or internal interface.

將內部網路(Internal network)連接到FortiGate的預設 lan介面(或是叫Internal介面)

Turn on the ISP’s equipment, the FortiGate unit, and the PCs on the internal network.

啟動ISP業者提供的設備(小烏龜),啟動FortiGate設備,啟動電腦。

2. Configuring your PCs to use DHCP

設定您的電腦使用DHCP功能


For Windows Vista / 7 / 8:

Go to Network and Sharing Center and select Local Area Connections. Select Properties.

開啟"網路及共用中心",開啟"區域連線",開啟"內容"(網路及公用中心可以在"控制台" > "網路和網際網路"找到)


Select Internet Protocol Version 4 (TCP/IPv4), then select Properties.

點選到"網際網路通訊協定第4版 (TCP/IPv4)",開啟"內容"


Select Obtain an IP address automatically and Obtain DNS server address automatically.

上半部點選到"自動取得IP位址",下半部點選到"自動取得DNS伺服器位址"

for Mac OS X

Go to Network Preferences and select Ethernet.

開啟網路設定,點選到Ethernet


Set Configure IPv4 to Using DHCP.在設定IPv4的部分選取到使用DHCP
---------------------------以上為實作-----------以下為驗證----------------------------------

3. Results
結果

From any PC on the internal network, open a web browser and browse to any website. You can successfully connect to the Internet.

從任意一台位在內網的電腦,開啟網頁瀏覽器隨便連個網站,您應該可以成功連上網際網路。

Go to Policy & Objects > IPv4 > Policy. Your Internet-access policy is at the top of list, in the lan – wan section (this section’s name varies based on the FortiGate model).

開啟"政策&物件" > "IPv4" > 政策。
您的防火牆規則位於表單的最上方,位於lan-wan的區域(此區域的名稱會因不同的版本或模式而出現不同的表示名稱,此處截圖的名稱為internal - wan 1)

View the Count column, which displays the total amount of traffic that has used this policy since the FortiGate’s last reboot. The column should display results, showing that the policy is being used for traffic.

檢視到記數攔位,該攔位會顯示從FortiGate上一次重啟後,此政策所流經的全部流量,此攔位應該會出現結果,顯示此政策所流經的流量。

If this column is not visible, right-click on the title row, select Count, and select Apply.


若看不到此攔位count(記數),在標題列上點右鍵(或在右上角的齒輪上點左鍵),選擇Count(記數),點擊Apply(採用)。

2018年1月12日 星期五

Installing a FortiGate in Transparent mode(以透通模式安裝FortiGate)

In this example, you will learn how to connect and configure a new FortiGate unit in Transparent mode to securely connect a private network to the Internet. In Transparent mode, the FortiGate applies security scanning to traffic without applying routing or network address translation (NAT).
在此範例,您將了解如何在透通模式下連接及設定新的FortiGate設備,從而將私有網路安全地連接到網際網路,在透通模式下,FortiGate會對流量進行安全掃描,而不進行路由或轉址的行為。
Warning: Changing to Transparent mode removes most configuration changes made in NAT/Route mode. To keep your current NAT/Route mode configuration, backup the configuration using the System Information widget, found at System > Dashboard > Status.
警告:更改模式為透通模式需要刪除NAT/路由模式中使用的大部分配置,為了保留原NAT/Route模式的設定資料,請照以下步驟操作:左側項目點擊到系統管理(System) > 儀表板(Dashboard) > 狀態(status) > 系統資訊(System Information) > 系統設定(System Configuration) > 設定備份(Backup) > 備份(Backup)

1. Changing the FortiGate’s operation mode

切換FortiGate的運作模式



Go to System > Dashboard > Status and locate the System Information widget.
Beside Operation Mode, select Change.
點擊到系統管理(System) > 儀表板(Dashboard) > 狀態(status) > 系統資訊(System Information) > 操作模式(Operation Mode) > 更改(change)

Set the Operation Mode to Transparent. Set the Management IP/Netmask and Default Gateway to connect the FortiGate unit to the internal network.

點選到 透通模式(Transparent),設定管理IP/遮罩(Management IP/Netmaskand)以及用以連接FortiGate設備及內部網路的預設路由(Default Gateway)
You can now access the GUIby browsing to the Management IP address (in the example, you would browse to http://172.20.120.122).
您現在可以透過瀏覽到先前設定的IP位址登入到圖形化使用者介面進行操作。(在FortiCook網站的範例中,您可瀏覽到網址http://172.20.120.122)

2. (Optional) Setting the FortiGate’s DNS servers

(可選) 設定FortiGate的DNS伺服器



The FortiGate unit’s DNS Settings are set to use FortiGuard DNS servers by default, which is sufficient for most networks. However, if you need to change the DNS servers, go to System > Network > DNS and add Primary and Secondary DNS servers.

FortiGate設備的DNS設定預設是使用FortiGuard的DNS伺服器,這對於大多數的網路環境來說已經足夠使用,但是,若你需要變更DNS伺服器,請照以下步驟操作:點擊到 系統(System) > 網路(Network) > DNS > 指定(Specify) 並設定主要(Primary)及次要(Secondary) 的DNS

3. Creating a policy to allow traffic from the internal network to the Internet

建立一組Policy來允許內部網路到網際網路的流量通過



Go to Policy & Objects > Policy > IPv4 and create a new policy (if your network uses IPv6 addresses, go to Policy & Objects > Policy > IPv6).

點擊到 政策及物件(Policy & Objects) > 政策(Policy) > IPv4 > Create New 
(若您的網路使用的是IPv6位址,點擊到 
政策及物件(Policy & Objects) > 政策(Policy) > IPv6,ps:若沒看到IPv6,則需要先到進階項目中開啟IPv6)



Set the Incoming Interface to an available external interface (typically port 1) and the Outgoing Interfaceto the Internet-facing interface (typically WAN1)

將來源介面設為可用的外部介面(通常為Port 1),並將出去介面設為網際網路方面的介面(通常為WAN 1)



Scroll down to view the Logging Options. In order to view the results later, enable Log Allowed Traffic and select All Sessions.


將畫面向下捲動,檢視到紀錄項目(Logging Options),為了稍後能夠檢視到結果,啟用 允許紀錄流量(Log Allowed Traffic),並選取到 所有流量(All Sessions)

4. Connecting the network devices

連接到網路設備


Go to System > Dashboard > Status and locate the System Resources widget. Select Shutdown to power off the FortiGate unit.

點擊到 系統(System) > 儀錶板(Dashboard) > 狀態(Status) 並檢視到 系統資源(System Resources) 分頁,點擊到 關機(Shutdown)以關閉FortiGate設備



Alternatively, you can enter the following command in the CLI Console (also found by going to
System > Dashboard > Status): execute shutdown

另外,您也可以在命令列介面輸入以下指令達到相同目的:execute shutdown
(點擊到系統(System) > 儀錶板(Dashboard) > 狀態(Status並檢視到CLI Console,在畫面中以滑鼠點擊左鍵即可進入介面)

Wait until all the lights, except for the power light, on your FortiGate have turned off. If your FortiGate has a power button, use it to turn the unit off. Otherwise, unplug the unit.

等待除了電源之外的所有燈號熄滅,切斷電源(有開關就切開關,沒開關就拔線)

You can now connect the FortiGate unit between the internal network and the router

您現在可以將完成設定的FortiGate設備安裝到內部網路以及Router之間的位置了
(在實體環境下仍須注意斷線問題,最好確認不會影響到內部網路的時間再進行安裝。)

Connect the wan1 interface to the router internal interface and connect the internal network to the FortiGate internal interface port.

連接Wan1介面到Router的對內介面並連接內部網路到FortiGate的internal介面Port

Power on the FortiGate unit.  接好就啟動電源

5. Results

結果



You can now browse the Internet using any computer that connects to the FortiGate’s internal interface.

您現在可以透過任意一台與FortiGate內網連接的電腦隨意瀏覽網頁

You can view information about the traffic being processed by your FortiGate by going to System > FortiView > All Sessions and finding traffic that has port 1 as the Src Interface and the Internet-facing interface as the Dst Interface.

您可以照以下步驟操作來檢視那些通過FortiGate留下的資訊:





點擊到 System > FortiView > All Sessions,要找到您瀏覽網頁的紀錄,請分別確認來源(Src Interface)為內網(internal)以及目的(Dst Interface)為連接網際網路的介面(通常為Wan1)

If these two columns are not shown, select Column Settings and move Src Interface and Dst Interface to the list of fields to be shown.

(系統版本不同,則部分介面也會有不同的外觀或位在不同的地方)

2017年12月14日 星期四

Installing a FortiGate in NAT/Route mode(以NAT或Router模式安裝FortiGate)


In this example, you will learn how to connect and configure a new FortiGate unit in NAT/Route mode to securely connect a private network to the Internet.
在此範例中,你可以學習到如何將FortiGate單元調整為NAT或是Route模式,並將之安裝到內網與網際網路的連接點上。
In NAT/Route mode, a FortiGate unit is installed as a gateway or router between two networks. In most cases, it is used between a private network and the Internet. This allows the FortiGate to hide the IP addresses of the private network using network address translation (NAT).*
FortiGate單元在NAT模式下,其作用類似連接內外網的Gateway;在Route模式下,其作用類似連接內外網的Router,在大多數情況下,FortiGate會安裝在內部網路與網際網路之間,這樣才能使用NAT模式隱藏內網使用的private IP,使其連接內部與外部網路。
(註:開始安裝前需要先決定FortiGate實體port使用的模式是Switch還是Interface,這部分請參考 Choosing your FortiGate's switch mode)


1. Connecting the network devices and logging onto the FortiGate

連接網路設備並登入FortiGate
Connect the FortiGate’s Internet-facing interface(typically WAN1) to your ISP-supplied equipment and Connect a PC to the FortiGate using an internal port (typically port 1).
將FortiGate連接到網際網路方面的介面(通常為WAN1)連接到ISP業者提供的設備上(通常是接到中華電信的小烏龜上),並將一台電腦的網路線連接到FortiGate連接內網方面的Port(通常為port 1)
Power on the ISP’s equipment, the FortiGate unit, and the PC on the internal network.

確保ISP業者的設備、FortiGate以及連接在網路上的電腦這三者的電源皆已啟動

From the PC on the internal network, connect to the FortiGate’s web-based manager using either FortiExplorer or an Internet browser (for information about connecting to the web-based manager, please see your models QuickStart Guide).

從連上此網路的電腦上進行操作,使用FortiExplorer或是網頁瀏覽器,連到FortiGate的網頁管理介面,網頁管理介面的IP請參考各型號產品的QuickStart Guide
(網頁管理介面的預設IP為192.168.1.99/24)
Login using an admin account (the default admin account has the username admin and no password).

使用帳號admin登入 (預設帳號admin,無密碼)

2. Configuring the FortiGate’s interfaces

設定FortiGate的介面


Go to System > Network > Interfaces and edit the Internet-facing interface.

點選到 系統 > 網路 > 介面 ,並在用於連接網際網路的介面項目點擊編輯
If your FortiGate is directly connecting to your ISP, set Addressing Mode to Manual and set the IP/Netmask to the public IP address your ISP has provided you with.

若您的FortiGate是直接連接到ISP的話,請在該介面上設定ISP業者提供的IP及遮罩。(具體方法為點選到wan1 > 編輯 > 在Addressing mode點選到Manual,再輸入IP及遮罩)
If have some ISP equipment between your FortiGate and the Internet (for example, a router), then the wan1 IP will also use a private IP assigned by the ISP equipment. If this equipment uses DHCP, set Addressing Modeto DHCP to get an IP assigned to the interface.



若是在FortiGate及網際網路之間裝有ISP業者提供的其他設備,則FortiGate在wan1使用的IP同樣會是Private IP以對應ISP業者的設備(小烏龜),如果該設備(小烏龜)有啟用DHCP功能,則設定FortiGate的wan1介面時,請選擇DHCP模式直接由該設備(小烏龜)自動派發IP及遮罩

If the ISP equipment does not use DHCP, your ISP can provide you with the correct private IP to use for the interface.
若ISP業者提供的設備(小烏龜)沒有DHCP功能,則可以向ISP業者詢問正確對應的Private IP以便設定FortiGate的wan1介面

Edit the internal interface (called lan on some FortiGate models).
編輯internal介面(部分型號上,此項目為lan)
Set Addressing Mode to Manual and set the IP/Netmask to the private IP address you wish to use for the FortiGate.
在FortiGate上,對該介面設定IP/遮罩


3. Adding a default route

設定預設路由
Go to Router > Static > Static Routes (or System > Network > Routing, depending on your FortiGate model) and create a new route.
點擊 路由(Router) > 靜態(Static) > 靜態路由(Static Routes)
或是 系統(System) > 網路(Network) > 路由(Routing)
[依型號不同而有些微差異]進入後,點擊create  new開始設定預設路由

Set the Destination IP/Mask to 0.0.0.0/0.0.0.0, the Device to the Internet-facing interface, and the Gateway to the gateway (or default route) provided by your ISP or to the next hop router, depending on your network requirements.

設定目的IP/遮罩這個項目為 0.0.0.0/0.0.0.0,設備選擇連接到外部網路的FortiGate介面(通常為wan1),Gateway設定由ISP業者提供或是在ISP業者的設備與FortiGate之間有Router或其他具路由功能的設備的話,就設定成與該設備連接的該設備端口IP,此項目依您的網路架構而定。

4. (Optional) Setting the FortiGate’s DNS servers



The FortiGate unit’s DNS Settings are set to use FortiGuard DNS servers by default, which is sufficient for most networks. However, if you need to change the DNS servers, go to System > Network > DNSand add Primary and Secondary DNS servers.

FortiGate產品的預設DNS設定為FortiGuard DNS伺服器,對於大部分的網路環境來說,此設定已經足以滿足大多數的環境需求,如果你需要變更DNS相關設定,請照以下步驟點選:
系統(System) > 網路(Network) > DNS ,點擊specify,並在 Primary 以及 Secondary DNS輸入所需的DNS設定



5. Creating a policy to allow traffic from the internal network to the Internet*

建立政策使流量從內網移動到外網

Go to Policy & Objects > Policy > IPv4 and create a new policy (if your network uses IPv6 addresses, go to Policy & Objects > Policy > IPv6).
點選到政策&物件 > 政策 > IPv4 > create new 建立新的過濾規則
(若要使用IPv6的話,先啟用IPv6:System > Config > Features > IPv6 > Apply,接著再建立過濾規則:Policy & Objects > Policy > IPv6 > )

Set the Incoming Interface to the internal interface and the Outgoing Interface to the Internet-facing interface.
將來源介面(Incoming Interface)設為內網使用的介面(internal),將目的介面(Outgoing Interface)設為連接網際網路部分的介面(wan1)
Make sure the Action is set to ACCEPT. Turn on NAT and make sure Use Destination Interface Address is selected (later versions of FortiOS 5.2 call this option Use Outgoing Interface Address).
確定動作(Action)設定為接受(ACCEPT)。啟用NAT(預設已啟用)並確定有勾選"使用出口端介面位址"(預設已勾選)(FortiOS 5.2.x的版本中,此項目為使用出去介面位址。)
Scroll down to view the Logging Options. In order to view the results later, enable Log Allowed Traffic and select All Sessions.

將畫面向下拖動到Logging Options的部分,為了稍後可以確認到紀錄(log),啟用Log Allowed Traffic並點選到All Sessions


5. Results

You can now browse the Internet using any computer that connects to the FortiGate’s internal interface.
您現在可以透過任意一台與FortiGate內網連接的電腦隨意瀏覽網頁
You can view information about the traffic being processed by your FortiGate by going to System > FortiView > All Sessions and finding traffic that has the internal interface as the Src Interface and the Internet-facing interface as the Dst Interface.

(圖片為使用FortiGate進行前述設定後,電腦透過FortiGate瀏覽網頁留下的紀錄)

您可以照以下步驟操作來檢視那些通過FortiGate留下的資訊:
點擊到 System > FortiView > All Sessions,要找到您瀏覽網頁的紀錄,請分別確認來源(Src Interface)為內網(internal)以及目的(Dst Interface)為連接網際網路的介面(通常為Wan1)


If these two columns are not shown, right-click on the title row, select Src Interface and Dst Interface from the dropdown menu, and then select Apply.

若這兩列並未出現,在標題行上點擊滑鼠右鍵,在下拉式選單中選擇來源介面(Src Interface)目的介面(Dst Interface),並點擊確認(Apply)
(系統版本不同,則部分介面也會有不同的外觀或位在不同的地方)

2017年12月5日 星期二

Choosing your FortiGate's switch mode(選擇FortiGate的運作模式)

This section contains information to help you determine which internal switch mode your FortiGate should use, a decision that should be made before the FortiGate is installed

這個部分包含的資訊可幫助您決定FortiGate應該選擇何種運作模式,此選擇應該在FortiGate進行安裝前提前決定


What is the internal switch mode?

internal switch模式是啥?(實體Port在運行時的模式,但由於意義不大,這名子之後的版本就被拿掉了,要進入CLI才能看得到這個名稱)

The internal switch mode determines how the FortiGate’s physical ports are managed by the FortiGate. The two main modes are Switch mode and Interface mode.
internal switch模式可判斷實體port是如何被FortiGate管理的,internal switch模式包含兩個項目,一項為Switch 模式,另一項為Interface模式。

What are Switch mode and Interface mode and why are they used?

Switch 模式跟Interface模式又是甚麼?幹嘛要用它們?


In Switch mode, all the internal interfaces are part of the same subnet and treated as a single interface, called either lan or internal by default, depending on the FortiGate model. Switch mode is used when the network layout is basic, with most users being on the same subnet.
Switch 模式:
所有內部介面皆屬於同一個子網段,所有Port皆視作單一介面,這個單一介面在預設情況下也可稱做lan或是internal,端看FortiGate模式怎麼設定,Switch模式為出場時的預設項目,基本上大多數無特殊要求的使用者皆使用此項設定

(顧名思義,Switch模式就跟Switch的特性相似,稍微接觸過Switch的人可以知道,Switch無法在單一Port上設定IP,這裡也一樣,在Switch模式下只能將IP設定在整個介面上,若要設定各個單一Port做不同用途,就需要改成另一個模式了)

In Interface mode, the physical interfaces of the FortiGate unit are handled individually, with each interface having its own IP address. Interfaces can also be combined by configuring them as part of either hardware or software switches, which allow multiple interfaces to be treated as a single interface. This mode is ideal for complex networks that use different subnets to compartmentalize the network traffic.
Interface模式:
FortiGate的所有Port將分別被視作單一介面,所有Port皆可擁有自己的IP位址,各個Portu也可藉著設定硬體或軟體方式組合成同一個介面,此法可達成多個擁有複數Port的介面同時存在,此模式適用於同時存在多個子網路的複雜網路

Which mode is your FortiGate in by default?

你的FortiGate預設模式為何?


The default mode that a FortiGate starts in varies depending on the model. To determine which mode your FortiGate unit is in, go to System > Network > Interfaces. Locate the lan or internal interface. If the interface is listed as a Physical Interface in the Type column, then your FortiGate is in Switch mode. If the interface is a Hardware Switch, then your FortiGate is in Interface mode.

FortiGate的預設模式取決於型號,若要確認您手上的FortiGate產品目前的模式,先登入WEB管理介面,點選到系統(System) > 網路(Network) > 介面(Interfaces),點選到畫面中的Internal(也可能為lan),確認"類型(Type)的資訊,若此處顯示為Physical Interface,則您持有的FortiGate產品目前即為Switch模式,若此處顯示為Hardware Switch,則您持有的FortiGate產品目前即為Interface模式。

此處的判斷方式事實上並不一定正確,原因是5.2的版本從最初的5.2.0開發到現在的5.2.12,後面的版本,有時候會做出一些顯示上的修改,有時會參照其他的版本來增加或修改模組,如5.4或5.6的版本。
另一個相對的判斷方法則是看介面下的項目數量或名稱,60C本身有8個port,共為2個WAN,1個DMZ以及5個internal port,在預設情況下,剛登入網頁管理介面時,在介面(Interfaces)看到的項目會有4個,分別為wan1、wan2、dmz以及internal,在switch模式下,internal的5個port全部都包含在internal介面中,在Interface模式下,則會看到5個internal port出現在介面中,名稱分別是internal 1到internal 5。
Switch 模式

Interface 模式

How do you change the mode?

你該如何切換這兩個模式

If you need to change the mode your FortiGate unit is in, first make sure none of the physical ports that make up the lan or internal interface are referenced in the FortiGate configuration (for example, in a policy or DHCP server). If you FortiGate model has a Switch Controller, you may need to disable it before you can change the internal switch mode.
若你需要在所持有的FortiGate產品上切換模式,首先要先確定在介面(Interfaces)的internal(舊版為lan)底下的所有引用(referenced)皆為0,也就是刪除所有設定,比如政策(policy)或是DHCP等設定。
確認Ref引用數為0

在internal點又鍵選取Change Mode
點選到Interface Mode



待機器重開完,重新登入網頁管理介面即可看到介面已經變更

Go to System > Dashboard > Status and enter either of the following commands into the CLI Console:
另一個切換方法則是透過CLI 修改,若手上有Console線,可直接接上FortiGate設備進行操作,若無,亦可用預設程式操作:登入網頁管理介面 > 系統管理(System) > 儀錶板(Dashbord) > 狀態(Statue) > 命令列控制台(CLI Console)
  1. Command to change the FortiGate to switch mode:切換到Switch模式的指令:
    config system global
         set internal-switch-mode switch
    End
  2. Command to change the FortiGate to interface mode:切換到Interface模式的指令:
    config system global
         set internal-switch-mode interface
    End

2017年6月16日 星期五

使用FTP Server備份Router的IOS或設定

首先設定本機的IP,設完接著設定FTP程式,本LAB使用3C Daemon程式(此程式同時具有TFTP及FTP的功能),啟動程式後,先點選到FTP Server欄位,再點選到Configure FTP Server,設定FTP存取資料用的資料夾路徑,同時,設定帳號及密碼,帳密在稍後需要使用到
(此處的FTP帳密,在LAB中設為admin及123456)

登入Router進行設定:
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

設定Router上的FTP程式使用的預設帳號密碼:

Router(config)#ip ftp username admin
Router(config)#ip ftp password 12345
Router(config)#end
Router#

將IOS備份到FTP伺服器(資料夾)

Router#copy flash:c1841-adventerprisek9-mz.150-1.M10.bin ftp:
Address or name of remote host []? 192.168.10.1                           輸入FTP伺服器的IP
Destination filename [c1841-adventerprisek9-mz.150-1.M10.bin]?
Writing c1841-adventerprisek9-mz.150-1.M10.bin !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43126032 bytes copied in 52.940 secs (814621 bytes/sec)

備份結束後,前往FTP資料夾檢視,確認檔案是否存在

設定檔的備份指令如下:

Router#copy startup-config ftp:

待指令執行完畢,同樣前往FTP資料夾確認檔案存在與否

使用TFTP Server備份Router的IOS或設定

本LAB中使用的是3C-daemon這個程式,在啟動程式前,先設定好本機的IP,便可在啟動時,自動將該IP設為TFTP伺服器的IP。(此處LAB,本機IP設定為192.168.10.1/24)

接著,設定TFTP伺服器存取資料的資料夾:
先點擊左側的Configure TFTP Server圖示

設定存取資料的資料夾





設定完成後,就可以開始做備份還原的動作了



一.Router備份IOS:

1.先將Console線以及網路線都接到Router上,Port隨意
2.登入Router後,先檢視IOS的名稱,一會需要用到

Router>
Router>enable
Router#show version 
Cisco IOS Software, 1841 Software (C1841-ADVENTERPRISEK9-M), Version 15.0(1)M10, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Tue 26-Feb-13 12:28 by prod_rel_team

ROM: System Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1)

Router uptime is 22 minutes
System returned to ROM by power-on
System image file is "flash:c1841-adventerprisek9-mz.150-1.M10.bin"          <-------------------
Last reload type: Normal Reload

 --More-- 

3.設定Router的IP,在接上網路線的Port上設定IP:

Router#
Router#configure terminal 
Router(config)#
Router(config)#interface fastEthernet 0/0                 (接哪個Port就到哪邊設定)
Router(config-if)#
Router(config-if)#ip address 192.168.10.2 255.255.255.0
Router(config-if)#no shutdown 
Router(config-if)#end
Router#

4.測試IP設定是否有誤:
從Router上Ping TFTP server,確認IP是否互通,不通就要回頭查看哪邊出錯

成功Ping通應如下列訊息
Router#ping 192.168.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
Router#

5.開始將Router中的IOS備份到TFTP中

Router#
Router#copy  flash:c1841-adventerprisek9-mz.150-1.M10.bin  tftp   IOS名稱請參照先前的資訊
Address or name of remote host []? 192.168.10.1                               輸入TFTP伺服器的IP
Destination filename [c1841-adventerprisek9-mz.150-1.M10.bin]?    設定備份起來的檔案名稱
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43126032 bytes copied in 59.860 secs (720448 bytes/sec)
Router#

複製成功,接著到本機的TFTP資料夾中,確認檔案存在就表示備份成功

PS:若是IOS檔案的大小超過16MB的話,檔案傳到一半,你可能會看到類似下列的訊息

!!!!!!!!.....
%Error writing tftp://192.168.10.1/c1841-adventerprisek9-mz.150-1.M10.bin (Timed out).....

原因是設備的TFTP的傳輸容量限制為16MB,超過就會出錯,這時,需要換成其他方式來傳輸,可以改用rcp或是ftp。


備份設定黨的方法相似,指令如下:
Router#
Router#copy  startup-config  tftp:   IOS名稱請參照先前的資訊
Address or name of remote host []? 192.168.10.1                               輸入TFTP伺服器的IP
Destination filename [Router-confg]?                 設定備份起來的檔案名稱,括號內為預設名稱
Writing startup-config...!!
[OK - 621 bytes]

621 bytes copied in 0.002 secs (310500 bytes/sec)

Router#

複製成功,接著到本機的TFTP資料夾中,確認檔案存在就表示備份成功

PS:若設定檔的大小超過16MB的話,同樣可能會出現Error writing的錯誤訊息