FAQ-当上下游设备通过AR互连时,如何判断上游设备和下游设备的通信报文被AR接收并发送

发布时间:  2014-09-17 浏览次数:  144 下载次数:  0
问题描述
当上下游设备通过AR互连时,如何判断上游设备和下游设备的通信报文被AR接收并发送?
解决方案
在Router上配置相应的流策略:流分类规则为需要查看的报文特有的规则,流行为使能流策略的统计功能。
将流策略应用在Router与上下游设备连接的接口的出方向和入方向,再查看接口下基于该流分类的报文统计计数,观察计数是否增加,如果计数增加则说明该报文被发送和接收。
如图16-1所示,ServerA和ServerB通过Router互连。ServerA和ServerB互Ping,需要查看Ping报文是否被Router接收并发送。
图16-1 上下游设备通过AR互连的组网图

配置如下:
...
#
acl number 3000  //匹配目的地址为ServerB源地址为ServerA的ICMP报文
rule 5 permit icmp source 192.168.4.0 0.0.0.255 destination 192.168.3.0 0.0.0.255
#
acl number 3001  //匹配目的地址为ServerA源地址为ServerB的ICMP报文
rule 5 permit icmp source 192.168.3.0 0.0.0.255 destination 192.168.4.0 0.0.0.255
#
traffic classifier atob operator or
if-match acl 3000
traffic classifier btoa operator or
if-match acl 3001
#
traffic behavior statistic  //在流行为中使能流量统计功能
statistic enable
#
traffic policy atob
classifier atob behavior statistic
traffic policy btoa
classifier btoa behavior statistic
#
interface GigabitEthernet1/0/0
ip address 192.168.4.2 255.255.255.0
traffic-policy atob inbound  //在接口入方向统计ServerA发给ServerB的Ping报文
traffic-policy btoa outbound  //在接口出方向统计ServerB发给ServerA的Ping报文
#
interface GigabitEthernet2/0/0
ip address 192.168.3.2 255.255.255.0
traffic-policy btoa inbound  //在接口入方向统计ServerB发给ServerA的Ping报文
traffic-policy atob outbound  //在接口出方向统计ServerA发给ServerB的Ping报文
#
...
  •  使用命令display traffic policy statistics interface gigabitethernet 1/0/0 inbound verbose rule-base查看接口GE1/0/0上接收的ServerA发给ServerB的Ping报文计数
  •  使用命令display traffic policy statistics interface gigabitethernet 1/0/0 outbound verbose rule-base查看接口GE1/0/0上发送的ServerB发给ServerA的Ping报文计数
  •  使用命令display traffic policy statistics interface gigabitethernet 2/0/0 inbound verbose rule-base查看接口GE2/0/0上接收的ServerB发给ServerA的Ping报文计数
  •  使用命令display traffic policy statistics interface gigabitethernet 2/0/0 outbound verbose rule-base查看接口GE2/0/0上发送的ServerA发给ServerB的Ping报文计数

对于同一个流,如果入方向有计数,出方向无计数,说明报文被Router丢弃;如果入方向和出方向都有计数,说明报文被Router转发。

如下的显示信息中可以看到,ServerA发给ServerB的Ping报文被Router的接口GE1/0/0接收并被接口GE2/0/0发送出去:
[Huawei] display traffic policy statistics interface gigabitethernet 1/0/0 inbound verbose rule-base

Interface: GigabitEthernet1/0/0                                                
Traffic policy inbound: atob                                                   
Rule number: 1                                                                 
Current status: OK!                                                            
Classifier: atob operator or                                                   
Behavior: statistic                                                            
Board : 0                                                                      
rule 5 permit icmp source 192.168.4.0 0.0.0.255 destination 192.168.3.0 0.0.0.255
Passed Packet                         5,Passed Bytes                       490  
Dropped Packet                         0,Dropped Bytes                         0
[Huawei] display traffic policy statistics interface gigabitethernet 2/0/0 outbound verbose rule-base

Interface: GigabitEthernet2/0/0                                                
Traffic policy outbound: atob                                                   
Rule number: 1                                                                 
Current status: OK!                                                            
Classifier: atob operator or                                                   
Behavior: statistic                                                            
Board : 0                                                                      
rule 5 permit icmp source 192.168.4.0 0.0.0.255 destination 192.168.3.0 0.0.0.255
Passed Packet                         5,Passed Bytes                       490  
Dropped Packet                         0,Dropped Bytes                         0

END