本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本檔案介紹整合多重協定標籤交換(MPLS)的用途,並提供Cisco IOS® XR中的組態範例。
本文件沒有特定需求。
本檔案是Cisco IOS XR特有的,但不限於特定軟體版本或硬體。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
統一MPLS的目的全部在於擴展。為了擴展MPLS網路(該網路的一部分有不同型別的平台和服務),將網路劃分為不同區域是很有意義的。典型的設計引入了一個分層結構,其核心位於中心,而聚合則位於一側。為了進行擴展,核心中的內部網關協定(IGP)可能與聚合中的協定不同。為了擴展,您不能將IGP字首從一個IGP分配到另一個IGP。如果不將IGP字首從一個IGP分發到另一個IGP,則端到端標籤交換路徑(LSP)將不可行。
為了端到端提供MPLS服務,您需要將LSP設定為端到端。目標是保持MPLS服務(MPLS VPN、MPLS L2VPN)不變,但引入更高的可擴充性。為此,請將某些IGP字首移動到邊界網關協定(BGP)中(提供商邊緣(PE)路由器的環回字首),然後由提供商邊緣將字首端到端分發。
注意:請參閱搜尋命令的最佳實踐(僅限註冊客戶)以獲得有關如何研究命令的更多資訊。
圖1顯示了具有三個不同區域的網路:一個核心區域和兩個匯聚區域。每個區域運行自己的IGP,在區域邊界路由器(ABR)上它們之間不進行重新分配。需要使用BGP來提供端到端MPLS LSP。BGP在整個域內使用標籤通告PE路由器的環回,並提供端到端LSP。BGP是使用RFC 3107(BGP標籤的單播)在PE和ABR之間部署的,這意味著BGP會傳送IPv4字首+標籤(地址系列識別符號(AFI)1和後續地址系列識別符號(SAFI)4)。
圖1
由於網路的核心部分和聚合部分被整合並提供端到端LSP,因此Unified MPLS解決方案也稱為「無縫MPLS」。
此處未使用新技術或協定,僅使用MPLS、標籤發佈協定(LDP)、IGP和BGP。由於您不想將PE路由器的環回字首從網路的一部分分配到另一部分,因此需要在BGP中攜帶字首。內部邊界網關協定(iBGP)在一個網路中使用,因此字首的下一跳地址是PE路由器的環回字首,而網路其他部分的IGP不知道該字首。這表示下一個躍點地址不能用於遞迴為IGP字首。訣竅是使ABR路由器成為路由反射器(RR),並將下一跳設定為自己,即使對於反射的iBGP字首也是如此。
只有RR需要軟體來支援此架構。由於RR通告BGP字首並將下一跳設定為自身,因此它們將本地MPLS標籤分配給BGP字首。這表示在資料平面中,在這些端到端LSP上轉發的資料包在標籤堆疊中具有額外的MPLS標籤。RR位於轉發路徑中。
注意:在此架構上,提供任何MPLS服務。例如,在PE路由器之間提供服務MPLS VPN或MPLS L2VPN。這些資料包的資料平面的區別在於,它們現在在標籤堆疊中有三個標籤,而當未使用統一MPLS時,它們在標籤堆疊中有兩個標籤。
有兩種可能情況:
在這兩種情況下,ABR將ABR通告的(由BGP反映的)字首的下一跳設定為自身,從網路的聚合部分到核心部分。如果不這樣做,ABR需要將PE的環回字首從聚合IGP重新分配到核心IGP。如果這樣做,則沒有可擴充性。
對於ABR上反射的iBGP標籤的單播路由,可以應用不同的配置將下一跳設定為自身。
在Cisco IOS XR中啟用RFC 3107時,以下解決方案無法使用:
例如:
router bgp 1
neighbor 10.100.1.1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
next-hop-self
!
例如:
router bgp 1
neighbor 10.100.1.1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
route-policy nhs-ibgp-3107 out
!
route-policy nhs-ibgp-3107
set next-hop self
end-policy
例如:
router bgp 1
neighbor 10.100.1.1
address-family ipv4 labeled-unicast
route-policy nhs-ibgp-3107-peer out
!!% Could not find entry in list: Policy [nhs-ibgp-3107-peer]
uses 'set-to-peer-address next-hop'. 'set' is not a valid
operator for the 'next-hop' attribute at the bgp neighbor-out-dflt attach point.
!
!
!
route-policy nhs-ibgp-3107-peer
set next-hop peer-address
end-policy
例如:
router bgp 1
ibgp policy out enforce-modifications
!
neighbor 10.100.1.1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
route-policy nhs-ibgp-3107 out
!
!
route-policy nhs-ibgp-3107-peer
set next-hop 10.100.1.3
end-policy
這些解決方案有效。
確保具有ibgp policy out enforce-modifications!
例如:
router bgp 1
ibgp policy out enforce-modifications
!
neighbor 10.100.1.1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
next-hop-self
!
!
例如:
router bgp 1
ibgp policy out enforce-modifications
!
neighbor 1.100.1.1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
route-policy nhs-ibgp-3107 out
!
!
route-policy nhs-ibgp-3107
set next-hop self
end-policy
例如:
router bgp 1
ibgp policy out enforce-modifications
!
neighbor 10.100.1.1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
route-policy nhs-ibgp-3107 out
next-hop-self
!
!
!
route-policy nhs-ibgp-3107
set next-hop self
end-policy
例如:
router bgp 1
ibgp policy out enforce-modifications
!
neighbor 10.100.1.1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
route-policy nhs-ibgp-3107 out
next-hop-self
!
!
!
route-policy nhs-ibgp-3107
set next-hop 10.100.1.3
end-policy
hostname PE1
!
vrf one <<< MPLS service is MPLS VPN
address-family ipv4 unicast
import route-target
1:1
!
export route-target
1:1
!
!
address-family ipv6 unicast
import route-target
1:1
!
export route-target
1:1
!
!
interface Loopback0
ipv4 address 10.100.1.1 255.255.255.255
!
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.1.1.1 255.255.255.0
!
!
interface GigabitEthernet0/0/0/1 <<< VRF interface to CE1
vrf one
ipv4 address 10.9.1.3 255.255.255.0
!
!
router ospf 1
router-id 10.100.1.1
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
network point-to-point
!
!
!
router bgp 1
address-family ipv4 unicast
network 10.100.1.1/32 <<< advertise PE loopback in BGP
allocate-label all
!
address-family vpnv4 unicast
!
neighbor 10.100.1.3
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
!
!
neighbor 10.100.1.7 <<< vpnv4 iBGP session to PE2
remote-as 1
update-source Loopback0
address-family vpnv4 unicast
!
!
vrf one
rd 1:1
address-family ipv4 unicast
!
neighbor 10.9.1.2 <<< eBGP session to CE1
remote-as 65001
address-family ipv4 unicast
route-policy pass in
route-policy pass out
!
!
!
!
mpls ldp
mldp
logging notifications
address-family ipv4
!
!
router-id 10.100.1.1
address-family ipv4
!
interface GigabitEthernet0/0/0/0
address-family ipv4
!
!
!
hostname ABR1
!
interface Loopback0
ipv4 address 10.100.1.3 255.255.255.255
!
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.1.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/1
ipv4 address 10.1.2.3 255.255.255.0
!
route-policy nhs-ibgp-3107
set next-hop 10.100.1.3 <<< set next hop to loopback
end-policy
!
route-policy connected-into-ospf2
if destination in (10.100.1.3/32) then
pass
endif
end-policy
!
router ospf 1
router-id 10.100.1.3
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/1
network point-to-point
!
!
!
router ospf 2
redistribute connected route-policy connected-into-ospf2
area 0
interface GigabitEthernet0/0/0/0
network point-to-point
!
!
!
router bgp 1
ibgp policy out enforce-modifications
address-family ipv4 unicast
allocate-label all
!
neighbor 10.100.1.1 <<< iBGP neighbor PE1
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-reflector-client
route-policy nhs-ibgp-3107 out
next-hop-self
!
!
neighbor 10.100.1.5 <<< iBGP neighbor ABR2
remote-as 1
update-source Loopback0
address-family ipv4 labeled-unicast
route-policy nhs-ibgp-3107 out
next-hop-self
!
!
!
mpls ldp
mldp
address-family ipv4
!
!
router-id 10.100.1.3
interface GigabitEthernet0/0/0/0
address-family ipv4
discovery transport-address interface
!
!
interface GigabitEthernet0/0/0/1
address-family ipv4
!
!
注意:需要allocate-label all或allocate-label route-policy。否則,標籤的單播路由沒有它們需要的本地標籤,因為ABR是iBGP反射路由的下一跳。
註:不執行將核心IGP(OSPF 2)重新分配到聚合IGP(OSPF 1或OSPF 3)中的操作,反之亦然。但是,RR的環回字首也必須在聚合IGP中知道,因此PE路由器上的BGP可以與ABR/RR的環回對等。為此,會使用RPL將連線的路由重分配到聚合IGP中。重分佈的連線路由僅限於具有RPL的ABR的環回字首。
若要驗證控制平面操作,請參閱圖2:
圖2
若要驗證MPLS標籤通告,請參閱圖3:
圖3
若要驗證封包轉送,請參閱圖4:
圖4
這就是資料包從PE1轉發到PE2的方式。PE2的環回字首是10.100.1.7/32,因此該字首值得關注。
RP/0/0/CPU0:PE1#traceroute
Protocol [ipv4]:
Target IP address: 10.100.1.7
Source address: 10.100.1.1
Numeric display? [no]:
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 10.100.1.7
1 10.1.1.2 [MPLS: Labels 24000/24005 Exp 0] 439 msec 119 msec 109 msec
2 10.1.2.3 [MPLS: Label 24005 Exp 0] 109 msec 109 msec 109 msec
3 10.1.3.4 [MPLS: Labels 24001/24003 Exp 0] 99 msec 99 msec 149 msec
4 10.1.4.5 [MPLS: Label 24003 Exp 0] 119 msec 119 msec 99 msec
5 10.1.5.6 [MPLS: Label 24001 Exp 0] 109 msec 139 msec 99 msec
6 10.1.6.7 109 msec * 109 msec
標籤24000是從P2獲取的字首10.100.1.3/32的LDP標籤。標籤24005是為字首10.100.1.7/32學習的BGP RFC 3107標籤。
RP/0/0/CPU0:PE1#show route 10.100.1.7/32
Routing entry for 10.100.1.7/32
Known via "bgp 1", distance 200, metric 0, [ei]-bgp, type internal
BIER rid=0x0, flags=0x0, count=0
Installed May 27 02:52:07.184 for 00:08:52
Routing Descriptor Blocks
10.100.1.3, from 10.100.1.3 <<< next-hop is ABR1
Route metric is 0
No advertising protos.
RP/0/0/CPU0:PE1#show cef 10.100.1.7/32
10.100.1.7/32, version 89, internal 0x1000001 0x0 (ptr 0xa1470f74)
[1], 0x0 (0xa1456614), 0xa08 (0xa16181e0)
Updated May 27 02:52:07.203
Prefix Len 32, traffic index 0, precedence n/a, priority 4
via 10.100.1.3, 3 dependencies, recursive [flags 0x6000]
path-idx 0 NHID 0x0 [0xa16806f4 0x0]
recursion-via-/32
next hop 10.100.1.3 via 24001/0/21
local label 24003
next hop 10.1.1.2/32 Gi0/0/0/0 labels imposed {24000 24005}
RP/0/0/CPU0:PE1#show bgp ipv4 unicast labels
BGP router identifier 10.100.1.1, local AS number 1
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 44
BGP main routing table version 44
BGP NSR Initial initsync version 2 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Rcvd Label Local Label
*> 10.100.1.1/32 0.0.0.0 nolabel 3
*>i10.100.1.7/32 10.100.1.3 24005 24003
Processed 2 prefixes, 2 paths
有向ABR1的倒數第二躍點跳躍(PHP)。
RP/0/0/CPU0:P2#show mpls forwarding labels 24000
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24000 Pop 10.100.1.3/32 Gi0/0/0/1 10.1.2.3 694765
標籤24005換與ABR1上的標籤24003換在一起。
RP/0/0/CPU0:ABR1#show bgp ipv4 unicast labels
BGP router identifier 10.100.1.3, local AS number 1
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 60
BGP main routing table version 60
BGP NSR Initial initsync version 2 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Rcvd Label Local Label
*>i10.100.1.1/32 10.100.1.1 3 24003
*>i10.100.1.7/32 10.100.1.5 24003 24005
Processed 2 prefixes, 2 paths
RP/0/0/CPU0:ABR1#show mpls forwarding labels 24005
Wed May 27 04:08:24.255 UTC
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24005 24003 10.100.1.7/32 10.100.1.5 6347
從P1到ABR2有PHP。
RP/0/0/CPU0:P1#show mpls forwarding labels 24001
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24001 Pop 10.100.1.5/32 Gi0/0/0/1 10.1.4.5 348835
ABR2從PE2收到的RFC 3107路由10.100.1.7/32的BGP標籤為3。這是表示PHP的隱式null標籤。
RP/0/0/CPU0:ABR2#show bgp ipv4 unicast labels
BGP router identifier 10.100.1.5, local AS number 1
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 47
BGP main routing table version 47
BGP NSR Initial initsync version 2 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Rcvd Label Local Label
*>i10.100.1.1/32 10.100.1.3 24003 24005
*>i10.100.1.7/32 10.100.1.7 3 24003
Processed 2 prefixes, 2 paths
標籤24003換與ABR2上的標籤24001換在一起。
RP/0/0/CPU0:ABR2#show mpls forwarding labels 24003
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24003 24001 10.100.1.7/32 Gi0/0/0/0 10.1.5.6 403676
從P3到PE2有PHP。
RP/0/0/CPU0:P3#show mpls forwarding labels 24001
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24001 Pop 10.100.1.7/32 Gi0/0/0/1 10.1.6.7 685191
RP/0/0/CPU0:PE2#show bgp ipv4 unicast labels
BGP router identifier 10.100.1.7, local AS number 1
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 42
BGP main routing table version 42
BGP NSR Initial initsync version 2 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Rcvd Label Local Label
*>i10.100.1.1/32 10.100.1.5 24005 24004
*> 10.100.1.7/32 0.0.0.0 nolabel 3
Processed 2 prefixes, 2 paths
目前尚無適用於此組態的具體疑難排解資訊。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
31-Jul-2015 |
初始版本 |