簡介
本文檔介紹以應用為中心的基礎設施(ACI)中的路由控制的配置。
必要條件
需求
採用元件
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
組態
所有受支援的路由協定都基於同一站點上路由控制配置的路由對映:
- 配置路由對映
- 建立集和匹配條件
- 相應地應用路由對映
導航到Tenant > TENANT_NAME > Networking > L3out > L3OUT_NAME > Route Map for Import and Export Route Control。
按一下右鍵該資料夾或使用工具按鈕建立匯入和匯出路由控制的路由對映。
預設情況下,已存在匯入和匯出路由控制。如果要編輯這些內容,只需從Name欄位的下拉選單中選擇它們即可。
這些預設路由控制主要用於路由重新分配和VRF洩漏。對於匯入路由控制的特殊情況,必須將L3out標籤為Import on Route Control Enforcement選項。
若要新建一個,請在名稱欄位中輸入所需的名稱。
點選Plus按鈕以建立新的上下文,建立實際的路由對映策略。
- Match Rule — 將一組屬性(字首清單、BGP的社群或正規表示式)匹配到要應用規則的位置。
- Set Rule — 將一組說明應用於Match Rule上指定的屬性:
在此步驟中,要應用的規則需要與協定路由決策相匹配。
OSPF
預設情況下,ACI使用外部型別2和度量20通告OSPF路由。
您可以按如下方式更改這些屬性:
度量值總計為對等路由器中介面的成本:
Router# show ip route ospf-1 vrf vrf_test
IP Route Table for VRF "vrf_test"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
10.10.10.0/24, ubest/mbest: 2/0
*via 10.46.0.1, Vlan481, [110/45], 00:06:04, ospf-1, type-1, tag 4294967295
*via 10.46.0.2, Vlan481, [110/45], 00:06:05, ospf-1, type-1, tag 4294967295
Router#
EIGRP
通過此方法,對於EIGRP,唯一可配置用於更改路由選擇的引數是Metric(度量),它與Diffusal Update Algorithm(DUAL)中的引數相同
Leaf# show ip eigrp topology vrf Test:Test_VRF
EIGRP Topology Table for AS(1818)/ID(192.168.10.1) VRF Test:Test_VRF
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 10.10.10.0/24, 1 Successors, FD is 51200, tag is 4294967295
via Rconnected(51200/0)
Leaf# ! After applying route-map
Leaf#
Leaf# show ip eigrp topology vrf Test:Test_VRF
EIGRP Topology Table for AS(1818)/ID(192.168.10.1) VRF Test:Test_VRF
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 10.10.10.0/24, 1 Successors, FD is 51200, tag is 4294967295
via Rconnected(5145600/0)
Leaf#
BGP
必須能夠根據需求需求配置BGP屬性:
設定社群 |
附加或替換社群ID |
設定緩衝 |
配置發生eBGP路由擺動時路由抑制的時間條件。 |
設定權重 |
啟用權重配置。 |
設定首選項 |
啟用本地首選項配置。 |
下一躍點傳播 |
將下一跳地址傳播到次要MP-BGP VPN對等點。 |
ACI驗證
要在ACI命令列介面(CLI)中驗證,每個協定都分配有一個包括VRF VNID的預設名稱:
Leaf# show vrf Test:Test_VRF detail extended
VRF-Name: Test:Test_VRF, VRF-ID: 23, State: Up
VPNID: unknown
RD: 103:2686981
Max Routes: 0 Mid-Threshold: 0
Encap: vxlan-2686981
Table-ID: 0x80000017, AF: IPv6, Fwd-ID: 0x80000017, State: Up
Table-ID: 0x00000017, AF: IPv4, Fwd-ID: 0x00000017, State: Up
Leaf#
要驗證應用到每個協定的路由對映,請運行:
Leaf# show ip ospf vrf Test:Test_VRF | egrep route-map
Table-map using route-map exp-ctx-2686981-deny-external-tag
bgp route-map exp-ctx-proto-2686981
eigrp route-map exp-ctx-proto-2686981
static route-map exp-ctx-st-2686981
direct route-map exp-ctx-st-2686981
coop route-map exp-ctx-st-2686981
Leaf#
Leaf# show ip eigrp vrf Test:Test_VRF | egrep route-map
static route-map exp-ctx-st-2686981
ospf-default route-map exp-ctx-proto-2686981
direct route-map exp-ctx-st-2686981
coop route-map exp-ctx-st-2686981
bgp-64512 route-map exp-ctx-proto-2686981
Tablemap: route-map exp-ctx-2686981-deny-external-tag , filter-configured
Leaf#
Leaf# show bgp process vrf Test:Test_VRF | egrep route-map
static, route-map imp-ctx-bgp-st-interleak-2686981
ospf, route-map permit-all
direct, route-map imp-ctx-bgp-direct-interleak-2686981
coop, route-map exp-ctx-coop-bgp-2686981
direct, route-map permit-all
Leaf#
識別出正確的路由對映後,可以顯示其內容:
Leaf# show route-map exp-ctx-st-2686981
route-map exp-ctx-st-2686981, deny, sequence 1
Match clauses:
tag: 4294967294
Set clauses:
route-map exp-ctx-st-2686981, permit, sequence 8201
Match clauses:
ip address prefix-lists: IPv4-st63-2686981-exc-ext-out-Test2RM-Context0RM-MatchRule-dst
ipv6 address prefix-lists: IPv6-deny-all
Set clauses:
tag 4294967295
metric 5
metric-type type-1
route-map exp-ctx-st-2686981, permit, sequence 15801
Match clauses:
tag: 4294967292
Set clauses:
tag 0
route-map exp-ctx-st-2686981, permit, sequence 15802
Match clauses:
tag: 4294967291
Set clauses:
tag 4294967295
route-map exp-ctx-st-2686981, permit, sequence 15804
Match clauses:
ip address prefix-lists: IPv4-st63-2686981-exc-int-inferred-export-dst
ipv6 address prefix-lists: IPv6-deny-all
Set clauses:
tag 0
Leaf#
預設情況下會建立多個路由對映條目,其中包括所有匹配標籤4294967294的路由的預設deny。標籤值由ACI邊界枝葉交換機設定,以避免路由環路。這是路由對映中唯一一個在VRF級別更改之前無法修改的值。
可以顯示匹配規則策略建立的字首清單:
Leaf# show ip prefix-list IPv4-st63-2686981-exc-ext-out-Test2RM-Context0RM-MatchRule-dst
ip prefix-list IPv4-st63-2686981-exc-ext-out-Test2RM-Context0RM-MatchRule-dst: 2 entries
seq 1 permit 10.10.0.0/16 le 32
seq 2 permit 0.0.0.0/0
Leaf#
多站點MP-BGP
多站點交換矩陣允許配置延伸型L3outs,並且是特定於站點的。除非遠端交換矩陣中存在更具體的路由,否則交換矩陣中的終端優先使用由本地L3out通告的外部路由,而不是遠端L3out。為了影響路由決策,因為路由被注入到overlay-1 VRF中的MP-BGP vpnv4地址系列;需要一種稱為interleak的特殊路由對映。
路由對映的配置與常規路由對映幾乎相同。AS-Prepand是影響eBGP鄰居中路由決策的建議值:
- 在路由對映Set Rule策略下建立Set AS Path策略:
- 需要選擇AS-Prepend或AS-Prepend last。
實現
配置匯入和匯出路由控制的路由對映後。實施取決於以下需求:
導航到Tenant > TENANT_NAME > Networking > L3out > L3OUT_NAME > Route Control Profile
導航到Tenant > TENANT_NAME > Networking > L3out > L3OUT_NAME > Subnets。
啟用匯出路由控制子網。
配置路由控制配置檔案。
導航到Tenant > TENANT_NAME > Networking > L3out > L3OUT_NAME。
配置路由配置檔案Interleak。
使用靜態源模式配置路由配置檔案以進行重新分配: