18 · Configuring Static Routing設定靜態路由

Routing Operation路由的運作

Routing is the process of selecting a path to forward data that originated from one network and is destined for a different network. Routers gather and maintain routing information to enable the transmission and receipt of such data packets.

路由是選擇路徑,將源自某個網路、目的地為另一個網路的資料轉送出去的程序。路由器會收集並維護路由資訊,以便傳送與接收這類資料封包。

Conceptually, routing information takes the form of entries in a routing table, with one entry for each identified route. You can manually configure the entries in the routing table or the router can use a routing protocol to create and maintain the routing table dynamically to accommodate network changes when they occur.

概念上,路由資訊會以路由表中的項目呈現,每條已識別的路由對應一筆項目。你可以手動設定路由表中的項目,或者由路由器使用路由協定,在網路發生變化時動態建立並維護路由表。

A router must perform the following actions to route data:

路由器要路由資料,必須執行下列動作:

  • Identify the destination of the packet: Determine the destination network address of the packet that needs to be routed by using the subnet mask.識別封包的目的地:使用子網路遮罩,判斷需要路由之封包的目的網路位址。
  • Identify the sources of routing information: Determine from which sources a router can learn paths to network destinations. A source can be a directly connected interface, a dynamic routing protocol, or a statically configured route.識別路由資訊的來源:判斷路由器可以從哪些來源學到通往目的網路的路徑。來源可以是直接連接的介面、動態路由協定,或是靜態設定的路由。
  • Identify routes: A router may know the same route from multiple sources and choose the preferred route based on certain criteria.識別路由:路由器可能會從多個來源得知同一條路由,並根據特定條件選出偏好的路由。
  • Select routes: Select the best path to the intended destination.選擇路由:選出通往目的地的最佳路徑。
  • Maintain and verify routing information: Update known routes and the selected route according to network conditions.維護並驗證路由資訊:根據網路狀況更新已知的路由與選定的路由。

The router relies on the routing table when deciding which interfaces to use when forwarding packets. The figure shows that R2 uses the GigabitEthernet 0/0 interface to get to the 172.16.1.0/24 subnet. In the routing table of R2, the 172.16.1.0/24 network is known because it is directly connected. The route source is the method in which the router learns the subnet.

路由器在決定要用哪個介面轉送封包時,會依賴路由表。圖中顯示 R2 使用 GigabitEthernet 0/0 介面連往 172.16.1.0/24 子網路。在 R2 的路由表中,172.16.1.0/24 網路是已知的,因為它是直接連接的。路由來源就是路由器學得該子網路的方式。

There are three major types of sources:

路由來源主要有三種類型:

  • Routers can learn the directly connected network based on the IP address and subnet mask configured on the local interface.路由器可以根據本機介面上設定的 IP 位址與子網路遮罩,學到直接連接的網路。
  • You can manually configure network information also known as a static route.你也可以手動設定網路資訊,這就是所謂的靜態路由。
  • Routers can dynamically learn destination network information by using a routing protocol enabled on the router.路由器可以透過在路由器上啟用的路由協定,動態學到目的網路資訊。

If the destination network is directly connected, the router already knows which interface to use when forwarding packets. If destination networks are not directly connected, the router must learn which route to use when forwarding packets.

若目的網路是直接連接的,路由器已經知道要使用哪個介面轉送封包。若目的網路不是直接連接的,路由器就必須學習轉送封包時要使用哪條路由。

In general, all routers should know all network subnets. But the route source and exit interface vary based on the router's topology position.

一般而言,所有路由器都應該知道所有網路子網路,但路由來源與出口介面會因路由器在拓樸中的位置而不同。

In what three ways does a router learn routing information? (Choose three.)路由器可以透過哪三種方式學習路由資訊?(選擇三項。)