08-Guard路由配置
本章節下載: 08-Guard路由配置 (201.24 KB)
Guard設備用來對引起網絡異常的流量進行流量過濾和流量清洗,將引起網絡異常的攻擊流量從正常流量裏過濾出來。
Guard路由是在Guard設備上配置的,它的主要作用是將引起網絡異常的流量牽引到Guard設備上來,既可以由管理員手工配置,也可以根據收到的信息觸發Guard設備上的腳本自動配置,其中,第二種方式更為常用。
Guard路由的出接口為Null0,配置後不會加入到FIB表裏,不會用於指導IP報文轉發,需要與BGP協議配合使用;通過BGP協議引入到BGP路由表並向BGP對等體發布,從而將BGP對等體本來要發給其它設備的網絡流量牽引到Guard設備上來,繼而在Guard上對流量進行流量過濾、流量清洗等操作。典型應用如圖1-1所示:
圖1-1 Guard路由典型應用
配置了Guard路由的設備稱之為Guard,檢測網絡異常的設備稱之為Detector:
· Router A通過Router B與Web Server、Name Server和E-Commerce-Application Server進行通信;
· Router B與Guard設備都使能BGP路由協議,並且創建了對等體關係;在Guard設備的BGP視圖下配置import-route guard命令,使能Guard路由引入功能。
· 在Router B上將Router A發送給Web Server、Name Server和E-Commerce-Application的流量鏡像到Detector上,Detector對這些流量進行檢測;
· 如果Detector沒有檢測到任何異常,經過Router B的網絡報文將執行正常的轉發,Guard設備不處於報文轉發路徑中;
· 如果Detector檢測到去往某個目的地址的流量出現異常,將通知Guard設備,觸發Guard設備創建Guard路由;或者Detector向網絡管理員報警,網絡管理員通過命令行配置Guard路由。Guard路由的目的地址為異常流量報文的目的地址,Guard設備將該路由發布給它的BGP對等體Router B。
· Router B學到該路由後,將發往異常目的地址的報文發送給Guard設備,相當於把異常流量牽引到Guard設備上;
· Guard設備對這些異常流量進行處理,丟棄攻擊流量,而正常流量會通過在Router B和Guard設備上配置策略路由重新注入網絡並正確送達目的地址。
表1-1 配置Guard路由
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置Guard路由 |
ip route-guard ip-address mask |
必選 缺省情況下,沒有配置Guard路由 |
在路由器上配置的Guard路由不會加入到FIB表,不用於指導當前路由器的IP報文的轉發;必須與BGP協議配合使用,通過BGP協議引入到BGP路由表並向BGP對等體發布,關於BGP引入Guard路由的配置過程,請參考“三層技術-IP路由配置指導”中的“BGP”。
在完成上述配置後,在任意視圖下執行display命令查看Guard路由配置的運行情況並檢驗配置結果。
表1-2 Guard路由顯示和維護
操作 |
命令 |
查看Guard路由表信息 |
display ip routing-table protocol guard [ inactive | verbose ] [ | { begin | exclude | include } regular-expression ] |
· Switch B通過Switch A與Web Server、Name Server和E-Commerce-Application-Server相連。
· 在Switch A上配置端口鏡像,通過Detector對Switch A發送往Web Server、Name Server和E-Commerce-Application-Server的報文進行監控。
· 當網絡管理員通過Detector發現去往目的地址1.1.1.1的報文有異常,對Guard設備和Switch A進行配置,將去往目的地址1.1.1.1的流量牽引到Guard設備上來。
圖1-2 Guard路由配置組網圖
(1) 配置各接口的IP地址(略)
(2) 在Switch A上配置端口鏡像
<SwitchA> system-view
[SwitchA] mirroring-group 1 local
[SwitchA] mirroring-group 1 mirroring-port GigabitEthernet 3/0/2 inbound
[SwitchA] mirroring-group 1 monitor-port GigabitEthernet 3/0/1
(3) 在Switch A上配置BGP路由協議以及路由策略
# 配置ACL 2000的過濾規則,拒絕所有路由。
[SwitchA] acl number 2000
[SwitchA-acl-basic-2000] rule 0 deny
[SwitchA-acl-basic-2000] quit
# 配置團體屬性列表1,匹配團體屬性1:1的路由在收到後不能被通告給任何其他的BGP對等體也不能被發布到本地AS之外。
[SwitchA] ip community-list 1 permit 1:1 no-export no-advertise
# 配置路由策略guard-in,匹配團體屬性列表1。
[SwitchA] route-policy guard-in permit node 0
[SwitchA-route-policy] if-match community 1
[SwitchA-route-policy] quit
# 使能BGP,並與Guard設備建立鄰居關係。
[SwitchA] bgp 100
[SwitchA-bgp] peer 5.5.5.6 as-number 200
# 配置發往對等體5.5.5.6的路由使用基於ACL 2000的過濾策略,即過濾掉所有路由。
[SwitchA-bgp] peer 5.5.5.6 filter-policy 2000 export
# 配置從對等體5.5.5.6接收的路由使用基於路由策略guard-in的過濾策略,即匹配團體屬性1:1的路由在收到後不能被通告給任何其他的BGP對等體也不能被發布到本地AS之外。
[SwitchA-bgp] peer 5.5.5.6 route-policy guard-in import
[SwitchA-bgp] quit
(4) 在Guard設備上配置BGP路由協議和路由策略並配置BGP引入Guard路由
# 配置ACL 2000的過濾規則,拒絕所有路由。
<Guard> system-view
[Guard] acl number 2000
[Guard-acl-basic-2000] rule 0 deny
[Guard-acl-basic-2000] quit
# 配置路由策略guard-out,匹配團體屬性1:1的路由在收到後將不向任何對等體發送也不會向自治係統外部通告。
[Guard] route-policy guard-out permit node 0
[Guard-route-policy] apply community 1:1 no-export no-advertise
[Guard-route-policy] quit
# 使能BGP,與Switch A建立鄰居關係並引入Guard路由。
[Guard] bgp 200
[Guard-bgp] peer 5.5.5.5 as-number 100
[Guard-bgp] import-route guard
# 配置從對等體5.5.5.5接收的路由使用基於ACL 2000的過濾策略,即過濾掉所有路由。
[Guard-bgp] peer 5.5.5.5 filter-policy 2000 import
# 配置發往對等體5.5.5.5的路由使用基於guard-out路由策略的過濾策略,並發布團體屬性。
[Guard-bgp] peer 5.5.5.5 route-policy guard-out export
[Guard-bgp] peer 5.5.5.5 advertise-community
[Guard-bgp] quit
Guard設備主要是用來對引起網絡異常的報文進行過濾,它的路由能力即報文轉發能力有限,因此需要在Guard設備上配置路由策略,禁止Guard設備接收和發布非Guard路由的其它正常路由,從而減少Guard設備的係統損耗。關於配置路由策略的詳細過程,請參考“三層技術-IP路由配置指導”中的“路由策略”。
(5) 網絡管理員通過Detector發現去往目的地址1.1.1.1的報文有異常,在Guard設備上配置Guard路由
# 配置Guard路由。
[Guard] ip route-guard 1.1.1.1 255.255.255.255
(6) 查看配置結果
# 查看Guard設備上配置的Guard路由。
[Guard] display ip routing-table protocol guard
Public Routing Table : Guard
Summary Count : 1
Guard Routing table Status : < Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 Guard 40 0 0.0.0.0 NULL0
Guard Routing table Status : < Inactive>
Summary Count : 0
# 查看Switch A上的通過BGP學到的Guard路由。
[SwitchA] display ip routing-table 1.1.1.1
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 BGP 255 0 5.5.5.6 Vlan100
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!