• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

07-三層技術-IP路由配置指導

目錄

02-靜態路由配置

本章節下載 02-靜態路由配置  (298.42 KB)

02-靜態路由配置


1 靜態路由

1.1  靜態路由簡介

靜態路由是一種特殊的路由,由管理員手工配置。當網絡結構比較簡單時,隻需配置靜態路由就可以使網絡正常工作。

靜態路由不能自動適應網絡拓撲結構的變化。當網絡發生故障或者拓撲發生變化後,必須由網絡管理員手工修改配置。

1.2  配置靜態路由

1.2.1  配置準備

在配置靜態路由之前,需完成以下任務:

·     配置相關接口的物理參數

·     配置相關接口的鏈路層屬性

·     配置相關接口的IP地址

1.2.2  配置靜態路由

表1-1 配置靜態路由

操作

命令

說明

進入係統視圖

system-view

-

配置靜態路由

ip route-static dest-address { mask | mask-length } { next-hop-address [ track track-entry-number ] | interface-type interface-number [ next-hop-address  ] | vpn-instance d-vpn-instance-name next-hop-address [ track track-entry-number ] } [ preference preference-value ] [ tag tag-value ] [ permanent ] [ description description-text ]

兩者必選其一

缺省情況下,沒有配置靜態路由

ip route-static vpn-instance s-vpn-instance-name&<1-6> dest-address { mask | mask-length } { next-hop-address [ public ] [ track track-entry-number ] | interface-type interface-number [ next-hop-address ] | vpn-instance d-vpn-instance-name next-hop-address track track-entry-number } [ preference preference-value ] [ tag tag-value ] [ permanent ] [ description description-text ]

配置靜態路由的缺省優先級

ip route-static default-preference default-preference-value

可選

缺省情況下,靜態路由的缺省優先級為60

刪除所有靜態路由

delete [ vpn-instance vpn-instance-name ] static-routes all

可選

 

說明

l     如果靜態路由中指定的下一跳地址被配置為本地接口的IP地址,那麼靜態路由不會生效。

·     通過在Track模塊和靜態路由之間建立聯動,可以實現實時監測下一跳的可達性,以便及時判斷靜態路由是否有效。關於Track的詳細介紹,請參見“可靠性配置指導”中的“Track”。

·     使用undo ip route-static命令可以刪除一條靜態路由,而使用delete static-routes all命令可以刪除包括缺省路由在內的所有靜態路由。

 

1.3  配置靜態路由與BFD聯動

BFD(Bidirectional Forwarding Detection,雙向轉發檢測)提供了一個通用的、標準化的、介質無關、協議無關的快速故障檢測機製,可以為上層協議(如路由協議、MPLS等)統一地快速檢測兩台路由器間雙向轉發路徑的故障。

關於BFD的詳細介紹,請參見“可靠性配置指導”中的“BFD”。

1.3.1  雙向檢測

雙向檢測,即本端和對端需要同時進行配置,通過控製報文檢測兩個方向上的鏈路狀態,實現毫秒級別的鏈路故障檢測。

雙向檢測支持直連下一跳和非直連下一跳。

1. 直連下一跳

直連下一跳是指下一跳和本端是直連的,配置時必須指定出接口和下一跳。

表1-2 配置靜態路由與BFD聯動(雙向檢測—直連)

操作

命令

說明

進入係統視圖

system-view

-

配置靜態路由與BFD聯動

ip route-static dest-address { mask | mask-length } interface-type interface-number next-hop-address bfd control-packet [ preference preference-value ] [ tag tag-value ] [ description description-text ]

二者必選其一

ip route-static vpn-instance s-vpn-instance-name&<1-6> dest-address { mask | mask-length } interface-type interface-number next-hop-address bfd control-packet [ preference preference-value ] [ tag tag-value ] [ description description-text ]

 

2. 非直連下一跳

非直連下一跳是指下一跳和本端不是直連的,中間還有其它設備。配置時必須指定下一跳和BFD源IP地址。

表1-3 配置靜態路由與BFD聯動(雙向檢測—非直連)

操作

命令

說明

進入係統視圖

system-view

-

配置靜態路由與BFD聯動

ip route-static dest-address { mask | mask-length } { next-hop-address bfd control-packet bfd-source ip-address | vpn-instance d-vpn-instance-name next-hop-address [ bfd control-packet [ bfd-source ip-address ] ] } [ preference preference-value ] [ tag tag-value ] [ description description-text ]

二者必選其一

ip route-static vpn-instance s-vpn-instance-name&<1-6> { dest-address { mask | mask-length } next-hop-address bfd control-packet bfd-source ip-address | vpn-instance d-vpn-instance-name next-hop-address [ bfd control-packet [ bfd-source ip-address ] ] } [ preference preference-value ] [ tag tag-value ] [ description description-text ]

 

1.3.2  單跳檢測

單跳檢測,即隻需要本端進行配置,通過echo報文檢測鏈路的狀態。echo報文的目的地址為本端接口地址,發送給下一跳設備後會直接轉發回本端。這裏所說的“單跳”是IP的一跳。

表1-4 配置靜態路由與BFD聯動(單跳檢測)

操作

命令

說明

進入係統視圖

system-view

-

配置echo報文源地址

bfd echo-source-ip ip-address

必選

缺省情況下,沒有配置echo報文源地址

本命令的詳細情況請參見“可靠性命令參考”中的“BFD”

配置靜態路由與BFD聯動

ip route-static dest-address { mask | mask-length } interface-type interface-number next-hop-address bfd echo-packet [ preference preference-value ] [ tag tag-value ] [ description description-text ]

二者必選其一

ip route-static vpn-instance s-vpn-instance-name&<1-6> dest-address { mask | mask-length } interface-type interface-number next-hop-address bfd echo-packet [ preference preference-value ] [ tag tag-value ] [ description description-text ]

 

注意

·     路由振蕩時,使能BFD功能可能會加劇振蕩,請謹慎使用。

·     靜態路由的出接口為處於SPOOFING狀態時,不能使用BFD進行檢測。

·     靜態路由僅支持使用BFD檢測直連的下一跳。如果靜態路由配置的下一跳非直連,則不支持BFD檢測。

·     當使用echo報文方式時,僅在一端建立BFD會話。

·     對於echo和control報文方式,設備目前不支持在TUNNEL接口上的BFD檢測。

 

1.4  配置靜態路由快速重路由功能

當網絡中的鏈路或某台路由器發生故障時,需要通過故障鏈路或故障路由器傳輸才能到達目的地的報文將會丟失或產生路由環路,數據流量將會被中斷。

為了盡可能避免網絡故障導致的流量中斷,網絡管理員可以根據需要配置靜態路由快速重路由功能。

圖1-1 靜態路由快速重路由功能示意圖

 

圖1-1所示,通過配置快速重路由功能,網絡管理員可以為路由指定備份下一跳,當路由器通過BFD檢測到網絡故障時,路由器會使用事先配置好的備份下一跳替換失效下一跳,通過備份下一跳來指導報文的轉發,從而避免了流量中斷。

1. 配置準備

需要先配置路由策略,通過apply fast-reroute backup-interface命令在路由策略中指定備份下一跳。關於apply fast-reroute backup-interface命令以及路由策略的相關配置,請參見“三層技術-IP路由配置指導”中的“路由策略”。

2. 配置過程

表1-5 配置靜態路由快速重路由功能

操作

命令

說明

進入係統視圖

system-view

-

配置BFD echo報文源地址

bfd echo-source-ip ip-address

必選

缺省情況下,沒有配置BFD echo報文源地址

本命令的詳細情況請參見“可靠性命令參考”中的“BFD”

配置靜態路由支持快速重路由功能

ip route-static [ vpn-instance vpn-instance-name ] fast-reroute route-policy route-policy-name

必選

缺省情況下,沒有配置靜態路由支持快速重路由功能

 

說明

·     靜態路由支持快速重路由功能僅對在配置中同時指定了出接口和下一跳的靜態路由有效。

·     靜態路由快速重路由功能不能與靜態路由BFD功能同時使用。

 

1.5  靜態路由顯示和維護

在完成上述配置後,在任意視圖下執行display命令查看靜態路由配置的運行情況並檢驗配置結果。

表1-6 靜態路由顯示和維護

操作

命令

查看靜態路由表信息

display ip routing-table protocol static [ inactive | verbose ] [ | { begin | exclude | include } regular-expression ]

刪除所有靜態路由

delete [ vpn-instance vpn-instance-name ] static-routes all

 

說明

本命令的詳細情況請參見“三層技術-IP路由命令參考”中的“IP路由基礎”。

 

1.6  靜態路由典型配置舉例

說明

缺省情況下,以太網接口、VLAN接口及聚合接口處於DOWN狀態。如果要對這些接口進行配置,請先使用undo shutdown命令使這些接口處於UP狀態。

 

1.6.1  靜態路由基本功能配置舉例

1. 組網需求

交換機各接口及主機的IP地址和掩碼如圖1-2所示。要求采用靜態路由,使圖中任意兩台主機之間都能互通。

2. 組網圖

圖1-2 靜態路由基本功能配置組網圖

 

3. 配置步驟

(1)     配置各接口的IP地址(略)

(2)     配置靜態路由

# Switch A上配置缺省路由。

<SwitchA> system-view

[SwitchA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2

# 在Switch B上配置兩條靜態路由。

<SwitchB> system-view

[SwitchB] ip route-static 1.1.2.0 255.255.255.0 1.1.4.1

[SwitchB] ip route-static 1.1.3.0 255.255.255.0 1.1.5.6

# 在Switch C上配置缺省路由。

<SwitchC> system-view

[SwitchC] ip route-static 0.0.0.0 0.0.0.0 1.1.5.5

(3)     配置主機

配置Host A的缺省網關為1.1.2.3,Host B的缺省網關為1.1.6.1,Host C的缺省網關為1.1.3.1,具體配置過程略。

(4)     檢查配置結果

# 顯示Switch A的IP路由表。

[SwitchA] display ip routing-table

Routing Tables: Public

         Destinations : 7       Routes : 7

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

0.0.0.0/0           Static 60   0            1.1.4.2         Vlan500

1.1.2.0/24          Direct 0    0            1.1.2.3         Vlan300

1.1.2.3/32          Direct 0    0            127.0.0.1       InLoop0

1.1.4.0/30          Direct 0    0            1.1.4.1         Vlan500

1.1.4.1/32          Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

# 顯示Switch B的IP路由表。

[SwitchB] display ip routing-table

Routing Tables: Public

         Destinations : 10       Routes : 10

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

1.1.2.0/24          Static 60   0            1.1.4.1         Vlan500

1.1.3.0/24          Static 60   0            1.1.5.6         Vlan600

1.1.4.0/30          Direct 0    0            1.1.4.2         Vlan500

1.1.4.2/32          Direct 0    0            127.0.0.1       InLoop0

1.1.5.0/30          Direct 0    0            1.1.5.5         Vlan600

1.1.5.5/32          Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

1.1.6.0/24          Direct 0    0            1.1.6.1         Vlan100

1.1.6.1/32          Direct 0    0            127.0.0.1       InLoop0

# 在Host B上使用ping命令驗證Host A是否可達(主機安裝的操作係統為Windows XP)。

C:\Documents and Settings\Administrator>ping 1.1.2.2

 

Pinging 1.1.2.2 with 32 bytes of data:

 

Reply from 1.1.2.2: bytes=32 time=1ms TTL=126

Reply from 1.1.2.2: bytes=32 time=1ms TTL=126

Reply from 1.1.2.2: bytes=32 time=1ms TTL=126

Reply from 1.1.2.2: bytes=32 time=1ms TTL=126

 

Ping statistics for 1.1.2.2:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 1ms, Maximum = 1ms, Average = 1ms

# 在Host B上使用tracert命令驗證Host A是否可達。

C:\Documents and Settings\Administrator>tracert 1.1.2.2

 

Tracing route to 1.1.2.2 over a maximum of 30 hops

 

  1    <1 ms    <1 ms    <1 ms  1.1.6.1

  2    <1 ms    <1 ms    <1 ms  1.1.4.1

  3     1 ms    <1 ms    <1 ms  1.1.2.2

 

Trace complete.

1.6.2  配置靜態路由與BFD聯動(直連)

1. 組網需求

·     在Switch A上配置靜態路由可以到達120.1.1.0/24網段,在Switch B上配置靜態路由可以到達121.1.1.0/24網段,並都使能BFD檢測功能。

·     當Switch A和Switch B通過L2 Switch通信的鏈路出現故障時,BFD能夠快速感知,並且切換到Switch C進行通信。

2. 組網圖

圖1-3 靜態路由與BFD聯動(直連)配置組網圖

設備

接口

IP地址

設備

接口

IP地址

Switch A

Vlan-int10

12.1.1.1/24

Switch B

Vlan-int10

12.1.1.2/24

 

Vlan-int11

10.1.1.102/24

 

Vlan-int13

13.1.1.1/24

Switch C

Vlan-int11

10.1.1.100/24

 

 

 

 

Vlan-int13

13.1.1.2/24

 

 

 

 

3. 配置步驟

(1)     配置各接口的IP地址(略)

(2)     配置靜態路由和BFD

# 在Switch A上配置靜態路由,並使能BFD檢測功能,使用雙向檢測方式。

<SwitchA> system-view

[SwitchA] interface vlan-interface 10

[SwitchA-vlan-interface10] bfd min-transmit-interval 500

[SwitchA-vlan-interface10] bfd min-receive-interval 500

[SwitchA-vlan-interface10] bfd detect-multiplier 9

[SwitchA-vlan-interface10] quit

[SwitchA] ip route-static 120.1.1.0 24 vlan-interface 10 12.1.1.2 bfd control-packet

[SwitchA] ip route-static 120.1.1.0 24 vlan-interface 11 10.1.1.100 preference 65

[SwitchA] quit

# 在Switch B上配置靜態路由,並使能BFD檢測功能,使用雙向檢測方式。

<SwitchB> system-view

[SwitchB] interface vlan-interface 10

[SwitchB-vlan-interface10] bfd min-transmit-interval 500

[SwitchB-vlan-interface10] bfd min-receive-interval 500

[SwitchB-vlan-interface10] bfd detect-multiplier 9

[SwitchB-vlan-interface10] quit

[SwitchB] ip route-static 121.1.1.0 24 vlan-interface 10 12.1.1.1 bfd control-packet

[SwitchB] ip route-static 121.1.1.0 24 vlan-interface 13 13.1.1.2 preference 65

[SwitchB] quit

(3)     檢查配置結果

下麵以Switch A為例,Switch B和Switch A類似,不再贅述。

# 查看BFD會話,可以看到BFD會話已經創建。

<SwitchA> display bfd session

 

 Total Session Num: 1            Init Mode: Active

 

 Session Working Under Ctrl Mode:

 

 LD/RD         SourceAddr      DestAddr        State Holdtime Interface

 4/7           12.1.1.1        12.1.1.2        Up    2000ms   Vlan10

# 查看靜態路由,可以看到Switch A經過L2 Switch到達Switch B。

<SwitchA> display ip routing-table protocol static

Public Routing Table : Static

Summary Count : 2

 

Static Routing table Status : <Active>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 60   0            12.1.1.2        Vlan10

 

Direct Routing table Status : <Inactive>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 65   0            10.1.1.100      Vlan11

# 打開BFD功能調試信息開關。

<SwitchA> debugging bfd event

<SwitchA> debugging bfd scm

<SwitchA> terminal debugging

# Switch A和二層交換機之間鏈路發生故障時,可以看到Switch A能夠快速感知Switch B的變化。

%Jul 27 10:18:18:672 2007 SwitchA BFD/4/LOG:Sess[12.1.1.1/12.1.1.2, Vlan10,Ctrl], Sta: UP->DOWN, Diag: 1

*Jul 27 10:18:18:672 2007 SwitchA BFD/7/EVENT:Send sess-down Msg, [Src:12.1.1.1,Dst:12.1.1.2, Vlan10,Ctrl], instance:0, protocol:STATIC

*Jul 27 10:18:19:172 2007 SwitchA BFD/7/EVENT:Receive Delete-sess, [Src:12.1.1.1,Dst:12.1.1.2, Vlan10,Ctrl], Direct, Instance:0x0, Proto:STATIC

*Jul 27 10:18:19:172 2007 SwitchA BFD/7/EVENT:Notify driver to stop receiving bf

# 查看靜態路由,可以看到Switch A經過Switch C到達Switch B。

<SwitchA> display ip routing-table protocol static

Public Routing Table : Static

Summary Count : 2

Static Routing table Status : <Active>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 65   0            10.1.1.100      Vlan11

Static Routing table Status : <Inactive>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 60   0            12.1.1.2        Vlan10

 

1.6.3  配置靜態路由與BFD聯動(非直連)

1. 組網需求

·     在Switch A上配置靜態路由可以到達120.1.1.0/24網段,在Switch B上配置靜態路由可以到達121.1.1.0/24網段,並都使能BFD檢測功能。

·     Switch A存在到Switch B的接口Loopback1(2.2.2.9/32)的路由,出接口為Vlan-interface10;Switch B存在到Switch A的接口Loopback1(1.1.1.9/32)的路由,出接口為Vlan-interface12;Switch D存在到1.1.1.9/32的路由,出接口為Vlan-interface10,存在到2.2.2.9/32的路由,出接口為Vlan-interface12。

·     當Switch A和Switch B通過Switch D通信的鏈路出現故障時,BFD能夠快速感知,並且切換到Switch C進行通信。

2. 組網圖

圖1-4 靜態路由與BFD聯動(非直連)配置組網圖

設備

接口

IP地址

設備

接口

IP地址

Switch A

Vlan-int10

12.1.1.1/24

Switch B

Vlan-int12

11.1.1.1/24

 

Vlan-int11

10.1.1.102/24

 

Vlan-int13

13.1.1.1/24

 

Loop1

1.1.1.9/32

 

Loop1

2.2.2.9/32

Switch C

Vlan-int11

10.1.1.100/24

Switch D

Vlan-int10

12.1.1.2/24

 

Vlan-int13

13.1.1.2/24

 

Vlan-int12

11.1.1.2/24

 

3. 配置步驟

(1)     配置各接口的IP地址(略)

(2)     配置靜態路由和BFD

# 在Switch A上配置靜態路由,並使能BFD檢測功能,使用雙向檢測方式。

<SwitchA> system-view

[SwitchA] interface loopback 1

[SwitchA-LoopBack1] bfd min-transmit-interval 500

[SwitchA-LoopBack1] bfd min-receive-interval 500

[SwitchA-LoopBack1] bfd detect-multiplier 9

[SwitchA-LoopBack1] quit

[SwitchA] ip route-static 120.1.1.0 24 2.2.2.9 bfd control-packet bfd-source 1.1.1.9

[SwitchA] ip route-static 120.1.1.0 24 vlan-interface 11 10.1.1.100 preference 65

[SwitchA] quit

# 在Switch B上配置靜態路由,並使能BFD檢測功能,使用雙向檢測方式。

<SwitchB> system-view

[SwitchB] interface loopback 1

[SwitchB-LoopBack1] bfd min-transmit-interval 500

[SwitchB-LoopBack1] bfd min-receive-interval 500

[SwitchB-LoopBack1] bfd detect-multiplier 9

[SwitchB-LoopBack1] quit

[SwitchB] ip route-static 121.1.1.0 24 1.1.1.9 bfd control-packet bfd-source 2.2.2.9

[SwitchB] ip route-static 121.1.1.0 24 vlan-interface 13 13.1.1.2 preference 65

[SwitchB] quit

(3)     檢查配置結果

下麵以Switch A為例,Switch B和Switch A類似,不再贅述。

# 查看BFD會話,可以看到BFD會話已經創建。

<SwitchA> display bfd session

 

Total session number: 1   Up session number: 0   Init mode: Active

 

 IPv4 session working under Ctrl mode:

 

 LD/RD         SourceAddr      DestAddr        State Holdtime Interface

 4/7           1.1.1.9         2.2.2.9         Up    2000ms   Loop1

# 查看靜態路由,可以看到Switch A經過Switch D到達Switch B。

<SwitchA> display ip routing-table protocol static

Public Routing Table : Static

Summary Count : 2

 

Static Routing table Status : <Active>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 60   0            2.2.2.9         Vlan10

 

Static Routing table Status : <Inactive>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 65   0            10.1.1.100      Vlan11

# 打開BFD功能調試信息開關。

<SwitchA> debugging bfd event

<SwitchA> debugging bfd scm

<SwitchA> terminal debugging

# Switch A和Switch D之間鏈路發生故障時,可以看到Switch A能夠快速感知Switch B的變化。

%Oct 10 10:18:18:672 2010 SwitchA BFD/4/LOG:Sess[1.1.1.9/2.2.2.9, Loop1,Ctrl], Sta: UP->DOWN, Diag: 1

* Oct 10 10:18:18:672 2010 SwitchA BFD/7/EVENT:Send sess-down Msg, [Src:1.1.1.9,Dst:2.2.2.9, Loop1,Ctrl], instance:0, protocol:STATIC

# 查看靜態路由,可以看到Switch A經過Switch C到達Switch B。

<SwitchA> display ip routing-table protocol static

Public Routing Table : Static

Summary Count : 2

Static Routing table Status : <Active>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 65   0            10.1.1.100      Vlan11

Static Routing table Status : <Inactive>

Summary Count : 1

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

120.1.1.0/24        Static 60   0            2.2.2.9

1.6.4  靜態路由快速重路由配置舉例

1. 組網需求

圖1-5所示,Switch S、Switch A和Switch D通過靜態路由實現網絡互連。要求當Switch S和Switch D之間的鏈路A出現故障時,業務可以快速切換到鏈路B上。

2. 組網圖

圖1-5 靜態路由快速重路由配置舉例

3. 配置步驟

(1)     配置各接口的IP地址(略)

(2)     配置靜態路由

在Switch S、Switch A和Switch D上配置靜態路由使報文可以通過Switch S到達Switch D的Loopback0口,通過Switch D到達Switch S的Loopback0口。

# 在Switch S上配置靜態路由。

<SwitchS> system-view

[SwitchS] ip route-static 4.4.4.4 32 vlan-interface 200 13.13.13.2

# 在Switch D上配置靜態路由。

<SwitchD> system-view

[SwitchD] ip route-static 1.1.1.1 32 vlan-interface 200 13.13.13.1

# 在Switch A上配置靜態路由。

<SwitchA> system-view

[SwitchA] ip route-static 4.4.4.4 32 vlan-interface 101 24.24.24.4

[SwitchA] ip route-static 1.1.1.1 32 vlan-interface 100 12.12.12.1

(3)     配置靜態路由快速重路由

# 配置Switch S。為通過路由策略frr的靜態路由指定備份下一跳信息。

[SwitchS] bfd echo-source-ip 1.1.1.1

[SwitchS] ip ip-prefix abc index 10 permit 4.4.4.4 32

[SwitchS] route-policy frr permit node 10

[SwitchS-route-policy] if-match ip-prefix abc

[SwitchS-route-policy] apply fast-reroute backup-interface vlan-interface 100 backup-nexthop 12.12.12.2

[SwitchS-route-policy] quit

[SwitchS] ip route-static fast-reroute route-policy frr

# 配置Switch D。為通過路由策略frr的靜態路由指定備份下一跳信息。

[SwitchD] bfd echo-source-ip 4.4.4.4

[SwitchD] ip ip-prefix abc index 10 permit 1.1.1.1 32

[SwitchD] route-policy frr permit node 10

[SwitchD-route-policy] if-match ip-prefix abc

[SwitchD-route-policy] apply fast-reroute backup-interface vlan-interface 101 backup-nexthop 24.24.24.2

[SwitchD-route-policy] quit

[SwitchD] ip route-static fast-reroute route-policy frr

(4)     檢驗配置效果

# 在Switch S上查看4.4.4.4/32路由,可以看到備份下一跳信息。

[SwitchS] display ip routing-table 4.4.4.4 verbose

Routing Table : Public

Summary Count : 2

  Destination: 4.4.4.4/32

     Protocol: Static          Process ID: 0

   Preference: 60                    Cost: 0

 IpPrecedence:                    QosLcID:

      NextHop: 13.13.13.2       Interface: vlan 200

    BkNextHop: 12.12.12.2     BkInterface: vlan 100

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

  BKTunnel ID: 0x0                BKLabel: NULL

        State: Active Adv             Age: 00h01m27s

          Tag: 0

# 在Switch D上查看1.1.1.1/32路由,可以看到備份下一跳信息。

[SwitchD] display ip routing-table 1.1.1.1 verbose

Routing Table : Public

Summary Count : 2

  Destination: 1.1.1.1/32

     Protocol: Static          Process ID: 0

   Preference: 60                    Cost: 0

 IpPrecedence:                    QosLcID:

      NextHop: 13.13.13.1       Interface: vlan 200

    BkNextHop: 24.24.24.2     BkInterface: vlan 101

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

  BKTunnel ID: 0x0                BKLabel: NULL

        State: Active Adv             Age: 00h01m27s

          Tag: 0


2 缺省路由

2.1  缺省路由簡介

缺省路由是在路由器沒有找到匹配的路由表項時使用的路由。

如果報文的目的地不在路由表中且沒有配置缺省路由,那麼該報文將被丟棄,將向源端返回一個ICMP報文報告該目的地址或網絡不可達。

缺省路由有兩種生成方式:

·     第一種是網絡管理員手工配置。配置請參見表1-1,將目的地址與掩碼配置為全零(0.0.0.0 0.0.0.0)。

·     第二種是動態路由協議生成(如OSPF、IS-IS和RIP),由路由能力比較強的路由器將缺省路由發布給其它路由器,其它路由器在自己的路由表裏生成指向那台路由器的缺省路由。配置請參見各個路由協議手冊。

 

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們