01-MOD典型配置举例
本章节下载: 01-MOD典型配置举例 (259.70 KB)
MOD(Mirror On Drop,丢包镜像)功能可以检测报文在设备内部转发过程中发生的丢包。当发生丢包时,设备会将丢包原因及丢弃报文的特征发送给采集器。
本文介绍了MOD的典型配置举例。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文假设您已了解MOD特性。
· MOD功能仅对命中Flow Group流表的流量生效。MOD功能仅监控丢包原因列表中的丢包原因,由其他原因引起的丢包,不在MOD功能的监控范围内。
· 设备上存在两个系统预定义的Flow Group,一个是IP类型的,名称为system-defined-ip,另一个是VXLAN类型的,名称为system-defined-vxlan。这两个Flow Group不支持修改,且流表的生成规则是固定的,用户可直接使用。
¡ 对于系统预定义IP类型Flow Group,其流表的生成规则为IP五元组信息。
¡ 对于系统预定义VXLAN类型Flow Group,其流表的生成规则为VXLAN ID和内层IP五元组信息。
· 系统预定义的Flow Group应用后对设备收到的所有流量均生效。
· 缺省情况下,本设备的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。
如图4-1所示,某网络采用Spine、Leaf两级架构。为提高网络质量、监控流量丢包情况,需要在Spine设备和Leaf设备上配置MOD功能,以监控丢包情况是否发生在各个设备的流量转发过程中。MOD将采集到的丢包信息发送给采集器进行分析和处理。
图4-1 MOD典型配置举例组网图
· 基于IP类型的Flow Group生成流表,Flow Group的模式设置为普通MOD模式。
· 基于MOD的丢包原因列表,设备对命中流表项的流量进行丢包监控。
· 配置MOD采样,并将采样报文通过UDP方式上送到采集器。
表4-1 适用产品及版本
产品 |
软件版本 |
S12500R |
Release 5210及以上版本 |
# 配置HundredGigE1/0/1~HundredGigE1/0/3工作在三层模式,并配置各接口的IP地址。
<DeviceA> system-view
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] port link-mode route
[DeviceA-HundredGigE1/0/1] ip address 10.1.2.2 24
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] port link-mode route
[DeviceA-HundredGigE1/0/2] ip address 20.1.2.2 24
[DeviceA-HundredGigE1/0/2] quit
[DeviceA] interface hundredgige 1/0/3
[DeviceA-HundredGigE1/0/3] port link-mode route
[DeviceA-HundredGigE1/0/3] ip address 30.1.2.2 24
[DeviceA-HundredGigE1/0/3] quit
# 配置OSPF发布接口所在网段的路由。
[DeviceA] ospf 1 router-id 1.1.1.1
[DeviceA-ospf-1] area 0
[DeviceA-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] network 20.1.2.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] network 30.1.2.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] quit
[DeviceA-ospf-1] quit
# 配置流表的老化时间为10分钟。
[DeviceA] telemetry flow-group aging-time 10
# 应用Flow Group 1。
[DeviceA] telemetry apply flow-group system-defined ip
# 配置MOD功能的设备标识ID为10.1.2.2。
[DeviceA] telemetry mod
[DeviceA-telemetry-mod] device-id 10.1.2.2
[DeviceA-telemetry-mod] quit
# 创建采样器samp,采样方式为随机采样,采样器按照2的次方模式采样,采样率为8。
[DeviceA] sampler samp mode random packet-interval n-power 8
# 开启MOD的采样功能,并引用采样器samp。
[DeviceA] telemetry mod
[DeviceA-telemetry-mod] sampler samp
# 配置MOD功能上送采集器的报文的封装信息为:源IP地址为10.1.2.2,目的IP地址为40.1.1.1,源端口号为1000,目的端口号为2333。
[DeviceA-telemetry-mod] collector source-ip 10.1.2.2 destination-ip 40.1.1.1 source-port 1000 destination-port 2333
# 配置MOD功能监控的丢包原因列表为所有原因。
[DeviceA-telemetry-mod] reason-list all
[DeviceA-telemetry-mod] quit
[DeviceA] quit
Device B、Device C、Device D和Device E上除接口IP地址、OSPF路由的router-id和网段、MOD功能的设备标识ID、上送采集器的报文的封装信息中的源IP地址需要与Device A不同外,其他配置与Device A相同,具体配置步骤略。
# 查看Flow Group配置。
<DeviceA> display telemetry flow-group system-defined ip
<Sysname> display telemetry flow-group system-defined ip
Flow group named system-defined-ip (System-defined)
Mode : Common-MOD(Inactive), Group-MOD(Inactive)
Template:
destination-ip
destination-port
protocol
source-ip
source-port
Aging time: 10 minutes
# 查看MOD配置。
<DeviceA> display telemetry mod
Status :Successful
Drop reason list:
ipv4-dip-miss
ip-multicase-error
unknown-vlan
ipv4-l3-header-error
tunnel-header-error
parity-error
higig-header-error
invalid-tpid
Sampler : samp
Device ID : 10.1.2.2
Transport protocol : UDP
Collector
Source IP : 10.1.2.2
Destination IP : 40.1.1.1
Source port : 1000
Destination port : 2333
Device B、Device C、Device D和Device E上除接口IP地址、OSPF路由的router-id和网段、MOD功能的设备标识ID、上送采集器的报文的封装信息中的源IP地址与Device A不同外,其他配置与Device A相同,具体验证步骤略。
# 在Device A上使用ping命令验证Host C是否可达。
<DeviceA> ping 30.1.1.2
Ping 30.1.1.2 (30.1.1.2): 56 data bytes, press CTRL+C to break
56 bytes from 30.1.1.2: icmp_seq=0 ttl=255 time=4.703 ms
56 bytes from 30.1.1.2: icmp_seq=1 ttl=255 time=1.636 ms
56 bytes from 30.1.1.2: icmp_seq=2 ttl=255 time=1.733 ms
56 bytes from 30.1.1.2: icmp_seq=3 ttl=255 time=1.662 ms
56 bytes from 30.1.1.2: icmp_seq=4 ttl=255 time=1.606 ms
--- Ping statistics for 30.1.1.2 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.606/2.268/4.703/1.218 ms
# 修改Device E的配置。
<DeviceE> system-view
[DeviceE] ospf 1
[DeviceE-ospf-1] area 0
[DeviceE-ospf-1-area-0.0.0.0] undo network 30.1.2.0 0.0.0.255
[DeviceE-ospf-1-area-0.0.0.0] quit
[DeviceE-ospf-1] quit
# 在Device A上使用ping命令验证Host C是否可达。
<DeviceA> ping 30.1.1.2
Ping 30.1.1.2 (30.1.1.2): 56 data bytes, press CTRL+C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- Ping statistics for 30.1.1.2 ---
5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss
当目的IP地址为Host C的主机地址的报文在Spine设备和Leaf设备上的转发过程中发生丢包时,Collector将会收到设备上送的丢包原因和丢弃报文特征。
本例中,在分析Collector接收到的MOD丢包信息时,发现丢包的设备是Device A,丢包原因是ipv4-dip-miss,丢包原因解释:IPv4目的IP未命中路由表(命中缺省路由也上报本丢包原因),据此判断是Device A没有到达Host C的路由,导致发往Host C的报文被丢弃。恢复Device E的OSPF配置之后,Host C可以正常接收其他设备发来的报文。
· Device A:
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 10.1.2.0 0.0.0.255
network 20.1.2.0 0.0.0.255
network 30.1.2.0 0.0.0.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 10.1.2.2 255.255.255.0
#
interface HundredGigE1/0/2
port link-mode route
ip address 20.1.2.2 255.255.255.0
#
interface HundredGigE1/0/3
port link-mode route
ip address 30.1.2.2 255.255.255.0
#
sampler samp mode random packet-interval n-power 8
#
telemetry mod
reason-list all
device-id 10.1.2.2
sampler samp
collector source-ip 10.1.2.2 destination-ip 40.1.1.1 source-port 1000 destination-port 2333
#
telemetry apply flow-group system-defined ip
telemetry flow-group aging-time 10
#
· Device B、Device C、Device D、Device E上除接口IP地址、OSPF路由的router-id和网段、MOD功能的设备标识ID、上送采集器的报文的封装信息中的源IP地址与Device A不同外,其他配置与Device A相同,配置文件略。
· H3C S12500R系列交换路由器 Telemetry配置指导-R52xx
· H3C S12500R系列交换路由器 Telemetry命令参考-R52xx
· H3C S12500R-48Y8C&S12500R-48C6D交换路由器 Telemetry配置指导-R52xx
· H3C S12500R-48Y8C&S12500R-48C6D交换路由器 Telemetry命令参考-R52xx
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!