本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本檔案將說明在Cisco IOS® XR中透過一個BGP作業階段接收和播發未標籤和已標籤路徑的行為。
本文件沒有特定需求。
本檔案特定於Cisco IOS® XR,但並不限於特定軟體版本或硬體。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
地址系列識別符號(AFI)表示BGP路由的型別。例如,1表示IPv4,2表示IPv6。
後續地址系列識別符號(SAFI)是路由型別的進一步指示。例如,未標籤路由為1,標籤路由為4。
IPv4的未標籤單播為AFI 1和SAFI 1。
標籤為IPv4的單播為AFI 1和SAFI 4。
IPv6的未標籤單播為AFI 2和SAFI 1。
標籤為IPv6的單播為AFI 2和SAFI 4。
標籤單播(LU)通常稱為RFC 3107「在BGP-4中傳送標籤資訊」。
以後,U是指未標籤的單播,因此SAFI 1和LU是指標籤的單播,因此SAFI 4。
請注意,Cisco IOS® XR需要「allocate-label all| route-policy ...」,否則該路由不會作為SAFI 4發起或傳播到下一個BGP揚聲器。
Cisco IOS® XR不支援一個BGP會話上的IPv4/v6單播和標籤單播。
在Cisco IOS® XR上,一個BGP作業階段上同時啟用未標籤和標籤的支援已在6.2.1中完成。
如果不支援在一個會話上同時運行兩者,則會出現問題,因為上次收到的更新/撤消會覆蓋上一個更新/撤消更新,即使它們是在另一個SAFI上接收到的。
在運行IOS-XR 6.2.1之前的IOS-XR代碼的路由器上,在同一BGP會話上配置SAFI 1和4時,路由器發出以下警告:
bgp[1051]: %ROUTING-BGP-4-INCOMPATIBLE_AFI : IPv4 Unicast and IPv4 Labeled-unicast Address families together are not supported under the same neighbor.
此警告消息是在IOS-XR 5.3.0和IOS-XR 5.2.2中引入的。
BGP對等體之間交換的能力必須匹配。否則,BGP作業階段不會啟動。
以下是BGP Open訊息中為AFI 1/SAFI 1和AFI 1/SAFI 4交換功能的Wireshark擷取:
圖1
以下是使用LU配置的IOS-XR的示例,該示例在與使用U配置的IOS的會話中僅配置LU。
IOS-XR:
RP/0/0/CPU0:R4#show bgp neighbor 10.100.1.8
BGP neighbor is 10.100.1.8
Remote AS 65003, local AS 65003, internal link
Remote router ID 0.0.0.0
BGP state = Idle
…
Connections established 0; dropped 0
Local host: 10.100.1.4, Local port: 179, IF Handle: 0x00000000
Foreign host: 10.100.1.8, Foreign port: 33396
Last reset 00:00:14, due to BGP Notification sent: unsupported/disjoint capability
Time since last notification sent to neighbor: 00:00:14
Error Code: unsupported/disjoint capability
Notification data sent:
None
IOS路由器會為此配置錯誤列印系統日誌消息:
*Aug 8 12:40:44.719: %BGP-3-NOTIFICATION: received from neighbor 10.100.1.4 active 2/7 (unsupported/disjoint capability) 0 by
您可以在BGP neighbor命令下配置「address-family ipv4 unicast」,為BGP會話啟用ipv4單播。
您可以在BGP neighbor命令下配置「address-family ipv6 unicast」,為BGP會話啟用ipv6單播。
您可以在BGP neighbor命令下配置「address-family ipv4 labeled-unicast」,為BGP會話啟用標籤為unicast的ipv4。
您可以在BGP neighbor命令下配置「address-family ipv6 labeled-unicast」,為BGP會話啟用標籤為unicast的ipv6。
在IOS-XR中,AFI/SAFI組合是按每BGP對等體配置的。
以下是具有SAFI 1和4的BGP作業階段的範例:
router bgp 65003
address-family ipv4 unicast
redistribute connected
allocate-label all unlabeled-path
…
neighbor 10.100.1.7
remote-as 65003
update-source Loopback0
address-family ipv4 unicast
route-reflector-client
!
address-family ipv4 labeled-unicast
route-reflector-client
請注意,路由器BGP下仍然只有「address family unicast」而不是「address-family labeled-unicast」。SAFI 1和4路徑都儲存在這個BGP表中。
無論IOS-XR是舊版還是新版6.2.1,只有一個BGP表可以儲存U和LU路由。這一點在路由器bgp下只能配置(啟用)「地址系列ipv4單播」或「地址系列ipv6單播」的事實中顯而易見。不能在路由器bgp下配置「address-family ipv4 labeled-unicast」或「address-family ipv6 labeled-unicast」。
U和LU路徑可以相同。在IOS-XR 6.2.1之前,再次接收相同路徑(這次包含或不包含標籤)會覆蓋先前接收的路徑。在IOS-XR 6.2.1之後,如果兩條相同的路徑僅因標籤的不同而不同,則會視為不同的路徑。路徑新增、刪除或修改由不同的SAFI執行。
以下是具有AFI 1/SAFI 4的BGP表中的路由範例。由於對所有字首啟用了標籤分配,因此此路徑將使用本地標籤儲存。由於只有一個BGP表可儲存U和LU路由,因此字首會顯示為命令「show bgp ipv4 unicast」和「show bgp ipv4 labeled-unicast」!
RP/0/0/CPU0:R4#show bgp ipv4 unicast 10.100.1.1/32
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 5 5
Local Label: 24000
Last Modified: Aug 6 15:03:59.574 for 16:06:13
Paths: (1 available, best #1)
Advertised to update-groups (with more than one peer):
0.3 0.4
Advertised to peers (in unique update groups):
10.1.45.5
Path #1: Received by speaker 0
Advertised to update-groups (with more than one peer):
0.3 0.4
Advertised to peers (in unique update groups):
10.1.45.5
65002 65001
10.1.24.2 from 10.1.24.2 (10.100.1.2)
Received Label 24003
Origin IGP, localpref 100, valid, external, best, group-best, labeled-unicast
Received Path ID 0, Local Path ID 0, version 5
Origin-AS validity: not-found
請注意,路徑標有「labeled-unicast」。
RP/0/0/CPU0:R4#show bgp ipv4 labeled-unicast 10.100.1.1/32
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 5 5
Local Label: 24000
Last Modified: Aug 6 15:03:59.574 for 16:08:41
Paths: (1 available, best #1)
Advertised to update-groups (with more than one peer):
0.3 0.4
Advertised to peers (in unique update groups):
10.1.45.5
Path #1: Received by speaker 0
Advertised to update-groups (with more than one peer):
0.3 0.4
Advertised to peers (in unique update groups):
10.1.45.5
65002 65001
10.1.24.2 from 10.1.24.2 (10.100.1.2)
Received Label 24003
Origin IGP, localpref 100, valid, external, best, group-best, labeled-unicast
Received Path ID 0, Local Path ID 0, version 5
Origin-AS validity: not-found
請注意,路徑標有「labeled-unicast」。
如果路徑同時以U和LU的形式存在,則本地路徑ID會有所不同。
RP/0/0/CPU0:R4#show bgp ipv4 labeled-unicast 10.100.1.1/32 detail
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 30 30
Local Label: 24003 (no rewrite);
Flags: 0x00003028+0x00010000;
Last Modified: Aug 30 10:45:50.502 for 00:01:59
Paths: (2 available, best #1)
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.100.1.8 10.100.1.9
Advertised IPv4 Labeled-unicast paths to update-groups (with more than one peer):
0.8
Path #1: Received by speaker 0
Flags: 0x4000000009060205, import: 0x20
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.100.1.8 10.100.1.9
Advertised IPv4 Labeled-unicast paths to update-groups (with more than one peer):
0.8
65001, (Received from a RR-client)
10.100.1.9 (metric 2) from 10.100.1.9 (10.100.1.9)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 29
Path #2: Received by speaker 0
Flags: 0x4080000008020205, import: 0x20
Not advertised to any peer
65001, (Received from a RR-client)
10.100.1.9 (metric 2) from 10.100.1.9 (10.100.1.9)
Received Label 24001
Origin IGP, metric 0, localpref 100, valid, internal, labeled-unicast
Received Path ID 0, Local Path ID 0, version 0
您必須配置命令「allocate-label」,以便在BGP中接收的或源路徑具有本地MPLS標籤。如果沒有此命令,路由將沒有本地標籤。
RP/0/0/CPU0:R4#conf t
RP/0/0/CPU0:R4(config)#router bgp 65003
RP/0/0/CPU0:R4(config-bgp)# address-family ipv4 unicast
RP/0/0/CPU0:R4(config-bgp-af)#allocate-label ?
all Allocate labels for all prefixes
route-policy Use a route policy to select prefixes for label allocation
標籤分配針對所有路由或根據配置的路由策略。
在IOS-XR上的舊實現中,當在同一BGP會話上配置U和LU時會出現警告。IOS-XR 5.3.0和5.2.2版引入了警告。IOS-XR 6.2.1版刪除了警告,因為同一BGP會話支援標籤和未標籤。
範例:
RP/0/0/CPU0:ios#conf t
RP/0/0/CPU0:ios(config)#router bgp 65001
RP/0/0/CPU0:ios(config-bgp)#add ipv4 unicast
RP/0/0/CPU0:ios(config-bgp-af)#exit
RP/0/0/CPU0:ios(config-bgp)#neighbor 10.0.0.1
RP/0/0/CPU0:ios(config-bgp-nbr)#remote-as 65001
RP/0/0/CPU0:ios(config-bgp-nbr)#exit
RP/0/0/CPU0:ios(config-bgp)#neighbor 10.0.0.1
RP/0/0/CPU0:ios(config-bgp-nbr)#address-family ipv4 unicast
RP/0/0/CPU0:ios(config-bgp-nbr-af)#exit
RP/0/0/CPU0:ios(config-bgp-nbr)#address-family ipv4 labeled-unicast
RP/0/0/CPU0:ios(config-bgp-nbr-af)#commit
RP/0/0/CPU0:Aug 21 14:14:22.222 : bgp[1052]: %ROUTING-BGP-4-INCOMPATIBLE_AFI : IPv4 Unicast and IPv4 Labeled-unicast Address families together are not supported under the same neighbor.
此錯誤消息的解釋:
此訊息表示使用者已將IPv4單點傳播和IPv4標籤的單點傳播或IPv6單點傳播和IPv6標籤的單點傳播位址系列設定在同一鄰居之下。不支援此特定配置。
建議的操作:配置到路由器的兩個鄰居會話。在第一個鄰居會話下配置單播地址系列,並在第二個鄰居會話下配置標籤單播地址系列。
一對IOS-XR路由器之間的兩個BGP會話的配置示例。為每個BGP會話使用不同的(環回)地址。
hostname R1
interface Loopback0
ipv4 address 10.100.1.1 255.255.255.255
!
interface Loopback1
ipv4 address 10.100.1.101 255.255.255.255
!
router bgp 65001
address-family ipv4 unicast
!
neighbor 10.100.1.2
remote-as 65001
update-source Loopback0
address-family ipv4 unicast
!
!
neighbor 10.100.1.102
remote-as 65001
update-source Loopback1
address-family ipv4 labeled-unicast
!
!
hostname R2
interface Loopback0
ipv4 address 10.100.1.2 255.255.255.255
!
interface Loopback1
ipv4 address 10.100.1.102 255.255.255.255
!
router bgp 65001
address-family ipv4 unicast
!
neighbor 10.100.1.1
remote-as 65001
update-source Loopback0
address-family ipv4 unicast
!
!
neighbor 10.100.1.101
remote-as 65001
update-source Loopback1
address-family ipv4 labeled-unicast
!
!
在IOS-XR 6.2.1中,在預設VRF上的同一BGP作業階段上支援U和LU!
BGP作業階段是內部還是外部BGP都無關緊要。
任何非預設VRF中的BGP揚聲器都不支援同一會話上的U和LU。
在IOS-XR 6.2.1之前,所有U、LU和U + LU BGP揚聲器都儲存在不同的更新組中。在IOS-XR 6.2.1版之後,情況不再如此。一個更新組中的某些BGP揚聲器只能是U或LU,或者同時是U和LU。
下表顯示了不同方案的通告和撤銷行為。有16種情況。
除非註釋列中另有說明,否則所有選項均適用於IOS-XR 6.2.1版及更高版本。
案例 |
Bestpath/Addpath型別 |
本地標籤存在? |
NHS或NHU |
Update-group SAFI |
廣告還是撤退? |
意見 |
1 |
未標籤的路徑,即無rx標籤 |
是 |
NHS |
SAFI-1 |
預設通告 退出方式 advertise local-labeled-route(safi-unicast)disable命令 |
只能在6.5.1之後進行。 |
2 |
SAFI-4 |
廣告 |
只能在6.5.1之後進行。 IPv4/v6重新分發路由和6PE:implicit NHS always |
|||
3 |
NHU |
SAFI-1 |
廣告 |
只能在6.5.1之後進行。 |
||
4 |
SAFI-4 |
撤消 |
只能在6.5.1之後進行。 IPv4/v6重新分發路由和6PE:NHU被忽略;implicit NHS always |
|||
5 |
否 |
NHS |
SAFI-1 |
廣告 |
||
6 |
SAFI-4 |
撤消 |
||||
7 |
NHU |
SAFI-1 |
廣告 |
|||
8 |
SAFI-4 |
撤消 |
||||
9 |
標籤路徑,即帶rx標籤 |
是 |
NHS |
SAFI-1 |
預設通告 使用advertise local-labeled-route(safi-unicast)disable命令撤消 |
6.2.1之前:預設行為是Advertise。 |
10 |
SAFI-4 |
廣告 |
||||
11 |
NHU |
SAFI-1 |
撤消 |
6.2.1之前: 行為就是廣告。 |
||
12 |
SAFI-4 |
廣告 |
||||
13 |
否 |
NHS |
SAFI-1 |
廣告 |
||
14 |
SAFI-4 |
撤消 |
||||
15 |
NHU |
SAFI-1 |
撤消 |
6.2.1之前: 行為就是廣告。 |
||
16 |
SAFI-4 |
廣告 |
表1 iBGP和eBGP會話的通告行為
NHS =下一跳自己
NHU =下一跳不變。
如果NHU有效,則表示沒有為iBGP會話配置下一跳自身。
請注意,當BGP發言人傳送到eBGP對等體時,NHS總是如此。
對於iBGP揚聲器,可以有NHS或NHU,具體取決於下一跳自身的配置。iBGP對等點的預設行為是NHU。
對於第二列:請注意,僅當最佳路徑或標籤有add-path的路徑之一未標籤或標籤時,才會認為路徑未標籤或標籤。
對於路由傳播,最佳路徑具有哪些特徵非常重要。根據特徵(列2到4),它確定路徑通告為U還是LU,還是同時通告為U。
如果啟用了附加路徑(ADD-PATH)功能,並且路徑標籤為「add-path」,則該路徑的特徵也會對如何通告該路徑產生影響。
"本地標籤存在?:否」表示以下內容:可能收到帶有所接收更新的標籤,但是未安裝該標籤。如果命令「allocate-label」不存在,則不安裝本地標籤。
您可以通過詳細檢視字首來驗證本地標籤是否存在。使用「show bgp <prefix> detail」或「show route <prefix> detail」。
在以下示例中,接收字首時沒有標籤(因此通過SAFI 1對等),並且未分配本地標籤:
RP/0/0/CPU0:R2#show bgp ipv4 labeled-unicast 10.100.1.5/32 detail
BGP routing table entry for 10.100.1.5/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 3 3
Flags: 0x04001001+0x00000000;
Last Modified: Sep 5 03:44:45.647 for 01:01:27
Paths: (1 available, best #1)
Advertised to update-groups (with more than one peer):
0.3
Path #1: Received by speaker 0
Flags: 0x4000000001040207, import: 0x00
Advertised to update-groups (with more than one peer):
0.3
Local, (Received from a RR-client)
10.100.1.1 (metric 2) from 10.100.1.1 (10.100.1.1)
Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 3
RP/0/0/CPU0:R2#show route 10.100.1.5/32 detail
Routing entry for 10.100.1.5/32
Known via "bgp 65001", distance 200, metric 0, type internal
Installed Sep 5 03:44:45.480 for 01:01:37
Routing Descriptor Blocks
10.100.1.1, from 10.100.1.1
Route metric is 0
Label: None
Tunnel ID: None
Extended communities count: 0
NHID:0x0(Ref:0)
Route version is 0x23 (35)
No local label
IP Precedence: Not Set
QoS Group ID: Not Set
Flow-tag: Not Set
Route Priority: RIB_PRIORITY_RECURSIVE (12) SVD Type RIB_SVD_TYPE_LOCAL
Download Priority 4, Download Version 52
No advertising protos.
預設情況下,即使設定了「allocate-label」指令,也不會對未標籤的路徑(SAFI 1)進行標籤。
自IOS-XR 6.5.1版起,"allocate-label"命令的關鍵字"unlabeled-path"便可為未標籤的路徑分配標籤。
RP/0/0/CPU0:R4#conf t
RP/0/0/CPU0:R4(config)#router bgp 65003
RP/0/0/CPU0:R4(config-bgp)# address-family ipv4 unicast
RP/0/0/CPU0:R4(config-bgp-af)#allocate-label all ?
unlabeled-path Allocate label for unlabeled paths too
<cr>
RP/0/0/CPU0:R4(config-bgp-af)#allocate-label all unlabeled-path ?
<cr>
RP/0/0/CPU0:R4(config-bgp-af)#allocate-label all unlabeled-path
RP/0/0/CPU0:R4(config-bgp-af)#commit
該路徑是SAFI 1路徑,因此沒有收到任何標籤。
由於「unlabeled-path」命令,現在有一個本地標籤。
RP/0/0/CPU0:R4#show bgp ipv4 labeled-unicast 10.100.1.1/32 detail
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 16 16
Local Label: 24003 (no rewrite);
Flags: 0x01303028+0x00000000;
Last Modified: Aug 27 19:08:47.502 for 00:00:59
Paths: (1 available, best #1)
Advertised IPv4 Unicast paths to update-groups (with more than one peer):
0.3
Advertised IPv4 Labeled-unicast paths to update-groups (with more than one peer):
0.7
Advertised IPv4 Labeled-unicast paths to peers (in unique update groups):
10.1.45.5
Path #1: Received by speaker 0
Flags: 0x4000000009040207, import: 0x20
Advertised IPv4 Unicast paths to update-groups (with more than one peer):
0.3
Advertised IPv4 Labeled-unicast paths to update-groups (with more than one peer):
0.7
Advertised IPv4 Labeled-unicast paths to peers (in unique update groups):
10.1.45.5
65001, (Received from a RR-client)
10.100.1.10 (metric 2) from 10.100.1.10 (10.100.1.10)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 16
RP/0/0/CPU0:R4#show route 10.100.1.1/32 detail
Routing entry for 10.100.1.1/32
Known via "bgp 65003", distance 200, metric 0
…
Route version is 0x4 (4)
Local Label: 0x5dc3 (24003)
IP Precedence: Not Set
…
這將允許表1中的案例1至4。
要瞭解刪除「allocate-label」命令時為什麼仍分配本地標籤,請運行debug "debug bgp label"。
以下是範例:
RP/0/0/CPU0:R4#debug bgp label
RP/0/0/CPU0:R4#show debug
#### debug flags set from tty 'con0_0_CPU0' ####
ip-bgp default label flag is ON with value '##########'
最好為特定字首或字首組啟用此調試。以下是範例:
RP/0/0/CPU0:R4#sh running-config route-policy match-prefix
route-policy match-prefix
if destination in (10.100.1.1/32) then
pass
else
drop
endif
end-policy
!
RP/0/0/CPU0:R4#debug bgp label route-policy match-prefix
RP/0/0/CPU0:R4#show debug
#### debug flags set from tty 'con0_0_CPU0' ####
ip-bgp default label flag is ON with value '######match-prefix####'
RP/0/0/CPU0:R4#con t
RP/0/0/CPU0:R4(config)#router bgp 65003
RP/0/0/CPU0:R4(config-bgp)# address-family ipv4 unicast
RP/0/0/CPU0:R4(config-bgp-af)#no allocate-label all
RP/0/0/CPU0:R4(config-bgp-af)#commit
RP/0/0/CPU0:Aug 23 12:43:02.786 : bgp[1048]: [default-lbl] (ip4u): Label computation done: table=TBL:default (1/1), net=10.100.1.1/32: netfl=0x05043001, path=0x1073ed5c(10.1.24.2/32,10.1.24.2,0,0x400000000d060001), pathrcvdlabel=24002: asbr=1, rr=0/1, nhselfcount=1: result="label required"
您可以看到此路由器已收到字首10.100.1.1/32的標籤,是ASBR,不是RR,並且具有至少一個BGP會話的下一跳自身。這會導致該字首需要本地標籤。
本地標籤保持不變:
RP/0/0/CPU0:R4#show bgp ipv4 unicast 10.100.1.1/32 detail
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 13 13
Local Label: 16002 (no rewrite);
Flags: 0x05043001+0x00000200;
Last Modified: Aug 23 12:37:11.133 for 00:05:53
Paths: (1 available, best #1)
Advertised to update-groups (with more than one peer):
0.6
Advertised to peers (in unique update groups):
10.1.46.6 10.100.1.8 10.100.1.7
Path #1: Received by speaker 0
Flags: 0x400000000d060001, import: 0x1f
Advertised to update-groups (with more than one peer):
0.6
Advertised to peers (in unique update groups):
10.1.46.6 10.100.1.8 10.100.1.7
65002 65001
10.1.24.2 from 10.1.24.2 (10.100.1.2)
Received Label 24002
Origin IGP, localpref 100, valid, external, best, group-best, import-candidate
Received Path ID 0, Local Path ID 1, version 13
Origin-AS validity: not-found
RP/0/0/CPU0:R4#show route 10.100.1.1/32 detail
Routing entry for 10.100.1.1/32
Known via "bgp 65003", distance 20, metric 0, [ei]-bgp, labeled unicast (3107)
Tag 65002, type external
Installed Aug 23 12:37:11.440 for 00:06:02
Routing Descriptor Blocks
10.1.24.2, from 10.1.24.2, BGP external
Route metric is 0
Label: 0x5dc2 (24002)
Tunnel ID: None
Extended communities count: 0
NHID:0x0(Ref:0)
Route version is 0x4 (4)
Local Label: 0x3e82 (16002)
IP Precedence: Not Set
QoS Group ID: Not Set
Route Priority: RIB_PRIORITY_NON_RECURSIVE_LOW (11) SVD Type RIB_SVD_TYPE_LOCAL
Download Priority 4, Download Version 28
No advertising protos.
當不需要本地標籤時,調試將顯示以下消息:
RP/0/0/CPU0:Aug 23 13:01:15.801 : bgp[1048]: [default-lbl]: Prefix 10.100.1.1/32:()doesn't require label, releasing
RP/0/0/CPU0:Aug 23 13:01:15.801 : bgp[1048]: [default-lbl]: bgp_label_release_label: perform label release onnet 10.100.1.1/32net retain 0 label_retain 0
如果字首位於LFIB中,則取決於是否收到帶有標籤的字首,以及allocate-label是否應用於該字首。
接收的標籤用24002以下字首進行標籤。 它未安裝在LFIB中,因為BGP沒有allocate-label命令。
RP/0/0/CPU0:R4#show bgp ipv4 unicast 10.100.1.1/32
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 4 4
Local Label: 24002
Last Modified: Aug 8 13:52:57.276 for 00:00:36
Paths: (1 available, best #1)
Advertised to update-groups (with more than one peer):
0.6
Advertised to peers (in unique update groups):
10.100.1.7
Path #1: Received by speaker 0
Advertised to update-groups (with more than one peer):
0.6
Advertised to peers (in unique update groups):
10.100.1.7
65002 65001
10.1.24.2 from 10.1.24.2 (10.100.1.2)
Received Label 24002
Origin IGP, localpref 100, valid, external, best, group-best, labeled-unicast
Received Path ID 0, Local Path ID 0, version 4
Origin-AS validity: not-found
router bgp 65003
bgp unsafe-ebgp-policy
address-family ipv4 unicast
!
RP/0/0/CPU0:R4# show mpls forwarding
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24000 Aggregate 10.1.24.0/24 default 0
24001 Aggregate 10.1.45.0/24 default 0
如果存在allocate-label命令,則本地標籤存在於LFIB中:
router bgp 65003
bgp unsafe-ebgp-policy
address-family ipv4 unicast
allocate-label all
!
RP/0/0/CPU0:R4#show mpls forwarding
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24000 Aggregate 10.1.24.0/24 default 0
24001 Aggregate 10.1.45.0/24 default 0
24002 24002 10.100.1.1/32 10.1.24.2 0
即使BGP字首是通過LU會話接收的,但未分配本地標籤,如果完成NHS,則不會通過其他LU會話通告路由。這是表1中的案例14。如果傳出BGP會話是eBGP,則會發生這種情況。
範例:
RP/0/0/CPU0:R2#show bgp ipv4 unicast 10.100.1.1/32 detail
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 3 3
Flags: 0x00001001+0x00000000;
Last Modified: Aug 22 09:00:20.646 for 00:10:56
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Flags: 0x4080000001060001, import: 0x20
Not advertised to any peer
65001
10.1.12.1 from 10.1.12.1 (10.100.1.1)
Received Label 3
Origin IGP, metric 0, localpref 100, valid, external, best, group-best, labeled-unicast
Received Path ID 0, Local Path ID 0, version 3
Origin-AS validity: not-found
RP/0/0/CPU0:R2#show route 10.100.1.1/32 detail
Routing entry for 10.100.1.1/32
Known via "bgp 65002", distance 20, metric 0, labeled unicast (3107)
Tag 65001, type external
Installed Aug 22 09:00:20.416 for 00:10:59
Routing Descriptor Blocks
10.1.12.1, from 10.1.12.1, BGP external
Route metric is 0
Label: 0x100004 (1048580)
Tunnel ID: None
Binding Label: None
Extended communities count: 0
NHID:0x0(Ref:0)
Route version is 0x1 (1)
No local label
IP Precedence: Not Set
…
這可能是因為路由器BGP下沒有地址系列單播的命令「allocate-label」。
刪除「allocate-label」命令時,您需要重新啟動進程BGP,以便路由器刪除BGP路由的本地標籤。
表1中的新advertise local-labeled-route命令是一個新命令,它指示帶有本地標籤的路由不應通過SAFI-1通告為未標籤的路由。
此命令如下:
通告local-labeled-route [disable]
此命令在neighbor address-family下配置。此命令的作用是指示是否應該通過IPv4/v6單播(SAFI 1)將具有本地標籤的IPv4/v6路由通告給BGP鄰居。
預設行為是使用本地標籤通告路由。
新命令還可配置為:
通告local-labeled-route safi-unicast [disable]
此命令在BGP部分的af-group下配置。其功能與上述功能相同,適用於所有BGP鄰居。
預設行為是使用本地標籤通告路由。
地址系列IPv4 Unicast下的命令「show bgp neighbor」上存在行「Advertise routes with local-label via Unicast SAFI」或「Do not advertise routes with local-label via Unicast SAFI」,指示BGP揚聲器允許通告帶有或不帶有本地標籤的路由。
預設行為示例:
RP/0/0/CPU0:R4#show bgp neighbor 10.1.45.5
…
For Address Family: IPv4 Unicast
BGP neighbor version 5
Update group: 0.1 Filter-group: 0.5 No Refresh request being processed
Extended Nexthop Encoding: advertised and received
Route refresh request: received 0, sent 0
0 accepted prefixes, 0 are bestpaths
Exact no. of prefixes denied : 0.
Cumulative no. of prefixes denied: 0.
Prefix advertised 2, suppressed 0, withdrawn 0
Maximum prefixes allowed 1048576
Threshold for warning message 75%, restart interval 0 min
An EoR was not received during read-only mode
Last ack version 5, Last synced ack version 0
Outstanding version objects: current 0, max 1, refresh 0
Additional-paths operation: None
Advertise routes with local-label via Unicast SAFI
…
或
RP/0/0/CPU0:R4# conf t
RP/0/0/CPU0:R4(config)#router bgp 65003
RP/0/0/CPU0:R4(config-bgp)# neighbor 10.1.45.5
RP/0/0/CPU0:R4(config-bgp-nbr)# address-family ipv4 unicast
RP/0/0/CPU0:R4(config-bgp-nbr-af)#advertise local-labeled-route disable
RP/0/0/CPU0:R4(config-bgp-nbr-af)#commit
RP/0/0/CPU0:R4#show bgp neighbor 10.1.45.5
BGP neighbor is 10.1.45.5
…
For Address Family: IPv4 Unicast
BGP neighbor version 5
Update group: 0.1 Filter-group: 0.5 (Update-group Change
pending)
No Refresh request being processed
Extended Nexthop Encoding: advertised and received
Route refresh request: received 0, sent 0
0 accepted prefixes, 0 are bestpaths
Exact no. of prefixes denied : 0.
Cumulative no. of prefixes denied: 0.
Prefix advertised 2, suppressed 0, withdrawn 0
Maximum prefixes allowed 1048576
Threshold for warning message 75%, restart interval 0 min
An EoR was not received during read-only mode
Last ack version 5, Last synced ack version 0
Outstanding version objects: current 0, max 1, refresh 0
Additional-paths operation: None
Do not advertise routes with local-label via Unicast SAFI
最佳路徑計算流程沒有變化。如果路徑是SAFI 1或SAFI 4,或者路徑是否有標籤,則最佳路徑計算流程不會有任何不同。因此,SAFI 1或SAFI 4路徑之間沒有優先順序。無論同一BGP作業階段或不同作業階段上是否存在SAFI 1/SAFI 4,都會發生這種情況。因此,如果一個BGP作業階段是SAFI 1和4,且兩個位址系列上都收到首碼,則最佳路徑計算會選取一個作為最佳路徑,因為所有屬性都相同。如果U路徑和LU路徑之間的所有BGP屬性相同,則最後接收的路徑將成為最佳路徑。
如果從不同的BGP對等點收到SAFI 1和SAFI 4路徑,則通向BGP的路徑總是會有所不同,從兩個路徑中選取相同的最佳路徑。即使在這種情況下,所有屬性都相同,鄰居地址也會不同。檢視BGP最佳路徑選取演演算法,會選取來自具有最低鄰居位址的鄰居的路徑(最後步驟13)作為最佳路徑。
使用命令「show bgp <AFI> <SAFI> <prefix> bestpath-compare」驗證最佳路徑最佳的原因。
此首選項可由使用者使用RPL建立。
下面是這樣的RPL示例。
RP/0/0/CPU0:R7#show bgp ipv4 un 10.100.1.1/32 detail
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 682 682
Flags: 0x00003001+0x00010000;
Last Modified: Aug 28 13:16:26.826 for 00:00:10
Paths: (2 available, best #2)
Not advertised to any peer
Path #1: Received by speaker 0
Flags: 0x4000000000020005, import: 0x20
Not advertised to any peer
65001
10.100.1.4 (metric 2) from 10.100.1.4 (10.100.1.10)
Origin IGP, metric 0, localpref 100, valid, internal
Received Path ID 1, Local Path ID 0, version 0
Originator: 10.100.1.10, Cluster list: 10.100.1.4
Path #2: Received by speaker 0
Flags: 0x4080000001060005, import: 0x20
Not advertised to any peer
65001
10.100.1.4 (metric 2) from 10.100.1.4 (10.100.1.10)
Received Label 24003
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best, labeled-unicast
Received Path ID 1, Local Path ID 0, version 682
Originator: 10.100.1.10, Cluster list: 10.100.1.4
LU路徑是最佳路徑。
帶權重的RPL用於優先使用U路徑。
route-policy weight
if destination in (10.100.1.1/32) then
set weight 60000
endif
end-policy
router bgp 65003
address-family ipv4 unicast
additional-paths receive
additional-paths send
!
neighbor 10.100.1.4
remote-as 65003
update-source Loopback0
address-family ipv4 unicast
route-policy weight in
!
address-family ipv4 labeled-unicast
!
!
RP/0/0/CPU0:R7#show bgp ipv4 un 10.100.1.1/32 bestpath-compare
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 726 726
Last Modified: Aug 28 13:39:27.826 for 00:04:54
Paths: (2 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
65001
10.100.1.4 (metric 2) from 10.100.1.4 (10.100.1.10)
Origin IGP, metric 0, localpref 100, weight 60000, valid, internal, best, group-best
Received Path ID 1, Local Path ID 0, version 726
Originator: 10.100.1.10, Cluster list: 10.100.1.4
best of AS 65001, Overall best
Path #2: Received by speaker 0
Not advertised to any peer
65001
10.100.1.4 (metric 2) from 10.100.1.4 (10.100.1.10)
Received Label 24003
Origin IGP, metric 0, localpref 100, valid, internal, labeled-unicast
Received Path ID 1, Local Path ID 0, version 0
Originator: 10.100.1.10, Cluster list: 10.100.1.4
Lower weight than best path (path #1)
現在U路徑是最好的。
沒有新命令可優先使用標籤路徑而非未標籤路徑。您只需在BGP鄰居的address-family unicast或labeled-unicast下配置RPL。
要在IOS-XR中調試BGP更新傳播,可以開啟以下debug命令:debug bgp update <BGP neighbor> in |退出。
這將顯示來自或發往該BGP發言者的傳入或傳出BGP更新。對於未標籤的IPv4非廣播(AFI 1/SAFI 1),位址系列顯示為(ip4u),對於標籤的IPv4單點傳播(AFI 1/SAFI 4),顯示為(ipv4lu)。 對於IPv6,會出現相同的情況。
有一個新欄位「labeled-unicast」,表示路徑是透過SAFI 4得知的。
範例:
RP/0/0/CPU0:R1#show bgp ipv4 unicast 10.100.1.7/32
BGP routing table entry for 10.100.1.7/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 26 26
Last Modified: Sep 4 10:45:44.551 for 00:29:11
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
Local
10.100.1.4 (metric 3) from 10.100.1.102 (10.100.1.4)
Received Label 24000
Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, labeled-unicast
Received Path ID 0, Local Path ID 1, version 26
Originator: 10.100.1.4, Cluster list: 10.100.1.2
若要驗證是否已通告字首,可以在結尾使用關鍵字「advertised-routes」的「show bgp ... neighbors」命令。
範例:
R4兩次向鄰居10.100.1.7通告10.100.1.1/32,因為已啟用新增路徑(兩個路徑不同)。
RP/0/0/CPU0:R4#show bgp ipv4 labeled-unicast neighbors 10.100.1.7 advertised-routes
Network Next Hop From AS Path
10.1.24.0/24 10.100.1.4 Local ?
10.1.34.0/24 10.100.1.4 Local ?
10.1.45.0/24 10.100.1.4 Local ?
10.1.46.0/24 10.100.1.4 Local ?
10.1.47.0/24 10.100.1.4 Local ?
10.1.48.0/24 10.100.1.4 Local ?
10.1.49.0/24 10.100.1.4 Local ?
10.1.104.0/24 10.100.1.4 Local ?
10.1.114.0/24 10.100.1.4 Local ?
10.100.1.1/32 10.100.1.4 10.100.1.9 65001i
10.100.1.10 65001i
10.100.1.4/32 10.100.1.4 Local ?
Processed 11 prefixes, 12 paths
表1中的規則適用。使用統一MPLS或無縫MPLS,區域邊界路由器(ABR)充當路由反射器,但也是iBGP路由的下一跳。ABR位於標籤流量的轉發路徑中。ABR必須具有下一跳自身的顯式配置。
interface Loopback0
ipv4 address 10.100.1.7 255.255.255.255
!
interface Loopback1
ipv4 address 10.100.1.107 255.255.255.255
!
router bgp 65003
address-family ipv4 unicast
!
neighbor 10.100.1.4 -> towards loopback0 on peer
remote-as 65003
update-source Loopback0
address-family ipv4 unicast
!
!
neighbor 10.100.1.104 -> towards loopback1 on peer
remote-as 65003
update-source Loopback1
address-family ipv4 labeled-unicast
!
U和LU路徑通過兩個不同的BGP會話傳送/接收。
RP/0/0/CPU0:R7#show bgp ipv4 unicast 10.100.1.1/32 detail
BGP routing table entry for 10.100.1.1/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 753 753
Flags: 0x00001001+0x00010000;
Last Modified: Aug 28 14:06:40.826 for 00:22:10
Paths: (2 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Flags: 0x4000000001060005, import: 0x20
Not advertised to any peer
65001
10.100.1.4 (metric 2) from 10.100.1.4 (10.100.1.10)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 1, Local Path ID 0, version 753
Originator: 10.100.1.10, Cluster list: 10.100.1.4
Path #2: Received by speaker 0
Flags: 0x4080000000020005, import: 0x20
Not advertised to any peer
65001
10.100.1.104 (metric 2) from 10.100.1.104 (10.100.1.10)
Received Label 24003
Origin IGP, metric 0, localpref 100, valid, internal, labeled-unicast
Received Path ID 1, Local Path ID 0, version 0
Originator: 10.100.1.10, Cluster list: 10.100.1.4