本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本文說明如何配置軟體定義廣域網(SD-WAN)控制策略,以優先使用預設路由或字首。
思科建議您瞭解以下主題:
本文中的資訊係根據以下軟體和硬體版本:
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
為了進行本演示,本實驗在不同的端ID上設定5個cEdge/vEdge,其中Router01、Router02和Router03在VPN 1中配置了預設路由。
Router04(10.70.70.2)和Router05(10.20.20.1)接收和安裝來自Router01(10.70.70.1)、Router02(10.80.80.1)和Router03(10.80.80.1)的預設路由。 沒有應用於裝置的活動集中策略或本地化策略,預設情況下為全網狀拓撲。
Router04和Router05從三個不同的裝置接收預設路由。
Router04# show sdwan omp routes Generating output, this might take time, please wait ... Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 29 1002 C,I,R installed 10.70.70.1 biz-internet ipsec - 10.1.1.7 30 1005 C,I,R installed 10.80.80.1 mpls ipsec - 10.1.1.7 31 1003 C,I,R installed 10.80.80.2 mpls ipsec -
提示:其 show sdwan omp routes
如果路由器收到許多路由,則cEdge的輸出可能很大。您可以使用 show sdwan omp route vpn
要篩選輸出,或者 show sdwan omp route vpn
過濾cEdge中字首的所有扇區輸出。
Router05# show omp routes vpn 1 Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 5 1002 C,I,R installed 10.70.70.1 biz-internet ipsec - 10.1.1.7 6 1005 C,I,R installed 10.80.80.1 mpls ipsec - 10.1.1.7 7 1003 C,I,R installed 10.80.80.2 mpls ipsec -
提示:其 show omp route
如果路由器收到太多路由,vEdge的輸出可能會很大。您可以使用 show omp routes vpn
在vEdges中過濾輸出。您可以使用
命令旁邊的vEdges中格式表的輸出。| tab
Router04(10.70.70.2)和Router05(10.20.20.1)安裝來自Router01(10.70.70.1)、Router02(10.80.80.1)和Router03(10.80.80.1)的預設路由。
Router04# show ip route vrf 1 Routing Table: 1 Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route H - NHRP, G - NHRP registered, g - NHRP registration summary o - ODR, P - periodic downloaded static route, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR & - replicated local route overrides by connected Gateway of last resort is 10.80.80.2 to network 0.0.0.0 m* 0.0.0.0/0 [251/0] via 10.80.80.2, 00:05:02, Sdwan-system-intf [251/0] via 10.80.80.1, 00:05:02, Sdwan-system-intf [251/0] via 10.70.70.1, 00:05:02, Sdwan-system-intf
提示:其
如果路由器收到太多路由,則cEdge的輸出可能會很大。您可以使用 show ip route vrf
show ip route vrf
要過濾輸出,或者,也可使用
過濾字首的所有扇區輸出。show ip route vrf
Router05# show ip routes vpn 1 0.0.0.0/0 Codes Proto-sub-type: IA -> ospf-intra-area, IE -> ospf-inter-area, E1 -> ospf-external1, E2 -> ospf-external2, N1 -> ospf-nssa-external1, N2 -> ospf-nssa-external2, e -> bgp-external, i -> bgp-internal Codes Status flags: F -> fib, S -> selected, I -> inactive, B -> blackhole, R -> recursive, L -> import PROTOCOL NEXTHOP NEXTHOP NEXTHOP VPN PREFIX PROTOCOL SUB TYPE IF NAME ADDR VPN TLOC IP COLOR ENCAP STATUS --------------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 omp - - - - 10.70.70.1 biz-internet ipsec F,S 1 0.0.0.0/0 omp - - - - 10.80.80.1 mpls ipsec F,S 1 0.0.0.0/0 omp - - - - 10.80.80.2 mpls ipsec F,S
提示:其 show ip routes
如果路由器收到太多路由,vEdge的輸出可能會很大。您可以使用 show ip routes vpn
在vEdges中過濾輸出。
使用拓撲自定義控制元件並在OMP中應用預設路由的首選項。
使用路由規則而不是傳輸位置(TLOC)規則。
將此策略應用於出站方向到Router04站點ID 40。
您可以使用vManage GUI配置 Centralized Policy
使用 Control Policy
.
在中配置控制策略 Topology
,您可以選擇 Hub-and-Spoke
中, Mesh
,或 Custom Control
策略。
用於此特定場景,如圖所示。Custom Control(Route & TLOC)
和Sequence
type
新增了。Sequence Rule
system-ip和字首清單在匹配條件中設定。Originator
和 Accept
Preference
為相同順序的操作設定,如圖所示。
應用於站點40的出站方向,如圖所示。Control Policy
注意:啟用 Centralized Policy
,vSmart需要附加裝置模板,或 Centralized Policy
傳送
錯誤。vSmart必須處於vManage模式。Failed to activate policy
您可以手動配置vSmart,而不是vManage GUI。
control-policy originatoronly sequence 1 match route originator 10.70.70.1 prefix-list Default_Route ! action accept set preference 200 ! ! ! default-action accept ! lists prefix-list Default_Route ip-prefix 0.0.0.0/0 ! site-list sitio40 site-id 40 ! ! ! apply-policy site-list sitio40 control-policy originatoronly out <<<<<<< ! !
vSmart僅將來自發起方Router01(10.70.70.1)且優先順序為200的預設路由傳送到Router04。
注意:預設操作設定為拒絕。
預設操作可設定為接受或拒絕。
注意:如果序列不匹配,路由將採取預設操作。
這表示如果將預設操作設定為reject並且路由與任何序列都不匹配,則它會從vSmart中拒絕,並且不會向重疊通告。
如果預設操作設定為accept且路由與任何序列都不匹配,則從vsmart接受該路由並向重疊通告。
您可以使用
命令,以驗證 show running-config policy
Control-Policy
已正確應用。
vsmart# show running-config policy control-policy policy control-policy originatoronly sequence 1 match route originator 10.70.70.1 prefix-list Default_Route ! action accept set preference 200 ! ! ! default-action accept ! !
使用
檢查站點和方向, show running-config apply-policy
Control-Policy
已應用。
vsmart# show running-config apply-policy apply-policy site-list sitio40 control-policy originatoronly out ! !
提示:您可以使用 show running-config policy control-policy
在vSmart具有多個控制策略時過濾輸出。
Router04(10.70.70.2)收到來自Router01(10.70.70.1)、Router02(10.80.80.1)和Router03(10.80.80.1)的所有預設路由,但來自Router01的default-route具有更高的優先順序(200)。
Router04# show sdwan omp routes Generating output, this might take time, please wait ... Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 29 1002 C,I,R installed 10.70.70.1 biz-internet ipsec 200 <<<<<<<<<<<< 10.1.1.7 30 1005 R installed 10.80.80.1 mpls ipsec - 10.1.1.7 31 1003 R installed 10.80.80.2 mpls ipsec -
Router04(10.70.70.2)僅將來自Router01(10.70.70.1)的路由安裝在IP路由表中。
Router04# show ip route vrf 1 Routing Table: 1 Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route H - NHRP, G - NHRP registered, g - NHRP registration summary o - ODR, P - periodic downloaded static route, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR & - replicated local route overrides by connected Gateway of last resort is 10.70.70.1 to network 0.0.0.0 m* 0.0.0.0/0 [251/0] via 10.70.70.1, 00:13:25, Sdwan-system-intf
Router05(10.20.20.1)位於站點20,仍然接收和安裝來自Router01(10.70.70.1)、Router02(10.80.80.1)和Router03(10.80.80.1)的所有預設路由。
Router05# show omp routes vpn 1 Code: C -> chosen I -> installed Red -> redistribute Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 5 1002 C,I,R installed 10.70.70.1 biz-internet ipsec - <<<<<< no preference 10.1.1.7 6 1005 C,I,R installed 10.80.80.1 mpls ipsec - 10.1.1.7 7 1003 C,I,R installed 10.80.80.2 mpls ipsec - Router05# show ip routes vpn 1 Codes Proto-sub-type: IA -> ospf-intra-area, IE -> ospf-inter-area, E1 -> ospf-external1, E2 -> ospf-external2, N1 -> ospf-nssa-external1, N2 -> ospf-nssa-external2, e -> bgp-external, i -> bgp-internal Codes Status flags: F -> fib, S -> selected, I -> inactive, B -> blackhole, R -> recursive, L -> import PROTOCOL NEXTHOP NEXTHOP NEXTHOP VPN PREFIX PROTOCOL SUB TYPE IF NAME ADDR VPN TLOC IP COLOR ENCAP STATUS --------------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 omp - - - - 10.70.70.1 biz-internet ipsec F,S 1 0.0.0.0/0 omp - - - - 10.80.80.1 mpls ipsec F,S 1 0.0.0.0/0 omp - - - - 10.80.80.2 mpls ipsec F,S
使用與 Solution 1
已使用,並將其應用於來自Router01站點ID 70的入站方向。
control-policy originatoronly sequence 1 match route originator 10.70.70.1 prefix-list Default_Route ! action accept set preference 200 ! ! ! default-action accept ! lists prefix-list Default_Route ip-prefix 0.0.0.0/0 ! site-list SiteList_70 site-id 70 ! ! ! apply-policy site-list SiteList_70 control-policy originatoronly in <<<<<<<<< ! !
如果您使用傳入方向,則Router04(10.70.70.2)和Router05(10.20.20.1)只會從Router01(10.70.70.1)接收和安裝預設路由。
Router04# show sdwan omp routes Generating output, this might take time, please wait ... Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 29 1002 C,I,R installed 10.70.70.1 biz-internet ipsec 200 <<<<<<< Router05# show omp routes vpn 1 Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 5 1002 C,I,R installed 10.70.70.1 biz-internet ipsec 200 <<<<<<<
如果丟失Router01(10.70.70.1),路由器會安裝所有沒有優先順序接收的預設路由。在此案例中,來自Router02(10.80.80.1)和Router03(10.80.80.2):
Router04# show sdwan omp routes Generating output, this might take time, please wait ... Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 36 1005 C,I,R installed 10.80.80.1 mpls ipsec - 10.1.1.7 37 1003 C,I,R installed 10.80.80.2 mpls ipsec - Router05# show omp routes vpn 1 Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 14 1005 C,I,R installed 10.80.80.1 mpls ipsec - 10.1.1.7 15 1003 C,I,R installed 10.80.80.2 mpls ipsec -
在此解決方案中,路由器僅從Router01(10.70.70.1)接收預設路由器,但如果您丟失預設路由器,則希望遠端路由器安裝的備份預設路由來自Router02(10.80.80.1),而不是同時來自Router02(10.80.80.1)和Router03(10.80.80.1),如所示 Solution 1
和 Solution 2
.
在同一控制策略上新增一個序列,並應用您從Router01 preference 200的default-route設定的較低首選項,但此優先順序高於預設首選項(100)。
對於從Router02(10.80.80.1)通告的預設路由,您可以將首選項設定為150。
control-policy originator sequence 1 match route originator 10.70.70.1 prefix-list Default_Route ! action accept set preference 200 ! ! ! sequence 11 <<<<< new sequence match route originator 10.80.80.1 <<<<< Router02 system ip as originator prefix-list Default_Route ! action accept set preference 150 <<< lower preference of Router01 ! ! ! default-action accept ! lists prefix-list Default_Route ip-prefix 0.0.0.0/0 ! site-list sitio40 site-id 40 ! ! ! apply-policy site-list sitio40 control-policy originator out ! !
路由器會收到首選項為200、150和預設首選項的預設路由。
Router04# show sdwa omp routes Generating output, this might take time, please wait ... Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 36 1005 R installed 10.80.80.1 mpls ipsec 150 <<<<<<<< 10.1.1.7 37 1003 R installed 10.80.80.2 mpls ipsec - 10.1.1.7 38 1002 C,I,R installed 10.70.70.1 biz-internet ipsec 200 <<<<<<<<
Router04(10.70.70.2)只會將來自Router01(10.70.70.1)的預設路由新增到路由表中,且優先順序更高:
Router04# show ip route vrf 1 Routing Table: 1 Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route H - NHRP, G - NHRP registered, g - NHRP registration summary o - ODR, P - periodic downloaded static route, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR & - replicated local route overrides by connected Gateway of last resort is 10.70.70.1 to network 0.0.0.0 m* 0.0.0.0/0 [251/0] via 10.70.70.1, 00:02:47, Sdwan-system-intf
如果遺失了Router01(10.70.70.1),Router04(10.70.70.2)只會安裝具有下一個較高優先順序的路由(來自Router02(10.80.80.1))。
Router04# show sdwa omp routes Generating output, this might take time, please wait ... Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 36 1005 C,I,R installed 10.80.80.1 mpls ipsec 150 <<<<<<< 10.1.1.7 37 1003 R installed 10.80.80.2 mpls ipsec - Router04# show ip route vrf 1 Routing Table: 1 Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route H - NHRP, G - NHRP registered, g - NHRP registration summary o - ODR, P - periodic downloaded static route, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR & - replicated local route overrides by connected Gateway of last resort is 10.80.80.1 to network 0.0.0.0 m* 0.0.0.0/0 [251/0] via 10.80.80.1, 00:00:15, Sdwan-system-intf
如果丟失了Router02,Router04會安裝來自具有預設優先順序的路由器03(10.80.80.1)的預設路由。
提示:入站和出站方向在下一條路上工作,如果希望向全網狀網路中的所有遠端路由器通告首選項,則為入站方向;如果希望僅向特定遠端站點通告首選項,則為出站方向。
如果您使用任何其他字首而不是預設路由字首,前面的所有解決方案都完全相同。
從Router01(10.70.70.1)通告到Router04(10.70.70.2)的字首10.40.40.0/24的範例。
control-policy originator sequence 1 match route originator 10.70.70.1 prefix-list prefix40 ! action accept set preference 200 ! ! ! default-action accept ! lists prefix-list prefix40 ip-prefix 10.40.40.0/24 <<<<<<<<< ! site-list sitio40 site-id 40 ! ! ! apply-policy site-list sitio40 control-policy originator out ! !
Router04# show sdwan omp routes Generating output, this might take time, please wait ... Code: C -> chosen I -> installed Red -> redistributed Rej -> rejected L -> looped R -> resolved S -> stale Ext -> extranet Inv -> invalid Stg -> staged IA -> On-demand inactive U -> TLOC unresolved PATH ATTRIBUTE VPN PREFIX FROM PEER ID LABEL STATUS TYPE TLOC IP COLOR ENCAP PREFERENCE -------------------------------------------------------------------------------------------------------------------------------------- 1 0.0.0.0/0 10.1.1.7 36 1005 C,I,R installed 10.80.80.1 mpls ipsec 150 10.1.1.7 37 1003 R installed 10.80.80.2 mpls ipsec - 1 10.40.40.0/24 10.1.1.7 13 1002 C,I,R installed 10.70.70.1 biz-internet ipsec 200 <<<<<<<< 10.1.1.7 15 1005 R installed 10.80.80.1 mpls ipsec - 10.1.1.7 16 1003 R installed 10.80.80.2 mpls ipsec - Router04# show ip route vrf 1 Routing Table: 1 Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route H - NHRP, G - NHRP registered, g - NHRP registration summary o - ODR, P - periodic downloaded static route, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR & - replicated local route overrides by connected Gateway of last resort is 10.80.80.1 to network 0.0.0.0 m* 0.0.0.0/0 [251/0] via 10.80.80.1, 00:11:55, Sdwan-system-intf 10.0.0.0/24 is subnetted, 1 subnets m 10.40.40.0 [251/0] via 10.70.70.1, 00:02:17, Sdwan-system-intf <<<<<< Router04#
適用於vEdge路由器、Cisco SD-WAN的策略配置指南
技術支援與文件 - Cisco Systems
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
30-Aug-2022 |
初始版本 |