• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

15-ACL和QoS配置指導

目錄

05-Flowspec配置

本章節下載 05-Flowspec配置  (357.43 KB)

05-Flowspec配置


1 Flowspec

1.1  Flowspec簡介

Flowspec(Flow Specification,流規格)用來實現對BGP網絡中的非法流量進行過濾與巡查,以減輕DoS(Denial of Service,拒絕服務)攻擊和DDoS(Distributed Denial of Service,分布式拒絕服務)攻擊對網絡的影響。借助BGP路由更新,Flowspec針對攻擊流量的特點,可集中配置和管理匹配規則以及流量動作,並快速地將匹配規則和流量動作應用到其他BGP路由器中。

1.1.1  Flowspec設備角色

·     Flowspec路由器:也稱為Flowspec控製器,為BGP網絡中的BGP路由器,通過BGP Update報文,向Flowspec邊界路由器傳遞包含匹配規則以及流量動作的Flowspec路由。

·     Flowspec邊界路由器:也稱為Flowspec客戶端,為BGP網絡中的BGP路由器,可接收BGP Update報文中Flowspec路由器創建的Flowspec路由。

配置Flowspec時,應選取BGP網絡中的一台BGP路由器作為Flowspec路由器,網絡中的其他BGP路由器作為Flowspec邊界路由器。

1.1.2  Flowspec工作原理

為支持Flowspec,MP-BGP定義了Flowspec IPv4地址族、Flowspec VPNv4地址族、Flowspec IPv6地址族和Flowspec VPNv6地址族,並新增了Flowspec NLRI(Network Layer Reachability Information,網絡層可達性信息),即Flowspec路由。通過Flowspec IPv4地址族、Flowspec VPNv4地址族、Flowspec IPv6地址族和Flowspec VPNv6地址族,Flowspec可以將攜帶匹配規則和流量動作的Flowspec路由在公網和VPN實例中進行傳播。

圖1-1所示,通過BGP路由更新的形式,Flowspec路由器向Flowspec邊界路由器發布Flowspec路由,Flowspec邊界路由器收到Flowspec路由後,將Flowspec路由中的匹配規則和流量動作應用到設備的轉發平麵,從而對進入設備的流量采取適當的流量動作。Flowspec路由同樣也支持跨AS傳輸,從而實現在最接近攻擊源的設備上對攻擊流量進行管控,這樣能夠最大程度地減少攻擊流量對網絡轉發性能的影響。

圖1-1 Flowspec原理圖

 

1.2  Flowspec配置準備

配置Flowspec前,需要在Flowspec路由器和Flowspec邊界路由器上配置BGP基本功能,具體配置請參見“三層技術-IP路由配置指導”中的“BGP基礎”。

1.3  協議規範

與BGP Flowspec相關的協議規範有:

·     RFC 5575:Dissemination of Flow Specification Rules

·     RFC 7674:Clarification of the Flowspec Redirect Extended Community

1.4  配置IPv4 Flowspec

1.4.1  IPv4 Flowspec配置任務簡介

(1)     創建並激活IPv4 Flowspec路由

需要在Flowspec路由器上創建並激活Flowspec路由。

(2)     應用IPv4 Flowspec路由

¡     在公網中應用IPv4 Flowspec路由

¡     在VPN實例中應用IPv4 Flowspec路由

需要在Flowspec路由器上應用Flowspec路由。

(3)     配置BGP發布IPv4 Flowspec路由

¡     配置BGP發布公網IPv4 Flowspec路由

¡     配置BGP發布私網IPv4 Flowspec路由

¡     配置BGP發布VPNv4 Flowspec路由

需要在Flowspec路由器和Flowspec邊界路由器上配置BGP發布Flowspec路由。

(4)     (可選)配置BGP Flowspec路由反射

需要在Flowspec路由器上配置BGP Flowspec路由反射。

1.4.2  創建並激活IPv4 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     創建IPv4 Flowspec路由。

flow-route flowroute-name

(3)     定義Flowspec路由的報文匹配規則。

if-match match-criteria

(4)     配置Flowspec路由的流量動作。請選擇其中一項進行配置。

¡     配置流量丟棄動作。

apply deny

¡     配置流量重定向到下一跳動作。

apply redirect next-hop { ipv4-address [ copy-mode ] | ipv6-address }

¡     配置流量重定向到SR-MPLS TE Policy動作。(暫不支持)

apply redirect next-hop ipv4-address color color

¡     配置流量重定向到SRv6 TE Policy動作。

apply redirect next-hop ipv6-address color color [ sid sid-value ]

¡     配置流量重定向到指定的Route Target動作。

apply redirect vpn-target import-vpn-target

¡     配置重新標記報文DSCP值的動作。

apply remark-dscp dscp-value

¡     配置流量限速動作。

apply traffic-rate rate

缺省情況下,Flowspec路由中未配置流量動作。

(5)     (可選)檢查Flowspec路由下未生效的匹配規則及流量動作。

check flow-route-configuration

(6)     激活Flowspec路由中的匹配規則及流量動作。

commit

缺省情況下,Flowspec路由下配置的匹配規則及流量動作未生效。

1.4.3  應用IPv4 Flowspec路由

1. 在公網中應用IPv4 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     進入Flowspec視圖。

flowspec

(3)     創建Flowspec IPv4地址族。

address-family ipv4

(4)     應用已創建的IPv4 Flowspec路由。

flow-route flowroute-name

缺省情況下,公網中未應用IPv4 Flowspec路由。

2. 在VPN實例中應用IPv4 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     配置VPN實例。

a.     創建VPN實例,並進入VPN實例視圖。

ip vpn-instance vpn-instance-name

b.     配置VPN實例的RD。

route-distinguisher route-distinguisher

缺省情況下,未配置VPN實例的RD。

c.     配置VPN實例的Route Target。

vpn-target { vpn-target&<1-8> [ both | export-extcommunity | import-extcommunity ] }

缺省情況下,未配置VPN實例的Route Target。

關於ip vpn-instanceroute-distinguishervpn-target命令的詳細介紹,請參見“MPLS命令參考”中的“MPLS L3VPN”。

(3)     進入VPN實例IPv4 Flowspec地址族視圖。

address-family ipv4 flowspec

(4)     配置VPN實例下IPv4 Flowspec地址族的RD。

route-distinguisher route-distinguisher

缺省情況下,未配置VPN實例下IPv4 Flowspec地址族的RD。

(5)     配置VPN實例下IPv4 Flowspec地址族的VPN target。

vpn-target vpn-target&<1-8> [ both | export-extcommunity | import-extcommunity ]

缺省情況下,未配置VPN實例下IPv4 Flowspec地址族的VPN target。

VPN實例IPv4 Flowspec地址族的VPN target必須與之前配置的VPN實例的Route target保持一致。

(6)     依次執行以下命令退回係統視圖。

a.     quit

b.     quit

(7)     進入Flowspec視圖。

flowspec

(8)     創建Flowspec IPv4 VPN實例地址族並關聯已創建的VPN實例。

address-family ipv4 vpn-instance vpn-instance-name

(9)     應用已創建的IPv4 Flowspec路由。

flow-route flowroute-name

缺省情況下,VPN實例中未應用IPv4 Flowspec路由。

1.4.4  配置BGP發布IPv4 Flowspec路由

1. 功能簡介

缺省情況下,BGP Flowspec鄰居會對收到的IPv4 Flowspec路由及路由重定向下一跳的合法性進行驗證。

·     IPv4 Flowspec路由合法指的是:

¡     IPv4 Flowspec路由攜帶了匹配目的地址的規則。

¡     BGP Flowspec鄰居(接收及發送該IPv4 Flowspec路由的設備)上存在目的地址為“IPv4 Flowspec路由目的地址”的BGP路由,且該BGP路由來自發送設備。

在不關注IPv4 Flowspec路由合法性的情況下,可以關閉本功能,此時BGP Flowspec鄰居收到IPv4 Flowspec路由後,不會對其進行合法性驗證。

·     IPv4 Flowspec路由的重定向下一跳合法指的是(假設IPv4 Flowspec路由的重定向下一跳為設備A):

¡     BGP Flowspec鄰居上存在設備A的BGP路由。

¡     設備A與BGP Flowspec鄰居在同一AS內。

在不關注IPv4 Flowspec路由重定向下一跳合法性的情況下,可以關閉本功能,BGP Flowspec鄰居收到IPv4 Flowspec路由後,不會對其進行合法性驗證。

在Flowspec路由器上配置BGP發布IPv4 Flowspec路由時,該IPv4 Flowspec路由會通過BGP路由發布給Flowspec邊界路由器,同時也會在本Flowspec路由器上生效。

2. 配置限製和指導

關於bgppeer enable命令的詳細介紹,請參見“三層技術-IP路由命令參考”中的“BGP基礎”。

3. 配置BGP發布公網IPv4 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     請依次執行以下命令進入BGP IPv4 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family ipv4 flowspec

(3)     允許BGP Flowspec鄰居間交換路由信息。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable

缺省情況下,BGP Flowspec鄰居間不能交換路由信息。

(4)     (可選)關閉對來自BGP Flowspec鄰居的IPv4 Flowspec路由的合法性驗證功能。

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-disable

缺省情況下,會對接收的IPv4 Flowspec路由進行合法性驗證。

(5)     (可選)關閉對來自BGP Flowspec鄰居的IPv4 Flowspec路由的重定向下一跳合法性驗證功能。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-redirect-disable

缺省情況下,EBGP Flowspec鄰居會對接收的IPv4 Flowspec路由進行重定向下一跳合法性驗證。

(6)     (可選)配置向對等體發送路由時不改變下一跳。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } next-hop-invariable

缺省情況下,向EBGP對等體/對等體組發布IPv4 Flowspec路由時會將下一跳屬性改為自己的地址。

(7)     (可選)配置收到的帶有重定向到下一跳IP地址屬性的路由可以迭代隧道。

redirect ip recursive-lookup tunnel [ tunnel-selector tunnel-selector-name ]

缺省情況下,收到的帶有重定向到下一跳IP地址屬性的路由不能迭代隧道。

4. 配置BGP發布私網IPv4 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     請依次執行以下命令進入BGP-VPN IPv4 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

ip vpn-instance vpn-instance-name

address-family ipv4 flowspec

(3)     允許BGP Flowspec鄰居間交換路由信息。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable

缺省情況下,BGP Flowspec鄰居間不能交換路由信息。

(4)     (可選)關閉對來自BGP Flowspec鄰居的IPv4 Flowspec路由的合法性驗證功能。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-disable

缺省情況下,會對接收的IPv4 Flowspec路由進行合法性驗證。

(5)     (可選)關閉對來自BGP Flowspec鄰居的IPv4 Flowspec路由的重定向下一跳合法性驗證功能。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-redirect-disable

缺省情況下,EBGP Flowspec鄰居會對接收的IPv4 Flowspec路由進行重定向下一跳合法性驗證。

(6)     (可選)配置向EBGP對等體發送路由時不改變下一跳地址。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } next-hop-invariable

缺省情況下,向EBGP對等體/對等體組發布IPv4 Flowspec路由時會將下一跳屬性改為自己的地址。

5. 配置BGP發布VPNv4 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     請依次執行以下命令進入BGP VPNv4 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family vpnv4 flowspec

(3)     允許BGP Flowspec鄰居間交換路由信息。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable

缺省情況下,BGP Flowspec鄰居間不能交換路由信息。

(4)     (可選)配置向EBGP對等體發送VPNv4 Flowspec路由時不改變下一跳地址。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } next-hop-invariable

缺省情況下,向EBGP對等體/對等體組發布VPNv4 Flowspec路由時會將下一跳屬性改為自己的地址。

1.4.5  配置BGP Flowspec路由反射

1. 功能簡介

路由反射用來解決IBGP對等體需要全連接的問題。在一個AS內,一台路由器作為RR(Route Reflector,路由反射器),其它路由器作為客戶機(Client)與路由反射器建立IBGP連接。路由反射器在客戶機之間傳遞(反射)路由信息,而客戶機之間不需要建立BGP連接。

路由反射器及其客戶機形成了一個集群。通常情況下,一個集群中隻有一個路由反射器,該反射器的Router ID就作為集群ID,用於識別該群。

2. 配置步驟

(1)     進入係統視圖

system-view

(2)     進入BGP IPv4 Flowspec地址族視圖、BGP-VPN IPv4 Flowspec地址族視圖或BGP VPNv4 Flowspec地址族視圖。請選擇其中一項進行配置。

¡     請依次執行以下命令進入BGP IPv4 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family ipv4 flowspec

¡     請依次執行以下命令進入BGP-VPN IPv4 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

ip vpn-instance vpn-instance-name

address-family ipv4 flowspec

¡     請依次執行以下命令進入BGP VPNv4 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family vpnv4 flowspec

(3)     配置本機作為路由反射器,對等體/對等體組作為路由反射器的客戶機。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } reflect-client

缺省情況下,未配置路由反射器及其客戶機。

(4)     (可選)配置不對接收到的VPNv4 Flowspec路由進行Route Target過濾。

undo policy vpn-target

缺省情況下,對接收到的VPNv4 Flowspec路由進行Route Target過濾,即隻將Export Route Target屬性與本地Import Route Target屬性匹配的VPNv4 Flowspec路由加入到路由表。

本命令僅支持在BGP VPNv4 Flowspec地址族視圖執行。

(5)     (可選)允許路由反射器在客戶機之間反射路由。

reflect between-clients

缺省情況下,允許路由反射器在客戶機之間反射路由。

(6)     (可選)配置路由反射器的集群ID。

reflector cluster-id { cluster-id | ipv4-address }

缺省情況下,每個路由反射器都使用自己的Router ID作為集群ID。

1.5  配置IPv6 Flowspec

1.5.1  IPv6 Flowspec配置任務簡介

(1)     創建並激活IPv6 Flowspec路由

需要在Flowspec路由器上創建並激活Flowspec路由。

(2)     應用IPv6 Flowspec路由

¡     在公網中應用IPv6 Flowspec路由

¡     在VPN實例中應用IPv6 Flowspec路由

需要在Flowspec路由器上應用Flowspec路由。

(3)     配置BGP發布IPv6 Flowspec路由

¡     配置BGP發布公網IPv6 Flowspec路由

¡     配置BGP發布私網IPv6 Flowspec路由

¡     配置BGP發布VPNv6 Flowspec路由

需要在Flowspec路由器和Flowspec邊界路由器上配置BGP發布Flowspec路由。

(4)     (可選)配置BGP Flowspec路由反射

需要在Flowspec路由器上配置BGP Flowspec路由反射。

1.5.2  創建並激活IPv6 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     創建IPv6 Flowspec路由。

flow-route flowroute-name ipv6

(3)     定義Flowspec路由的報文匹配規則。

if-match match-criteria

(4)     配置Flowspec路由的流量動作。請選擇其中一項進行配置。

¡     配置流量丟棄動作。

apply deny

¡     配置流量重定向到下一跳動作。

apply redirect next-hop { ipv4-address | ipv6-address [ copy-mode ] }

¡     配置流量重定向到SR-MPLS TE Policy動作。(暫不支持)

apply redirect next-hop ipv4-address color color

¡     配置流量重定向到SRv6 TE Policy動作。

apply redirect next-hop ipv6-address color color [ sid sid-value ]

¡     配置流量重定向到指定的Route Target動作。

apply redirect vpn-target import-vpn-target

¡     配置重新標記報文DSCP值的動作。

apply remark-dscp dscp-value

¡     配置流量限速動作。

apply traffic-rate rate

缺省情況下,Flowspec路由中未配置流量動作。

(5)     (可選)檢查Flowspec路由下未生效的匹配規則及流量動作。

check flow-route-configuration

(6)     激活Flowspec路由中的匹配規則及流量動作。

commit

缺省情況下,Flowspec路由下配置的匹配規則及流量動作未生效。

1.5.3  應用IPv6 Flowspec路由

1. 在公網中應用IPv6 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     進入Flowspec視圖。

flowspec

(3)     創建Flowspec IPv6地址族。

address-family ipv6

(4)     應用已創建的IPv6 Flowspec路由。

flow-route flowroute-name

缺省情況下,公網中未應用IPv6 Flowspec路由。

2. 在VPN實例中應用IPv6 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     配置VPN實例。

a.     創建VPN實例,並進入VPN實例視圖。

ip vpn-instance vpn-instance-name

b.     配置VPN實例的RD。

route-distinguisher route-distinguisher

缺省情況下,未配置VPN實例的RD。

c.     配置VPN實例的Route Target。

vpn-target { vpn-target&<1-8> [ both | export-extcommunity | import-extcommunity ] }

缺省情況下,未配置VPN實例的Route Target。

關於ip vpn-instanceroute-distinguishervpn-target命令的詳細介紹,請參見“MPLS命令參考”中的“MPLS L3VPN”。

(3)     進入VPN實例IPv6 Flowspec地址族視圖。

address-family ipv6 flowspec

(4)     依次執行以下命令退回係統視圖。

a.     quit

b.     quit

(5)     進入Flowspec視圖。

flowspec

(6)     創建Flowspec IPv6 VPN實例地址族並關聯已創建的VPN實例。

address-family ipv6 vpn-instance vpn-instance-name

(7)     應用已創建的IPv6 Flowspec路由。

flow-route flowroute-name

缺省情況下,VPN實例中未應用IPv6 Flowspec路由。

1.5.4  配置BGP發布IPv6 Flowspec路由

1. 配置限製和指導

關於bgppeer enable命令的詳細介紹,請參見“三層技術-IP路由命令參考”中的“BGP基礎”。

2. 配置BGP發布公網IPv6 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     請依次執行以下命令進入BGP IPv6 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family ipv6 flowspec

(3)     允許BGP Flowspec鄰居間交換路由信息。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable

缺省情況下,BGP Flowspec鄰居間不能交換路由信息。

(4)     (可選)關閉對來自BGP Flowspec鄰居的IPv6 Flowspec路由的合法性驗證功能。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-disable

缺省情況下,會對接收的IPv6 Flowspec路由進行合法性驗證。

(5)     (可選)關閉對來自BGP Flowspec鄰居的IPv6 Flowspec路由的重定向下一跳合法性驗證功能。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-redirect-disable

缺省情況下,EBGP Flowspec鄰居會對接收的IPv6 Flowspec路由進行重定向下一跳合法性驗證。

(6)     (可選)配置向對等體發送路由時不改變下一跳。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } next-hop-invariable

缺省情況下,向EBGP對等體/對等體組發布IPv6 Flowspec路由時會將下一跳屬性改為自己的地址。

(7)     (可選)配置收到的帶有重定向到下一跳IP地址屬性的路由可以迭代隧道。

redirect ip recursive-lookup tunnel [ tunnel-selector tunnel-selector-name ]

缺省情況下,收到的帶有重定向到下一跳IP地址屬性的路由不能迭代隧道。

3. 配置BGP發布私網IPv6 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     請依次執行以下命令進入BGP-VPN IPv6 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

ip vpn-instance vpn-instance-name

address-family ipv6 flowspec

(3)     允許BGP Flowspec鄰居間交換路由信息。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable

缺省情況下,BGP Flowspec鄰居間不能交換路由信息。

(4)     (可選)關閉對來自BGP Flowspec鄰居的IPv6 Flowspec路由的合法性驗證功能。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-disable

缺省情況下,會對接收的IPv6 Flowspec路由進行合法性驗證。

(5)     (可選)關閉對來自BGP Flowspec鄰居的IPv6 Flowspec路由的重定向下一跳合法性驗證功能。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } validation-redirect-disable

缺省情況下,EBGP Flowspec鄰居會對接收的IPv6 Flowspec路由進行重定向下一跳合法性驗證。

(6)     (可選)配置向EBGP對等體發送路由時不改變下一跳地址。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } next-hop-invariable

缺省情況下,向EBGP對等體/對等體組發布IPv6 Flowspec路由時會將下一跳屬性改為自己的地址。

4. 配置BGP發布VPNv6 Flowspec路由

(1)     進入係統視圖。

system-view

(2)     請依次執行以下命令進入BGP VPNv6 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family vpnv6 flowspec

(3)     允許BGP Flowspec鄰居間交換路由信息。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable

缺省情況下,BGP Flowspec鄰居間不能交換路由信息。

(4)     (可選)配置向EBGP對等體發送VPNv6 Flowspec路由時不改變下一跳地址。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } next-hop-invariable

缺省情況下,向EBGP對等體/對等體組發布VPNv6 Flowspec路由時會將下一跳屬性改為自己的地址。

1.5.5  配置BGP Flowspec路由反射

(1)     進入係統視圖

system-view

(2)     進入BGP IPv6 Flowspec地址族視圖、BGP-VPN IPv6 Flowspec地址族視圖或BGP VPNv6 Flowspec地址族視圖。

¡     請依次執行以下命令進入BGP IPv6 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family ipv6 flowspec

¡     請依次執行以下命令進入BGP-VPN IPv6 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

ip vpn-instance vpn-instance-name

address-family ipv6 flowspec

¡     請依次執行以下命令進入BGP VPNv6 Flowspec地址族視圖。

bgp as-number [ instance instance-name ]

address-family vpnv6 flowspec

(3)     配置本機作為路由反射器,對等體/對等體組作為路由反射器的客戶機。

peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } reflect-client

缺省情況下,未配置路由反射器及其客戶機。

(4)     (可選)配置不對接收到的VPNv6 Flowspec路由進行Route Target過濾。

undo policy vpn-target

缺省情況下,對接收到的VPNv6 Flowspec路由進行Route Target過濾,即隻將Export Route Target屬性與本地Import Route Target屬性匹配的VPNv6 Flowspec路由加入到路由表。

本命令僅支持在BGP VPNv6 Flowspec地址族視圖執行。

(5)     (可選)允許路由反射器在客戶機之間反射路由。

reflect between-clients

缺省情況下,允許路由反射器在客戶機之間反射路由。

(6)     (可選)配置路由反射器的集群ID。

reflector cluster-id { cluster-id | ipv4-address }

缺省情況下,每個路由反射器都使用自己的Router ID作為集群ID。

1.6  Flowspec顯示和維護

1.6.1  顯示Flowspec路由的運行狀況

可在任意視圖下執行以下命令,顯示Flowspec邊界路由器上Flowspec路由的運行信息。

display flow-route { { ipv4 | ipv6 } all | flow-route-id } [ slot slot-number ]

display flow-route { { ipv4 | ipv6 } [ vpn-instance vpn-instance-name ] | flow-route-id } [ slot slot-number ]

1.6.2  顯示Flowspec對等體信息

可在任意視圖下執行以下命令:

·     顯示IPv4 BGP Flowspec對等體信息。

display bgp [ instance instance-name ] peer ipv4 flowspec [ vpn-instance vpn-instance-name ] [ ipv4-address mask-length | ipv6-address prefix-length | { ipv4-address | ipv6-address | group-name group-name } log-info | [ ipv4-address | ipv6-address ] verbose ]

·     顯示BGP IPv6 Flowspec對等體信息。

display bgp [ instance instance-name ] peer ipv6 flowspec [ vpn-instance vpn-instance-name ] ] [ ipv4-address mask-length | ipv6-address prefix-length | { ipv4-address | ipv6-address | group-name group-name } log-info | [ ipv4-address | ipv6-address ] verbose ]

·     顯示BGP VPNv4 Flowspec對等體信息。

display bgp [ instance instance-name ] peer vpnv4 flowspec [ ipv4-address mask-length | ipv6-address prefix-length | { ipv4-address | ipv6-address | group-name group-name } log-info | [ ipv4-address | ipv6-address ] verbose ]

·     顯示BGP VPNv6 Flowspec對等體信息。

display bgp [ instance instance-name ] peer vpnv6 flowspec [ ipv4-address mask-length | ipv6-address prefix-length| { ipv4-address | ipv6-address | group-name group-name } log-info | [ ipv4-address | ipv6-address ] verbose ]

·     顯示BGP IPv4 Flowspec對等體組的信息。

display bgp [ instance instance-name ] group ipv4  flowspec [ vpn-instance vpn-instance-name ] [ group-name group-name ]

·     顯示BGP IPv6 Flowspec對等體組的信息。

display bgp [ instance instance-name ] group ipv6  flowspec [ vpn-instance vpn-instance-name ] [ group-name group-name ]

1.6.3  顯示Flowspec路由信息

可在任意視圖下執行以下命令:

·     顯示BGP IPv4 Flowspec路由信息。

display bgp [ instance instance-name ] routing-table ipv4 flowspec [ vpn-instance vpn-instance-name ] [ flowspec-prefix [ advertise-info ] | statistics ]

display bgp [ instance instance-name ] routing-table ipv4 flowspec [ vpn-instance vpn-instance-name ] peer { ipv4-address | ipv6-address } { advertised-routes | received-routes } [ flowspec-prefix | statistics ]

·     顯示BGP IPv6 Flowspec路由信息。

display bgp [ instance instance-name ] routing-table ipv6 flowspec [ vpn-instance vpn-instance-name ] [ flowspec-prefix [ advertise-info ] | statistics ]

display bgp [ instance instance-name ] routing-table ipv6 flowspec [ vpn-instance vpn-instance-name ] peer { ipv4-address | ipv6-address } { advertised-routes | received-routes } [ flowspec-prefix | statistics ] ]

·     顯示BGP VPNv4 Flowspec路由信息。

display bgp [ instance instance-name ] routing-table vpnv4 flowspec [ peer ipv4-address { advertised-routes | received-routes } [ flowspec-prefix | statistics ] | [ route-distinguisher route-distinguisher ] [ flowspec-prefix [ advertise-info ] ] | statistics ]

·     顯示BGP VPNv6 Flowspec路由信息。

display bgp [ instance instance-name ] routing-table vpnv6 flowspec [ peer ipv6-address { advertised-routes | received-routes } [ flowspec-prefix | statistics ] | [ route-distinguisher route-distinguisher ] [ flowspec-prefix [ advertise-info ] ] | statistics ]

1.6.4  顯示打包組的相關信息

可在任意視圖下執行以下命令:

·     顯示BGP IPv4 Flowspec地址族下打包組的相關信息。

display bgp [ instance instance-name ] update-group ipv4 flowspec [ ipv4-address | ipv6-address]

·     顯示BGP IPv6 Flowspec地址族下打包組的相關信息。

display bgp [ instance instance-name ] update-group ipv6 flowspec [ ipv4-address | ipv6-address ]

·     顯示BGP VPNv4 Flowspec地址族下打包組的相關信息。

display bgp [ instance instance-name ] update-group vpnv4 flowspec [ ipv4-address | ipv6-address ]

·     顯示BGP VPNv6 Flowspec地址族下打包組的相關信息。

display bgp [ instance instance-name ] update-group vpnv6 flowspec [ ipv4-address | ipv6-address]

1.6.5  手工對BGP會話進行軟複位

請在用戶視圖下執行以下命令:

·     手工對IPv4 Flowspec地址族下的BGP會話進行軟複位。

refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } ipv4 flowspec

·     手工對IPv6 Flowspec地址族下的BGP會話進行軟複位。

refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } ipv6 flowspec

·     手工對VPNv4 Flowspec地址族下的BGP會話進行軟複位。

refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } vpnv4 flowspec

·     手工對VPNv6 Flowspec地址族下的BGP會話進行軟複位。

refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } vpnv6 flowspec

1.6.6  複位BGP會話

請在用戶視圖下執行以下命令:

·     複位BGP IPv4 Flowspec地址族下的BGP會話。

reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } ipv4 flowspec [ vpn-instance vpn-instance-name ]

·     複位BGP IPv6 Flowspec地址族下的BGP會話。

reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } ipv6  flowspec [ vpn-instance vpn-instance-name ]

·     複位BGP VPNv4 Flowspec地址族下的BGP會話。

reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | internal | group group-name } vpnv4 flowspec

·     複位BGP VPNv6 Flowspec地址族下的BGP會話。

reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | internal | group group-name } vpnv6 flowspec

1.6.7  清除Flowspec路由的統計信息

請在用戶視圖下執行以下命令:

·     清除IPv4 Flowspec路由的統計信息。

reset flow-route statistics ipv4 [ all | vpn-instance vpn-instance-name ]

·     清除IPv6 Flowspec路由的統計信息。

reset flow-route statistics ipv6 [ all | vpn-instance vpn-instance-name ]

·     清除全部Flowspec路由的統計信息。

reset flow-route statistics all

·     清除指定的Flowspec路由的統計信息。

reset flow-route statistics flow-route-id

1.7  Flowspec典型配置舉例

1.7.1  IPv4 Flowspec基本組網配置舉例

1. 組網需求

圖1-2所示,所有路由器均運行BGP協議。Device A作為Flowspec控製器,配置了Flowspec路由,Device B作為Flowspec客戶端,通過BGP協議接收並應用Device A發送的Flowspec路由。現要求對BGP網絡中PE設備收到的目的地址為1.1.1.0/24和端口號為10的報文進行限速處理,降低這些報文占用的帶寬資源。

2. 組網圖

圖1-2 Flowspec基本組網圖

3. 配置步驟

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

(2)     配置Device A

# 配置BGP連接。

<DeviceA> system-view

[DeviceA] bgp 100

[DeviceA-bgp-default] peer 10.1.1.2 as-number 200

[DeviceA-bgp-default] address-family ipv4 flowspec

[DeviceA-bgp-default-flowspec-ipv4] peer 10.1.1.2 enable

[DeviceA-bgp-default-flowspec-ipv4] peer 10.1.1.2 validation-disable

[DeviceA-bgp-flowspec-ipv4] quit

[DeviceA-bgp-default] quit

# 配置Flowspec路由。

[DeviceA] flow-route route1

[DeviceA-flow-route-route1] if-match destination-ip 1.1.1.0 24

[DeviceA-flow-route-route1] if-match destination-port 10

[DeviceA-flow-route-route1] apply traffic-rate 20

[DeviceA-flow-route-route1] check flow-route-configuration

Traffic filtering rules:

 Destination ip   :  1.1.1.0 255.255.255.0

 Destination port :  10

Traffic filtering actions:

 Traffic rate : 20(kbps)

[DeviceA-flow-route-route1] commit

[DeviceA-flow-route-route1] quit

# 為公網Flowspec IPv4地址族指定路由。

[DeviceA] flowspec

[DeviceA-flowspec] address-family ipv4

[DeviceA-flowspec-ipv4] flow-route route1

[DeviceA-flowspec-ipv4] quit

(3)     配置Route B

# 配置BGP連接。

<DeviceB> system-view

[DeviceB] bgp 200

[DeviceB-bgp-default] peer 10.1.1.1 as-number 100

[DeviceB-bgp-default] address-family ipv4 flowspec

[DeviceB-bgp-default-flowspec-ipv4] peer 10.1.1.1 enable

[DeviceB-bgp-default-flowspec-ipv4] peer 10.1.1.1 validation-disable

[DeviceB-bgp-default-flowspec-ipv4] quit

[DeviceB-bgp-default] quit

4. 驗證配置

# 查看Device A的BGP IPv4 Flowspec對等體狀態。

[DeviceA] display bgp peer ipv4 flowspec

 BGP local router ID: 192.168.150.1

 Local AS number: 100

 Total number of peers: 1                 Peers in established state: 1

  * - Dynamically created peer

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

  10.1.1.2               200       10       12    0       0 00:06:40 Established

# 查看Device B的BGP IPv4 Flowspec對等體連接狀態。

[DeviceB] display bgp peer ipv4 flowspec

 BGP local router ID: 192.168.150.2

 Local AS number: 200

 Total number of peers: 1                 Peers in established state: 1

  * - Dynamically created peer

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

  10.1.1.1               100       10       12    0       0 00:06:40 Established

# 查看Device B收到的Flowspec路由策略。

[DeviceB] display bgp routing-table ipv4 flowspec

 Total number of routes: 1

 

 BGP local router ID is 192.168.150.2

 Status codes: * - valid, > - best, d - dampened, h - history

               s - suppressed, S - stale, i - internal, e - external

               a - additional-path

       Origin: i - IGP, e - EGP, ? - incomplete

 

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

 

* >e DEST:1.1.1.0/24/40

                        0.0.0.0                    100        0       ?

# 查看Device B上Flowspec路由的運行信息。

<DeviceB> display flow-route ipv4 all

Total number of flow-routes: 1

 

Flow-Route (ID 0x0)

  BGP instance : default

  Traffic filtering rules:

   Destination IP   : 1.1.1.0 255.255.255.0

   Destination port : 10

  Traffic filtering actions:

   Traffic rate          : 20(kbps)

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們