F1000有2根運營商線路,分別給內網A和內網B做策略路由出口,線路同時作為互相備份,一根線路故障時所有流量從另一根線路訪問公網。
目前做了2條策略路由,並調用NQA檢測公網地址。
測試下來當1根線路故障時,可以做到流量切換,但是故障線路恢複後無法自動切回原有線路。
故障線路恢複後通過dis nqa history和dis nqa result顯示NQA檢測仍然失敗,隻有手動重啟對應NQA檢測才會切回流量。
想問如何實現NQA檢測失敗並恢複後,如何自動恢複並讓策略路由上線?
(0)
最佳答案
NQA寫一下出接口?有沒有可能是NQA走錯了接口。或者配置一下這個命令nat link-switch recreate-session試試。
(0)
NQA檢測用的是2個連接運營商的出接口,試過該命令還是一樣
參考下案例吧:
3.1配置防火牆基本上網
# 外網接口G1/0/1配置運營商給的靜態ip地址
interface GigabitEthernet1/0/1
ip address 198.76.28.30 255.255.255.252
nat outbound
# 外網接口G1/0/2配置運營商給的靜態ip地址
interface GigabitEthernet1/0/2
ip address 198.77.28.30 255.255.255.252
nat outbound
# 內網接口G1/0/3配置自定義的內網靜態ip地址
interface GigabitEthernet1/0/2
ip address 192.168.2.1 255.255.255.0
#將內網接口加入trust域
security-zone name trust
import interface GigabitEthernet1/0/3
#將外網接口加入untrust域
security-zone name Untrust
import interface GigabitEthernet1/0/1
import interface GigabitEthernet1/0/2
#配置安全策略
security-policy ip
rule 0 name trust-untrust (放通內網到外網的訪問)
action pass
source-zone trust
destination-zone untrust
rule 1 name per-nqa (放通local安全域到外網探測地址114.114.114.114的訪問,如不配置則無法正常使用nqa探測外網地址)
action pass
source-zone local
destination-zone untrust
destination-ip-host 114.114.114.114
3.2 配置鏈路檢測
#創建管理員名為admin、操作標簽為test的NQA測試組
[H3C]nqa entry admin test
#配置測試類型為ICMP-echo,ICMP-echo測試利用ICMP協議,根據是否接收到應答報文判斷目的端設備的可達性。ICMP-echo測試的功能與ping命令類似,但ICMP-echo測試中可以指定測試的下一跳設備。在源端和目的端設備之間存在多條路徑時,通過配置下一跳設備可以指定測試的路徑
[H3C-nqa-admin-test-icmp-echo] type icmp-echo
配置監測公網的任意地址如114.114.114.114等,這樣就可以規避掉運營商本身出現網絡故障的風險
[H3C-nqa-admin-test-icmp-echo] destination ip 114.114.114.114
#配置測試組連續兩次測試的時間間隔為3000ms
[H3C-nqa-admin-test-icmp-echo] frequency 3000
#配置探測報文的下一跳IP地址,這個一般在探測的目的地址不是網關地址的時候建議配置,本案例探測的目的地址是直連網關地址,可以不配置下一跳地址
[H3C-nqa-admin-test-icmp-echo] next-hop 198.76.28.29
#配置聯動項1(連續失敗3次觸發聯動)
[H3C-nqa-admin-test-icmp-echo] reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only
[H3C-nqa-admin-test-icmp-echo]quit
#啟動探測
[H3C] nqa schedule admin test start-time now lifetime forever
#配置Track項1,關聯NQA測試組(管理員為admin,操作標簽為test)的聯動項1
[H3C] track 1 nqa entry admin test reaction 1
3.3配置靜態路由
# 進入係統視圖,配置兩條默認路由,並且修改G1.0.2線路的默認路由優先級為80(默認路由優先級為60,值越大優先級越低)。設備固定IP上網路由與Track項1關聯,作為主用路由。實現正常情況下流量全部從WAN1出去,鏈路出現故障時可切換到WAN2。
[H3C]ip route-static 0.0.0.0 0 198.76.28.29 track 1
[H3C]ip route-static 0.0.0.0 0 198.77.28.29 preference 80
[H3C]save force
# 兩條鏈路都正常的時候track項狀態為positive,路由也是走優先級為60的G1/0/1。
[H3C]display track all
Track ID: 1
State: Positive
Duration: 0 days 0 hours 1 minutes 35 seconds
Tracked object type: NQA
Notification delay: Positive 0, Negative 0 (in seconds)
Tracked object:
NQA entry: admin test
Reaction: 1
Remote IP/URL: 114.114.114.114
Local IP: --
Interface: --
[H3C]display ip routing-table
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 198.76.28.29 GE1/0/1
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
198.76.28.28/30 Direct 0 0 198.76.28.30 GE1/0/1
198.76.28.28/32 Direct 0 0 198.76.28.30 GE1/0/1
198.76.28.30/32 Direct 0 0 127.0.0.1 InLoop0
198.76.28.31/32 Direct 0 0 198.76.28.30 GE1/0/1
198.77.28.28/30 Direct 0 0 198.77.28.30 GE1/0/2
198.77.28.28/32 Direct 0 0 198.77.28.30 GE1/0/2
198.77.28.30/32 Direct 0 0 127.0.0.1 InLoop0
198.77.28.31/32 Direct 0 0 198.77.28.30 GE1/0/2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# 當G1/0/1側運營商鏈路有問題時,設備上可以很快檢測到,此時查看track項狀態為Negative,查看路由發現走的是G1/0/2。
%Jan 24 15:38:01:238 2021 H3C NQA/6/NQA_ENTRY_PROBE_RESULT: -COntext=1; Reaction entry 1 of NQA entry admin-name admin operation-tag test: probe-fail.
[H3C]display track all
Track ID: 1
State: Negative
Duration: 0 days 0 hours 0 minutes 4 seconds
Tracked object type: NQA
Notification delay: Positive 0, Negative 0 (in seconds)
Tracked object:
NQA entry: admin test
Reaction: 1
Remote IP/URL: 114.114.114.114
Local IP: --
Interface: --
[H3C]display ip routing-table
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 80 0 198.77.28.29 GE1/0/2
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
198.76.28.30/32 Direct 1 0 0.0.0.0 NULL0
198.77.28.28/30 Direct 0 0 198.77.28.30 GE1/0/2
198.77.28.28/32 Direct 0 0 198.77.28.30 GE1/0/2
198.77.28.30/32 Direct 0 0 127.0.0.1 InLoop0
198.77.28.31/32 Direct 0 0 198.77.28.30 GE1/0/2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# 當G1/0/1運營商鏈路恢複時設備也能很快檢測到並切換為主鏈路。
%Jan 24 15:38:16:834 2021 H3C NQA/6/NQA_ENTRY_PROBE_RESULT: -COntext=1; Reaction entry 1 of NQA entry admin-name admin operation-tag test: probe-pass.
[H3C]display track all
Track ID: 1
State: Positive
Duration: 0 days 0 hours 0 minutes 2 seconds
Tracked object type: NQA
Notification delay: Positive 0, Negative 0 (in seconds)
Tracked object:
NQA entry: admin test
Reaction: 1
Remote IP/URL: 114.114.114.114
Local IP: --
Interface: --
[H3C]display ip routing-table
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 198.76.28.29 GE1/0/1
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
198.76.28.28/30 Direct 0 0 198.76.28.30 GE1/0/1
198.76.28.28/32 Direct 0 0 198.76.28.30 GE1/0/1
198.76.28.30/32 Direct 0 0 127.0.0.1 InLoop0
198.76.28.31/32 Direct 0 0 198.76.28.30 GE1/0/1
198.77.28.28/30 Direct 0 0 198.77.28.30 GE1/0/2
198.77.28.28/32 Direct 0 0 198.77.28.30 GE1/0/2
198.77.28.30/32 Direct 0 0 127.0.0.1 InLoop0
198.77.28.31/32 Direct 0 0 198.77.28.30 GE1/0/2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
1、本案例雙出口路由主備使用且備份,因此設置路由優先級,如果負載使用等價路由也可以分流互備的效果,隻需將優先級設置一致即可
(0)
這個場景不太一樣,是主備線路切一個NQA檢測。我這裏是2條策略路由2個NQA檢測,可以實現切換但是目前無法自動恢複。
這個場景不太一樣,是主備線路切一個NQA檢測。我這裏是2條策略路由2個NQA檢測,可以實現切換但是目前無法自動恢複。
可能是nqa做的有點問題,配置發出來看一下
(0)
# track 10 nqa entry admin ctc reaction 1 # track 20 nqa entry admin cuc reaction 1 nqa entry admin ctc type icmp-echo destination ip 223.5.5.5 frequency 1000 history-record enable out interface GigabitEthernet1/0/14 reaction 1 checked-element probe-fail threshold-type consecutive 4 action-type trigger-only source interface GigabitEthernet1/0/14 # nqa entry admin cuc type icmp-echo destination ip 223.5.5.5 frequency 1000 history-record enable out interface GigabitEthernet1/0/15 reaction 1 checked-element probe-fail threshold-type consecutive 4 action-type trigger-only source interface GigabitEthernet1/0/15 # nqa schedule admin ctc start-time now lifetime forever nqa schedule admin cuc start-time now lifetime forever # 其他配置就是LAN口下調用對應策略路由;2條默認路由為等價路由
# track 10 nqa entry admin ctc reaction 1 # track 20 nqa entry admin cuc reaction 1 nqa entry admin ctc type icmp-echo destination ip 223.5.5.5 frequency 1000 history-record enable out interface GigabitEthernet1/0/14 reaction 1 checked-element probe-fail threshold-type consecutive 4 action-type trigger-only source interface GigabitEthernet1/0/14 # nqa entry admin cuc type icmp-echo destination ip 223.5.5.5 frequency 1000 history-record enable out interface GigabitEthernet1/0/15 reaction 1 checked-element probe-fail threshold-type consecutive 4 action-type trigger-only source interface GigabitEthernet1/0/15 # nqa schedule admin ctc start-time now lifetime forever nqa schedule admin cuc start-time now lifetime forever # 其他配置就是LAN口下調用對應策略路由;2條默認路由為等價路由
親~登錄後才可以操作哦!
確定你的郵箱還未認證,請認證郵箱或綁定手機後進行當前操作
舉報
×
侵犯我的權益
×
侵犯了我企業的權益
×
抄襲了我的內容
×
原文鏈接或出處
誹謗我
×
對根叔社區有害的內容
×
不規範轉載
×
舉報說明
NQA檢測用的是2個連接運營商的出接口,試過該命令還是一樣