S系列交換機流量統計(jì)配置方法
2014/10/29 22:16:27點擊:
問題描述
在網絡中,當遇到兩台設備互PING出現丢包等現象時(shí),需要排查中間(jiān)設備的轉發情況。
但(dàn)是有(yǒu)時(shí)候現場(chǎng)環境又不允許進行(xíng)抓包,這時(shí),我們便可(kě)以使用流量統計(jì)的方法,方便、快捷的建單排查出在設備上(shàng)接口轉發包數(shù)量的情況。
但(dàn)是有(yǒu)時(shí)候現場(chǎng)環境又不允許進行(xíng)抓包,這時(shí),我們便可(kě)以使用流量統計(jì)的方法,方便、快捷的建單排查出在設備上(shàng)接口轉發包數(shù)量的情況。
解決方案
以下腳本僅做(zuò)參考,具體(tǐ)IP地址和(hé)接口請(qǐng)按照現場(chǎng)實際情況寫入。
[Huawei]acl 3001
[Huawei-acl-adv-3001]rule permit icmp source 192.168.1.10 0.0.0.0 destination 192.168.2.10 0.0.0.0 //匹配需要做(zuò)測試的源和(hé)目标地址
[Huawei-acl-adv-3001]rule permit icmp source 192.168.2.10 0.0.0.0 destination 192.168.1.10 0.0.0.0 //将源和(hé)目的反過來(lái)
[Huawei-acl-adv-3001]q
[Huawei]
[Huawei]traffic classifier ping //創建流分類
[Huawei-classifier-ping]if-match acl 3001 //在流分類中挂入ACL
[Huawei-classifier-ping]q
[Huawei]
[Huawei]traffic behavior ping //創建流行(xíng)為
[Huawei-behavior-ping]statistic enable //在流動作(zuò)中開(kāi)啓流量統計(jì)功能
[Huawei-behavior-ping]q
[Huawei]
[Huawei]traffic policy ping //創建流策略
[Huawei-trafficpolicy-ping]classifier ping behavior ping //将之前創建的流分類和(hé)流行(xíng)為進行(xíng)捆綁
[Huawei-trafficpolicy-ping]q
[Huawei]
[Huawei]interface g 0/0/10 //在需要做(zuò)測試的接口上(shàng)分别對應上(shàng) 出 和(hé) 入 方向。
[Huawei-GigabitEthernet0/0/10]traffic-policy ping inbound
[Huawei-GigabitEthernet0/0/10]traffic-policy ping outbound
[Huawei-GigabitEthernet0/0/10]q
[Huawei]
[Huawei]int g 0/0/20 //如果有(yǒu)多(duō)個(gè)接口挂測試設備的話(huà),就在多(duō)個(gè)接口挂入,如果隻有(yǒu)一個(gè)接口挂測試設備的話(huà),就隻挂一個(gè)接口即可(kě)。
[Huawei-GigabitEthernet0/0/20]traffic-policy ping inbound
[Huawei-GigabitEthernet0/0/20]traffic-policy ping outbound
[Huawei-GigabitEthernet0/0/20]q
[Huawei]
寫好以上(shàng)配置後,先清空(kōng)一次計(jì)數(shù)信息,以保證接口流統計(jì)數(shù)歸零。
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/10 inbound
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/10 outbound 清空(kōng)接口計(jì)數(shù)
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/20 inbound
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/20 outbound 清空(kōng)接口計(jì)數(shù)
開(kāi)始PING,在192.168.1.10的PC上(shàng)ping 192.168.2.10的PC,PING 100個(gè)包。
查看測試結果:
display traffic policy statistics interface GigabitEthernet 0/0/10 inbound
display traffic policy statistics interface GigabitEthernet 0/0/10 outbound
display traffic policy statistics interface GigabitEthernet 0/0/20 inbound
display traffic policy statistics interface GigabitEthernet 0/0/20 outbound
注意:S2300-SI/S2700-SI不支持traffic policy,所以也不支持流統功能。
盒式交換機隻有(yǒu)S5700-SI/S5700-EI/S6700支持出方向“outbound”,也就是支持雙向流統。
框式交換機全系列可(kě)以支持雙方向流統。
以下腳本僅做(zuò)參考,具體(tǐ)IP地址和(hé)接口請(qǐng)按照現場(chǎng)實際情況寫入。
[Huawei]acl 3001
[Huawei-acl-adv-3001]rule permit icmp source 192.168.1.10 0.0.0.0 destination 192.168.2.10 0.0.0.0 //匹配需要做(zuò)測試的源和(hé)目标地址
[Huawei-acl-adv-3001]rule permit icmp source 192.168.2.10 0.0.0.0 destination 192.168.1.10 0.0.0.0 //将源和(hé)目的反過來(lái)
[Huawei-acl-adv-3001]q
[Huawei]
[Huawei]traffic classifier ping //創建流分類
[Huawei-classifier-ping]if-match acl 3001 //在流分類中挂入ACL
[Huawei-classifier-ping]q
[Huawei]
[Huawei]traffic behavior ping //創建流行(xíng)為
[Huawei-behavior-ping]statistic enable //在流動作(zuò)中開(kāi)啓流量統計(jì)功能
[Huawei-behavior-ping]q
[Huawei]
[Huawei]traffic policy ping //創建流策略
[Huawei-trafficpolicy-ping]classifier ping behavior ping //将之前創建的流分類和(hé)流行(xíng)為進行(xíng)捆綁
[Huawei-trafficpolicy-ping]q
[Huawei]
[Huawei]interface g 0/0/10 //在需要做(zuò)測試的接口上(shàng)分别對應上(shàng) 出 和(hé) 入 方向。
[Huawei-GigabitEthernet0/0/10]traffic-policy ping inbound
[Huawei-GigabitEthernet0/0/10]traffic-policy ping outbound
[Huawei-GigabitEthernet0/0/10]q
[Huawei]
[Huawei]int g 0/0/20 //如果有(yǒu)多(duō)個(gè)接口挂測試設備的話(huà),就在多(duō)個(gè)接口挂入,如果隻有(yǒu)一個(gè)接口挂測試設備的話(huà),就隻挂一個(gè)接口即可(kě)。
[Huawei-GigabitEthernet0/0/20]traffic-policy ping inbound
[Huawei-GigabitEthernet0/0/20]traffic-policy ping outbound
[Huawei-GigabitEthernet0/0/20]q
[Huawei]
寫好以上(shàng)配置後,先清空(kōng)一次計(jì)數(shù)信息,以保證接口流統計(jì)數(shù)歸零。
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/10 inbound
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/10 outbound 清空(kōng)接口計(jì)數(shù)
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/20 inbound
<s9303>reset traffic policy statistics interface GigabitEthernet 0/0/20 outbound 清空(kōng)接口計(jì)數(shù)
開(kāi)始PING,在192.168.1.10的PC上(shàng)ping 192.168.2.10的PC,PING 100個(gè)包。
查看測試結果:
display traffic policy statistics interface GigabitEthernet 0/0/10 inbound
display traffic policy statistics interface GigabitEthernet 0/0/10 outbound
display traffic policy statistics interface GigabitEthernet 0/0/20 inbound
display traffic policy statistics interface GigabitEthernet 0/0/20 outbound
注意:S2300-SI/S2700-SI不支持traffic policy,所以也不支持流統功能。
盒式交換機隻有(yǒu)S5700-SI/S5700-EI/S6700支持出方向“outbound”,也就是支持雙向流統。
框式交換機全系列可(kě)以支持雙方向流統。
- 上(shàng)一篇:S5700 V200R001C00SPC300 配置DHCP 2014/10/29
- 下一篇:SX700系列交換機升級之後沒有(yǒu)super密碼了 2014/10/29