• 全部
  • 經驗案例
  • 典型配置
  • 技術公告
  • FAQ
  • 漏洞說明
  • 全部
  • 全部
  • 大數據引擎
  • 知了引擎
產品線
搜索
取消
案例類型
發布者
是否解決
是否官方
時間
搜索引擎
匹配模式
高級搜索

銳捷設備配置翻譯mpls ldp

2024-01-19提問
  • 0關注
  • 0收藏,2166瀏覽
粉絲:0人 關注:0人

問題描述:

mpls router ldp

 ldp router-id interface Loopback 0 force

 advertise-labels for host-routes

請問advertise-labels for host-routes這個命令翻譯為h3c是哪個

3 個回答
已采納
粉絲:26人 關注:1人

缺省就是host,無需翻譯。

暫無評論

粉絲:20人 關注:9人

您好,請知:

以下是配置案例,請參考:

1.25  LDP支持IPv4配置舉例

1.25.1  利用LDP動態建立LSP配置舉例

1. 組網需求

·     Switch A、Switch B和Switch C均支持MPLS。

·     在Switch A和Switch C之間使用LDP動態建立LSP,使11.1.1.0/24和21.1.1.0/24這兩個網段中互訪的報文能夠通過MPLS進行傳輸。

·     Switch A、Switch B和Switch C上隻允許目的地址為1.1.1.9/32、2.2.2.9/32、3.3.3.9/32、11.1.1.0/24和21.1.1.0/24的路由表項觸發LDP建立LSP,其他路由表項不能觸發LDP建立LSP,以避免建立的LSP數量過多,影響設備性能。

圖1-11 利用LDP動態建立LSP配置組網圖

 

2. 配置思路

·     LDP根據路由信息動態分配標簽,因此,利用LDP動態建立LSP時,需要配置路由協議,使得各交換機之間路由可達。本例中,采用的路由協議為OSPF。

·     在各台路由器上啟動LDP協議。

·     為了控製建立的LSP數量,在Switch A、Switch B和Switch C上需要配置LSP觸發策略。

3. 配置步驟

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

按照圖1-11配置各接口IP地址和掩碼,包括VLAN接口和Loopback接口,具體配置過程略。

(2)     配置OSPF,以保證各交換機之間路由可達

# 配置Switch A。

<SwitchA> system-view

[SwitchA] ospf

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0

[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] quit

[SwitchA-ospf-1] quit

# 配置Switch B。

<SwitchB> system-view

[SwitchB] ospf

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0

[SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] quit

[SwitchB-ospf-1] quit

# 配置Switch C。

<SwitchC> system-view

[SwitchC] ospf

[SwitchC-ospf-1] area 0

[SwitchC-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0

[SwitchC-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] network 21.1.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] quit

[SwitchC-ospf-1] quit

# 配置完成後,在各交換機上執行display ip routing-table命令,可以看到相互之間都學到了到對方的主機路由。以Switch A為例:

[SwitchA] display ip routing-table

 

Destinations : 21        Routes : 21

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

1.1.1.9/32         Direct  0   0           127.0.0.1       InLoop0

2.2.2.9/32         O_INTRA 10  1           10.1.1.2        Vlan2

3.3.3.9/32         O_INTRA 10  2           10.1.1.2        Vlan2

10.1.1.0/24        Direct  0   0           10.1.1.1        Vlan2

10.1.1.0/32        Direct  0   0           10.1.1.1        Vlan2

10.1.1.1/32        Direct  0   0           127.0.0.1       InLoop0

10.1.1.255/32      Direct  0   0           10.1.1.1        Vlan2

11.1.1.0/24        Direct  0   0           11.1.1.1        Vlan4

11.1.1.0/32        Direct  0   0           11.1.1.1        Vlan4

11.1.1.1/32        Direct  0   0           127.0.0.1       InLoop0

11.1.1.255/32      Direct  0   0           11.1.1.1        Vlan4

20.1.1.0/24        O_INTRA 10  2           10.1.1.2        Vlan2

21.1.1.0/24        O_INTRA 10  3           10.1.1.2        Vlan2

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

(3)     使能MPLS和LDP功能

# 配置Switch A。

[SwitchA] mpls lsr-id 1.1.1.9

[SwitchA] mpls ldp

[SwitchA-ldp] quit

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] mpls enable

[SwitchA-Vlan-interface2] mpls ldp enable

[SwitchA-Vlan-interface2] quit

# 配置Switch B。

[SwitchB] mpls lsr-id 2.2.2.9

[SwitchB] mpls ldp

[SwitchB-ldp] quit

[SwitchB] interface vlan-interface 2

[SwitchB-Vlan-interface2] mpls enable

[SwitchB-Vlan-interface2] mpls ldp enable

[SwitchB-Vlan-interface2] quit

[SwitchB] interface vlan-interface 3

[SwitchB-Vlan-interface3] mpls enable

[SwitchB-Vlan-interface3] mpls ldp enable

[SwitchB-Vlan-interface3] quit

# 配置Switch C。

[SwitchC] mpls lsr-id 3.3.3.9

[SwitchC] mpls ldp

[SwitchC-ldp] quit

[SwitchC] interface vlan-interface 3

[SwitchC-Vlan-interface3] mpls enable

[SwitchC-Vlan-interface3] mpls ldp enable

[SwitchC-Vlan-interface3] quit

(4)     配置LSP觸發策略

# 在Switch A上創建IP地址前綴列表switcha,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchA] ip prefix-list switcha index 10 permit 1.1.1.9 32

[SwitchA] ip prefix-list switcha index 20 permit 2.2.2.9 32

[SwitchA] ip prefix-list switcha index 30 permit 3.3.3.9 32

[SwitchA] ip prefix-list switcha index 40 permit 11.1.1.0 24

[SwitchA] ip prefix-list switcha index 50 permit 21.1.1.0 24

[SwitchA] mpls ldp

[SwitchA-ldp] lsp-trigger prefix-list switcha

[SwitchA-ldp] quit

# 在Switch B上創建IP地址前綴列表switchb,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchB] ip prefix-list switchb index 10 permit 1.1.1.9 32

[SwitchB] ip prefix-list switchb index 20 permit 2.2.2.9 32

[SwitchB] ip prefix-list switchb index 30 permit 3.3.3.9 32

[SwitchB] ip prefix-list switchb index 40 permit 11.1.1.0 24

[SwitchB] ip prefix-list switchb index 50 permit 21.1.1.0 24

[SwitchB] mpls ldp

[SwitchB-ldp] lsp-trigger prefix-list switchb

[SwitchB-ldp] quit

# 在Switch C上創建IP地址前綴列表switchc,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchC] ip prefix-list switchc index 10 permit 1.1.1.9 32

[SwitchC] ip prefix-list switchc index 20 permit 2.2.2.9 32

[SwitchC] ip prefix-list switchc index 30 permit 3.3.3.9 32

[SwitchC] ip prefix-list switchc index 40 permit 11.1.1.0 24

[SwitchC] ip prefix-list switchc index 50 permit 21.1.1.0 24

[SwitchC] mpls ldp

[SwitchC-ldp] lsp-trigger prefix-list switchc

[SwitchC-ldp] quit

4. 驗證配置

# 配置完成後,在各交換機上執行display mpls ldp lsp命令,可以看到LDP LSP的建立情況。以Switch A為例:

[SwitchA] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable

FECs: 5            Ingress: 3          Transit: 3      Egress: 2

 

FEC                In/Out Label        Nexthop         OutInterface/LSINDEX

1.1.1.9/32         3/-

                   -/1279(L)

2.2.2.9/32         -/3                 10.1.1.2        Vlan2

                   1279/3              10.1.1.2        Vlan2

3.3.3.9/32         -/1278              10.1.1.2        Vlan2

                   1278/1278           10.1.1.2        Vlan2

11.1.1.0/24        1277/-

                   -/1277(L)

21.1.1.0/24        -/1276              10.1.1.2        Vlan2

                   1276/1276           10.1.1.2        Vlan2

# 在Switch A上檢測Switch A到Switch C的LDP LSP的可達性。

[SwitchA] ping mpls -a 11.1.1.1 ipv4 21.1.1.0 24

MPLS ping FEC: 21.1.1.0/24 with 100 bytes of data:

100 bytes from 20.1.1.2: Sequence=1 time=1 ms

100 bytes from 20.1.1.2: Sequence=2 time=1 ms

100 bytes from 20.1.1.2: Sequence=3 time=8 ms

100 bytes from 20.1.1.2: Sequence=4 time=2 ms

100 bytes from 20.1.1.2: Sequence=5 time=1 ms

 

--- Ping statistics for FEC 21.1.1.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 1/2/8 ms

# 在Switch C上檢測Switch C到Switch A的LDP LSP的可達性。

[SwitchC] ping mpls -a 21.1.1.1 ipv4 11.1.1.0 24

MPLS ping FEC: 11.1.1.0/24  with 100 bytes of data:

100 bytes from 10.1.1.1: Sequence=1 time=1 ms

100 bytes from 10.1.1.1: Sequence=2 time=1 ms

100 bytes from 10.1.1.1: Sequence=3 time=1 ms

100 bytes from 10.1.1.1: Sequence=4 time=1 ms

100 bytes from 10.1.1.1: Sequence=5 time=1 ms

 

--- Ping statistics for FEC 11.1.1.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 1/1/1 ms

1.25.2  標簽接受控製策略配置舉例

1. 組網需求

11.1.1.0/24和21.1.1.0/24網段之間存在兩條路徑:Switch A—Switch B—Switch C和Switch A—Switch D—Switch C。通過配置標簽接受控製策略,實現隻沿著路徑Switch A—Switch B—Switch C建立LSP,11.1.1.0/24和21.1.1.0/24網段之間互訪的報文通過該LSP進行MPLS轉發。

圖1-12 標簽接受控製策略配置組網圖

 

2. 配置思路

(1)     在各台交換機上配置路由協議,使得各交換機之間路由可達。本例中,采用的路由協議為OSPF。

(2)     在各台交換機上啟動LDP協議。

(3)     在各台交換機上配置LSP觸發策略,使得目的地址為11.1.1.0/24和21.1.1.0/24的路由表項能夠觸發LDP建立LSP。

(4)     配置標簽接受控製策略,使得LDP僅沿著路徑Switch A—Switch B—Switch C建立LSP。具體配置方法為:

·     Switch A隻接受Switch B通告的FEC目的地址為21.1.1.0/24的FEC—標簽映射;Switch A拒絕Switch D通告的FEC目的地址為21.1.1.0/24的FEC—標簽映射。

·     Switch C隻接受Switch B通告的FEC目的地址為11.1.1.0/24的FEC—標簽映射;Switch C拒絕Switch D通告的FEC目的地址為11.1.1.0/24的FEC—標簽映射。

3. 配置步驟

說明

進行下麵配置之前,需要先全局關閉STP功能,或為每個VLAN映射一個MSTP實例,具體配置方法請參見“二層技術-以太網交換配置指導”中的“生成樹”。

 

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

按照圖1-12配置各接口IP地址和掩碼,包括Loopback接口,具體配置過程略。

(2)     配置OSPF

在各台交換機上配置OSPF,以保證各交換機之間路由可達,具體配置過程略。

(3)     使能MPLS和LDP功能

# 配置Switch A。

<SwitchA> system-view

[SwitchA] mpls lsr-id 1.1.1.9

[SwitchA] mpls ldp

[SwitchA-ldp] quit

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] mpls enable

[SwitchA-Vlan-interface2] mpls ldp enable

[SwitchA-Vlan-interface2] quit

[SwitchA] interface vlan-interface 6

[SwitchA-Vlan-interface6] mpls enable

[SwitchA-Vlan-interface6] mpls ldp enable

[SwitchA-Vlan-interface6] quit

# 配置Switch B。

<SwitchB> system-view

[SwitchB] mpls lsr-id 2.2.2.9

[SwitchB] mpls ldp

[SwitchB-ldp] quit

[SwitchB] interface vlan-interface 2

[SwitchB-Vlan-interface2] mpls enable

[SwitchB-Vlan-interface2] mpls ldp enable

[SwitchB-Vlan-interface2] quit

[SwitchB] interface vlan-interface 3

[SwitchB-Vlan-interface3] mpls enable

[SwitchB-Vlan-interface3] mpls ldp enable

[SwitchB-Vlan-interface3] quit

# 配置Switch C。

<SwitchC> system-view

[SwitchC] mpls lsr-id 3.3.3.9

[SwitchC] mpls ldp

[SwitchC-ldp] quit

[SwitchC] interface vlan-interface 3

[SwitchC-Vlan-interface3] mpls enable

[SwitchC-Vlan-interface3] mpls ldp enable

[SwitchC-Vlan-interface3] quit

[SwitchC] interface vlan-interface 7

[SwitchC-Vlan-interface7] mpls enable

[SwitchC-Vlan-interface7] mpls ldp enable

[SwitchC-Vlan-interface7] quit

# 配置Switch D。

<SwitchD> system-view

[SwitchD] mpls lsr-id 4.4.4.9

[SwitchD] mpls ldp

[SwitchD-ldp] quit

[SwitchD] interface vlan-interface 6

[SwitchD-Vlan-interface6] mpls enable

[SwitchD-Vlan-interface6] mpls ldp enable

[SwitchD-Vlan-interface6] quit

[SwitchD] interface vlan-interface 7

[SwitchD-Vlan-interface7] mpls enable

[SwitchD-Vlan-interface7] mpls ldp enable

[SwitchD-Vlan-interface7] quit

(4)     配置LSP觸發策略

# 在Switch A上創建IP地址前綴列表switcha,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchA] ip prefix-list switcha index 10 permit 11.1.1.0 24

[SwitchA] ip prefix-list switcha index 20 permit 21.1.1.0 24

[SwitchA] mpls ldp

[SwitchA-ldp] lsp-trigger prefix-list switcha

[SwitchA-ldp] quit

# 在Switch B上創建IP地址前綴列表switchb,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchB] ip prefix-list switchb index 10 permit 11.1.1.0 24

[SwitchB] ip prefix-list switchb index 20 permit 21.1.1.0 24

[SwitchB] mpls ldp

[SwitchB-ldp] lsp-trigger prefix-list switchb

[SwitchB-ldp] quit

# 在Switch C上創建IP地址前綴列表switchc,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchC] ip prefix-list switchc index 10 permit 11.1.1.0 24

[SwitchC] ip prefix-list switchc index 20 permit 21.1.1.0 24

[SwitchC] mpls ldp

[SwitchC-ldp] lsp-trigger prefix-list switchc

[SwitchC-ldp] quit

# 在Switch D上創建IP地址前綴列表switchd,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchD] ip prefix-list switchd index 10 permit 11.1.1.0 24

[SwitchD] ip prefix-list switchd index 20 permit 21.1.1.0 24

[SwitchD] mpls ldp

[SwitchD-ldp] lsp-trigger prefix-list switchd

[SwitchD-ldp] quit

(5)     配置標簽接受控製策略

# 在Switch A上創建允許21.1.1.0/24通過的IP地址前綴列表prefix-from-b,該列表用來過濾Switch B通告給Switch A的FEC—標簽映射。

[SwitchA] ip prefix-list prefix-from-b index 10 permit 21.1.1.0 24

# 在Switch A上創建拒絕21.1.1.0/24通過的IP地址前綴列表prefix-from-d,該列表用來過濾Switch D通告給Switch A的FEC—標簽映射。

[SwitchA] ip prefix-list prefix-from-d index 10 deny 21.1.1.0 24

# 在Switch A上配置過濾Switch B和Switch D通告的FEC—標簽映射的標簽接受控製策略。

[SwitchA] mpls ldp

[SwitchA-ldp] accept-label peer 2.2.2.9 prefix-list prefix-from-b

[SwitchA-ldp] accept-label peer 4.4.4.9 prefix-list prefix-from-d

[SwitchA-ldp] quit

# 在Switch C上創建允許11.1.1.0/24通過的IP地址前綴列表prefix-from-b,該列表用來過濾Switch B通告給Switch C的FEC—標簽映射。

[SwitchC] ip prefix-list prefix-from-b index 10 permit 11.1.1.0 24

# 在Switch C上創建拒絕11.1.1.0/24通過的IP地址前綴列表prefix-from-d,該列表用來過濾Switch D通告給Switch C的FEC—標簽映射。

[SwitchC] ip prefix-list prefix-from-d index 10 deny 11.1.1.0 24

# 在Switch C上配置過濾Switch B和Switch D通告的FEC—標簽映射的標簽接受控製策略。

[SwitchC] mpls ldp

[SwitchC-ldp] accept-label peer 2.2.2.9 prefix-list prefix-from-b

[SwitchC-ldp] accept-label peer 4.4.4.9 prefix-list prefix-from-d

[SwitchC-ldp] quit

4. 驗證配置

# 配置完成後,在各設備上執行display mpls ldp lsp命令,可以看到LDP LSP的建立情況。以Switch A為例,在Switch A上FEC目的地址為21.1.1.0/24的LSP的下一跳為Switch B(地址為10.1.1.2),即隻沿著路徑Switch A—Switch B—Switch C建立了LSP,路徑Switch A—Switch D—Switch C上未建立LSP。

[SwitchA] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable

FECs: 2            Ingress: 1          Transit: 1      Egress: 1

 

FEC                In/Out Label        Nexthop         OutInterface/LSINDEX

11.1.1.0/24        1277/-

                   -/1148(L)

21.1.1.0/24        -/1149(L)

                   -/1276              10.1.1.2        Vlan2

                   1276/1276           10.1.1.2        Vlan2

# 在Switch A上檢測Switch A到Switch C的LDP LSP的可達性。

[SwitchA] ping mpls -a 11.1.1.1 ipv4 21.1.1.0 24

MPLS ping FEC: 21.1.1.0/24 with 100 bytes of data:

100 bytes from 20.1.1.2: Sequence=1 time=1 ms

100 bytes from 20.1.1.2: Sequence=2 time=1 ms

100 bytes from 20.1.1.2: Sequence=3 time=8 ms

100 bytes from 20.1.1.2: Sequence=4 time=2 ms

100 bytes from 20.1.1.2: Sequence=5 time=1 ms

 

--- Ping statistics for FEC 21.1.1.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 1/2/8 ms

# 在Switch C上檢測Switch C到Switch A的LDP LSP的可達性。

[SwitchC] ping mpls -a 21.1.1.1 ipv4 11.1.1.0 24

MPLS ping FEC: 11.1.1.0/24 with 100 bytes of data:

100 bytes from 10.1.1.1: Sequence=1 time=1 ms

100 bytes from 10.1.1.1: Sequence=2 time=1 ms

100 bytes from 10.1.1.1: Sequence=3 time=1 ms

100 bytes from 10.1.1.1: Sequence=4 time=1 ms

100 bytes from 10.1.1.1: Sequence=5 time=1 ms

 

--- Ping statistics for FEC 11.1.1.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 1/1/1 ms

1.25.3  標簽通告控製策略配置舉例

1. 組網需求

11.1.1.0/24和21.1.1.0/24網段之間存在兩條路徑:Switch A—Switch B—Switch C和Switch A—Switch D—Switch C。通過配置標簽通告控製策略,實現隻沿著路徑Switch A—Switch B—Switch C建立LSP,11.1.1.0/24和21.1.1.0/24網段之間互訪的報文通過該LSP進行MPLS轉發。

圖1-13 標簽通告控製策略配置組網圖

 

2. 配置思路

(1)     在各台交換機上配置路由協議,使得各交換機之間路由可達。本例中,采用的路由協議為OSPF。

(2)     在各台交換機上啟動LDP協議。

(3)     在各台交換機上配置LSP觸發策略,使得目的地址為11.1.1.0/24和21.1.1.0/24的路由表項能夠觸發LDP建立LSP。

(4)     配置標簽通告控製策略,使得LDP僅沿著路徑Switch A—Switch B—Switch C建立LSP。具體配置方法為:

·     Switch A隻將FEC目的地址為11.1.1.0/24的FEC—標簽映射通告給Switch B;Switch A不通告任何其他的FEC—標簽映射。

·     Switch C隻將FEC目的地址為21.1.1.0/24的FEC—標簽映射通告給Switch B;Switch C不通告任何其他的FEC—標簽映射。

·     Switch D不將FEC目的地址為21.1.1.0/24的FEC—標簽映射通告給Switch A;Switch D不將FEC目的地址為11.1.1.0/24的FEC—標簽映射通告給Switch C。

3. 配置步驟

說明

進行下麵配置之前,需要先全局關閉STP功能,或為每個VLAN映射一個MSTP實例,具體配置方法請參見“二層技術-以太網交換配置指導”中的“生成樹”。

 

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

按照圖1-13配置各接口IP地址和掩碼,包括Loopback接口,具體配置過程略。

(2)     配置OSPF

在各台交換機上配置OSPF,以保證各交換機之間路由可達,具體配置過程略。

(3)     使能MPLS和LDP功能

# 配置Switch A。

<SwitchA> system-view

[SwitchA] mpls lsr-id 1.1.1.9

[SwitchA] mpls ldp

[SwitchA-ldp] quit

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] mpls enable

[SwitchA-Vlan-interface2] mpls ldp enable

[SwitchA-Vlan-interface2] quit

[SwitchA] interface vlan-interface 6

[SwitchA-Vlan-interface6] mpls enable

[SwitchA-Vlan-interface6] mpls ldp enable

[SwitchA-Vlan-interface6] quit

# 配置Switch B。

<SwitchB> system-view

[SwitchB] mpls lsr-id 2.2.2.9

[SwitchB] mpls ldp

[SwitchB-ldp] quit

[SwitchB] interface vlan-interface 2

[SwitchB-Vlan-interface2] mpls enable

[SwitchB-Vlan-interface2] mpls ldp enable

[SwitchB-Vlan-interface2] quit

[SwitchB] interface vlan-interface 3

[SwitchB-Vlan-interface3] mpls enable

[SwitchB-Vlan-interface3] mpls ldp enable

[SwitchB-Vlan-interface3] quit

# 配置Switch C。

<SwitchC> system-view

[SwitchC] mpls lsr-id 3.3.3.9

[SwitchC] mpls ldp

[SwitchC-ldp] quit

[SwitchC] interface vlan-interface 3

[SwitchC-Vlan-interface3] mpls enable

[SwitchC-Vlan-interface3] mpls ldp enable

[SwitchC-Vlan-interface3] quit

[SwitchC] interface vlan-interface 7

[SwitchC-Vlan-interface7] mpls enable

[SwitchC-Vlan-interface7] mpls ldp enable

[SwitchC-Vlan-interface7] quit

# 配置Switch D。

<SwitchD> system-view

[SwitchD] mpls lsr-id 4.4.4.9

[SwitchD] mpls ldp

[SwitchD-ldp] quit

[SwitchD] interface vlan-interface 6

[SwitchD-Vlan-interface6] mpls enable

[SwitchD-Vlan-interface6] mpls ldp enable

[SwitchD-Vlan-interface6] quit

[SwitchD] interface vlan-interface 7

[SwitchD-Vlan-interface7] mpls enable

[SwitchD-Vlan-interface7] mpls ldp enable

[SwitchD-Vlan-interface7] quit

(4)     配置LSP觸發策略

# 在Switch A上創建IP地址前綴列表switcha,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchA] ip prefix-list switcha index 10 permit 11.1.1.0 24

[SwitchA] ip prefix-list switcha index 20 permit 21.1.1.0 24

[SwitchA] mpls ldp

[SwitchA-ldp] lsp-trigger prefix-list switcha

[SwitchA-ldp] quit

# 在Switch B上創建IP地址前綴列表switchb,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchB] ip prefix-list switchb index 10 permit 11.1.1.0 24

[SwitchB] ip prefix-list switchb index 20 permit 21.1.1.0 24

[SwitchB] mpls ldp

[SwitchB-ldp] lsp-trigger prefix-list switchb

[SwitchB-ldp] quit

# 在Switch C上創建IP地址前綴列表switchc,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchC] ip prefix-list switchc index 10 permit 11.1.1.0 24

[SwitchC] ip prefix-list switchc index 20 permit 21.1.1.0 24

[SwitchC] mpls ldp

[SwitchC-ldp] lsp-trigger prefix-list switchc

[SwitchC-ldp] quit

# 在Switch D上創建IP地址前綴列表switchd,並配置隻有通過該列表過濾的路由表項能夠觸發LDP建立LSP。

[SwitchD] ip prefix-list switchd index 10 permit 11.1.1.0 24

[SwitchD] ip prefix-list switchd index 20 permit 21.1.1.0 24

[SwitchD] mpls ldp

[SwitchD-ldp] lsp-trigger prefix-list switchd

[SwitchD-ldp] quit

(5)     配置標簽通告控製策略

# 在Switch A上創建允許11.1.1.0/24通過的IP地址前綴列表prefix-to-b,該列表用來過濾通告給Switch B的FEC—標簽映射。

[SwitchA] ip prefix-list prefix-to-b index 10 permit 11.1.1.0 24

# 在Switch A上創建允許2.2.2.9/32通過的IP地址前綴列表peer-b,該列表用來過濾LDP對等體。

[SwitchA] ip prefix-list peer-b index 10 permit 2.2.2.9 32

# 在Switch A上配置標簽通告控製策略:隻將FEC目的地址為11.1.1.0/24的FEC—標簽映射通告給Switch B。

[SwitchA] mpls ldp

[SwitchA-ldp] advertise-label prefix-list prefix-to-b peer peer-b

[SwitchA-ldp] quit

# 在Switch C上創建允許21.1.1.0/24通過的IP地址前綴列表prefix-to-b,該列表用來過濾通告給Switch B的FEC—標簽映射。

[SwitchC] ip prefix-list prefix-to-b index 10 permit 21.1.1.0 24

# 在Switch C上創建允許2.2.2.9/32通過的IP地址前綴列表peer-b,該列表用來過濾LDP對等體。

[SwitchC] ip prefix-list peer-b index 10 permit 2.2.2.9 32

# 在Switch C上配置標簽通告控製策略:隻將FEC目的地址為21.1.1.0/24的FEC—標簽映射通告給Switch B。

[SwitchC] mpls ldp

[SwitchC-ldp] advertise-label prefix-list prefix-to-b peer peer-b

[SwitchC-ldp] quit

# 在Switch D上創建拒絕21.1.1.0/24通過的IP地址前綴列表prefix-to-a,該列表用來過濾通告給Switch A的FEC—標簽映射。

[SwitchD] ip prefix-list prefix-to-a index 10 deny 21.1.1.0 24

[SwitchD] ip prefix-list prefix-to-a index 20 permit 0.0.0.0 0 less-equal 32

# 在Switch D上創建允許1.1.1.9/32通過的IP地址前綴列表peer-a,該列表用來過濾LDP對等體。

[SwitchD] ip prefix-list peer-a index 10 permit 1.1.1.9 32

# 在Switch D上創建拒絕11.1.1.0/24通過的IP地址前綴列表prefix-to-c,該列表用來過濾通告給Switch C的FEC—標簽映射。

[SwitchD] ip prefix-list prefix-to-c index 10 deny 11.1.1.0 24

[SwitchD] ip prefix-list prefix-to-c index 20 permit 0.0.0.0 0 less-equal 32

# 在Switch D上創建允許3.3.3.9/32通過的IP地址前綴列表peer-c,該列表用來過濾LDP對等體。

[SwitchD] ip prefix-list peer-c index 10 permit 3.3.3.9 32

# 在Switch D上配置標簽通告控製策略:不將FEC目的地址為21.1.1.0/24的FEC—標簽映射通告給Switch A;不將FEC目的地址為11.1.1.0/24的FEC—標簽映射通告給Switch C。

[SwitchD] mpls ldp

[SwitchD-ldp] advertise-label prefix-list prefix-to-a peer peer-a

[SwitchD-ldp] advertise-label prefix-list prefix-to-c peer peer-c

[SwitchD-ldp] quit

4. 驗證配置

# 配置完成後,在各設備上執行display mpls ldp lsp命令,可以看到LDP LSP的建立情況。Switch A和Switch C隻接收到Switch B通告的FEC—標簽映射;Switch B接收到了Switch A和Switch C通告的FEC—標簽映射; Switch D沒有接收到Switch A和Switch C通告的FEC—標簽映射;即隻沿著路徑Switch A—Switch B—Switch C建立了LSP。

[SwitchA] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable

FECs: 2            Ingress: 1          Transit: 1      Egress: 1

 

FEC                In/Out Label        Nexthop         OutInterface/LSINDEX

11.1.1.0/24        1277/-

                   -/1151(L)

                   -/1277(L)

21.1.1.0/24        -/1276              10.1.1.2        Vlan2

                   1276/1276           10.1.1.2        Vlan2

[SwitchB] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable

FECs: 2            Ingress: 2          Transit: 2      Egress: 0

 

FEC                In/Out Label        Nexthop         OutInterface/LSINDEX

11.1.1.0/24        -/1277              10.1.1.1        Vlan2

                   1277/1277           10.1.1.1        Vlan2

21.1.1.0/24        -/1149              20.1.1.2        Vlan3

                   1276/1149           20.1.1.2        Vlan3

[SwitchC] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable

FECs: 2            Ingress: 1          Transit: 1      Egress: 1

 

FEC                In/Out Label        Nexthop         OutInterface/LSINDEX

11.1.1.0/24        -/1277              20.1.1.1        Vlan3

                   1148/1277           20.1.1.1        Vlan3

21.1.1.0/24        1149/-

                   -/1276(L)

                   -/1150(L)

[SwitchD] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable

FECs: 2            Ingress: 0          Transit: 0      Egress: 2

 

FEC                In/Out Label        Nexthop         OutInterface/LSINDEX

11.1.1.0/24        1151/-

                   -/1277(L)

21.1.1.0/24        1150/-

# 在Switch A上檢測Switch A到Switch C的LDP LSP的可達性。

[SwitchA] ping mpls -a 11.1.1.1 ipv4 21.1.1.0 24

MPLS ping FEC: 21.1.1.0/24 with 100 bytes of data:

100 bytes from 20.1.1.2: Sequence=1 time=1 ms

100 bytes from 20.1.1.2: Sequence=2 time=1 ms

100 bytes from 20.1.1.2: Sequence=3 time=8 ms

100 bytes from 20.1.1.2: Sequence=4 time=2 ms

100 bytes from 20.1.1.2: Sequence=5 time=1 ms

 

--- Ping statistics for FEC 21.1.1.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 1/2/8 ms

# 在Switch C上檢測Switch C到Switch A的LDP LSP的可達性。

[SwitchC] ping mpls -a 21.1.1.1 ipv4 11.1.1.0 24

MPLS ping FEC: 11.1.1.0/24 with 100 bytes of data:

100 bytes from 10.1.1.1: Sequence=1 time=1 ms

100 bytes from 10.1.1.1: Sequence=2 time=1 ms

100 bytes from 10.1.1.1: Sequence=3 time=1 ms

100 bytes from 10.1.1.1: Sequence=4 time=1 ms

100 bytes from 10.1.1.1: Sequence=5 time=1 ms

 

--- Ping statistics for FEC 11.1.1.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 1/1/1 ms

1.25.4  LDP快速重路由配置舉例

1. 組網需求

Switch S、Switch A和Switch D屬於同一OSPF區域,通過OSPF協議實現網絡互連。在Switch S—Switch D、Switch S—Switch A—Switch D兩條路徑上利用LDP分別建立主LSP和備份LSP,實現:

·     當Switch S—Switch D這條LSP正常工作時,11.1.1.0/24和21.1.1.0/24兩個網段之間的流量通過該LSP傳輸。

·     當Switch S—Switch D這條LSP出現故障時,11.1.1.0/24和21.1.1.0/24兩個網段之間的流量快速切換到Switch S—Switch A—Switch D這條備份LSP上傳輸。

圖1-14 LDP快速重路由配置組網圖

 

2. 配置思路

·     在各台交換機上配置路由協議,使得各交換機之間路由可達。本例中,采用的路由協議為OSPF。

·     在各台交換機上啟動LDP協議。

·     在各台交換機上配置LSP觸發策略,使得目的地址為11.1.1.0/24和21.1.1.0/24的路由表項能夠觸發LDP建立LSP。

·     為了觸發建立備份LSP,在Switch S和Switch D上需要配置OSPF快速重路由。

3. 配置步驟

說明

進行下麵配置之前,需要先全局關閉STP功能,或為每個VLAN映射一個MSTP實例,具體配置方法請參見“二層技術-以太網交換配置指導”中的“生成樹”。

 

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

按照圖1-14配置各接口IP地址和掩碼,包括Loopback接口,具體配置過程略。

(2)     配置OSPF

在各台交換機上配置OSPF,以保證各交換機之間路由可達,具體配置過程略。

(3)     配置OSPF快速重路由

OSPF快速重路由有兩種配置方法,可以任選一種。

方法一:使能Switch S和Switch D的OSPF快速重路由功能(通過LFA算法選取備份下一跳信息)

# 配置Switch S。

<SwitchS> system-view

[SwitchS] bfd echo-source-ip 10.10.10.10

[SwitchS] ospf 1

[SwitchS-ospf-1] fast-reroute lfa

[SwitchS-ospf-1] quit

# 配置Switch D。

<SwitchD> system-view

[SwitchD] bfd echo-source-ip 11.11.11.11

[SwitchD] ospf 1

[SwitchD-ospf-1] fast-reroute lfa

[SwitchD-ospf-1] quit

方法二:使能Switch S和Switch D的OSPF快速重路由功能(通過路由策略指定備份下一跳)

# 配置Switch S。

<SwitchS> system-view

[SwitchS] bfd echo-source-ip 10.10.10.10

[SwitchS] ip prefix-list abc index 10 permit 21.1.1.0 24

[SwitchS] route-policy frr permit node 10

[SwitchS-route-policy-frr-10] if-match ip address prefix-list abc

[SwitchS-route-policy-frr-10] apply fast-reroute backup-interface vlan-interface 12 backup-nexthop 12.12.12.2

[SwitchS-route-policy-frr-10] quit

[SwitchS] ospf 1

[SwitchS-ospf-1] fast-reroute route-policy frr

[SwitchS-ospf-1] quit

# 配置Switch D。

<SwitchD> system-view

[SwitchD] bfd echo-source-ip 10.10.10.10

[SwitchD] ip prefix-list abc index 10 permit 11.1.1.0 24

[SwitchD] route-policy frr permit node 10

[SwitchD-route-policy-frr-10] if-match ip address prefix-list abc

[SwitchD-route-policy-frr-10] apply fast-reroute backup-interface vlan-interface 24 backup-nexthop 24.24.24.2

[SwitchD-route-policy-frr-10] quit

[SwitchD] ospf 1

[SwitchD-ospf-1] fast-reroute route-policy frr

[SwitchD-ospf-1] quit

(4)     使能MPLS和MPLS LDP功能

# 配置Switch S。

[SwitchS] mpls lsr-id 1.1.1.1

[SwitchS] mpls ldp

[SwitchS-mpls-ldp] quit

[SwitchS] interface vlan-interface 12

[SwitchS-Vlan-interface12] mpls enable

[SwitchS-Vlan-interface12] mpls ldp enable

[SwitchS-Vlan-interface12] quit

[SwitchS] interface vlan-interface 13

[SwitchS-Vlan-interface13] mpls enable

[SwitchS-Vlan-interface13] mpls ldp enable

[SwitchS-Vlan-interface13] quit

# 配置Switch D。

[SwitchD] mpls lsr-id 3.3.3.3

[SwitchD] mpls ldp

[SwitchD-mpls-ldp] quit

[SwitchD] interface vlan-interface 13

[SwitchD-Vlan-interface13] mpls enable

[SwitchD-Vlan-interface13] mpls ldp enable

[SwitchD-Vlan-interface13] quit

[SwitchD] interface vlan-interface 24

[SwitchD-Vlan-interface24] mpls enable

[SwitchD-Vlan-interface24] mpls ldp enable

[SwitchD-Vlan-interface24] quit

# 配置Switch A。

[SwitchA] mpls lsr-id 2.2.2.2

[SwitchA] mpls ldp

[SwitchA-mpls-ldp] quit

[SwitchA] interface vlan-interface 12

[SwitchA-Vlan-interface12] mpls enable

[SwitchA-Vlan-interface12] mpls ldp enable

[SwitchA-Vlan-interface12] quit

[SwitchA] interface vlan-interface 24

[SwitchA-Vlan-interface24] mpls enable

[SwitchA-Vlan-interface24] mpls ldp enable

[SwitchA-Vlan-interface24] quit

(5)     配置LSP的觸發建立策略為所有靜態路由和IGP路由項都能觸發LDP建立LSP

# 配置Switch S。

[SwitchS] mpls ldp

[SwitchS-ldp] lsp-trigger all

[SwitchS-ldp] quit

# 配置Switch D。

[SwitchD] mpls ldp

[SwitchD-ldp] lsp-trigger all

[SwitchD-ldp] quit

# 配置Switch A。

[SwitchA] mpls ldp

[SwitchA-ldp] lsp-trigger all

[SwitchA-ldp] quit

4. 驗證配置

# 在Switch S和Switch D上執行display mpls ldp lsp命令,可以看到Switch S和Switch D之間建立了主備LSP(在Out Label後存在“B”,表示該LSP為備份LSP)。以Switch S為例:

[SwitchS] display mpls ldp lsp 21.1.1.0 24

Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable

FECs: 1            Ingress: 2          Transit: 2      Egress: 0

 

FEC                In/Out Label        Nexthop         OutInterface/LSINDEX

21.1.1.0/24        -/3                 13.13.13.2      Vlan13

                   2174/3              13.13.13.2      Vlan13

                   -/3(B)              12.12.12.2      Vlan12

                   2174/3(B)           12.12.12.2      Vlan12

暫無評論

編輯答案

你正在編輯答案

如果你要對問題或其他回答進行點評或詢問,請使用評論功能。

分享擴散:

提出建議

    +

親~登錄後才可以操作哦!

確定

親~檢測到您登陸的賬號未在http://hclhub.h3c.com進行注冊

注冊後可訪問此模塊

跳轉hclhub

你的郵箱還未認證,請認證郵箱或綁定手機後進行當前操作

舉報

×

侵犯我的權益 >
對根叔社區有害的內容 >
辱罵、歧視、挑釁等(不友善)

侵犯我的權益

×

泄露了我的隱私 >
侵犯了我企業的權益 >
抄襲了我的內容 >
誹謗我 >
辱罵、歧視、挑釁等(不友善)
騷擾我

泄露了我的隱私

×

您好,當您發現根叔知了上有泄漏您隱私的內容時,您可以向根叔知了進行舉報。 請您把以下內容通過郵件發送到pub.zhiliao@h3c.com 郵箱,我們會盡快處理。
  • 1. 您認為哪些內容泄露了您的隱私?(請在郵件中列出您舉報的內容、鏈接地址,並給出簡短的說明)
  • 2. 您是誰?(身份證明材料,可以是身份證或護照等證件)

侵犯了我企業的權益

×

您好,當您發現根叔知了上有關於您企業的造謠與誹謗、商業侵權等內容時,您可以向根叔知了進行舉報。 請您把以下內容通過郵件發送到 pub.zhiliao@h3c.com 郵箱,我們會在審核後盡快給您答複。
  • 1. 您舉報的內容是什麼?(請在郵件中列出您舉報的內容和鏈接地址)
  • 2. 您是誰?(身份證明材料,可以是身份證或護照等證件)
  • 3. 是哪家企業?(營業執照,單位登記證明等證件)
  • 4. 您與該企業的關係是?(您是企業法人或被授權人,需提供企業委托授權書)
我們認為知名企業應該坦然接受公眾討論,對於答案中不準確的部分,我們歡迎您以正式或非正式身份在根叔知了上進行澄清。

抄襲了我的內容

×

原文鏈接或出處

誹謗我

×

您好,當您發現根叔知了上有誹謗您的內容時,您可以向根叔知了進行舉報。 請您把以下內容通過郵件發送到pub.zhiliao@h3c.com 郵箱,我們會盡快處理。
  • 1. 您舉報的內容以及侵犯了您什麼權益?(請在郵件中列出您舉報的內容、鏈接地址,並給出簡短的說明)
  • 2. 您是誰?(身份證明材料,可以是身份證或護照等證件)
我們認為知名企業應該坦然接受公眾討論,對於答案中不準確的部分,我們歡迎您以正式或非正式身份在根叔知了上進行澄清。

對根叔社區有害的內容

×

垃圾廣告信息
色情、暴力、血腥等違反法律法規的內容
政治敏感
不規範轉載 >
辱罵、歧視、挑釁等(不友善)
騷擾我
誘導投票

不規範轉載

×

舉報說明