• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

12-网络管理和监控配置指导

目录

15-Host-monitor配置

本章节下载 15-Host-monitor配置  (163.17 KB)

docurl=/cn/Service/Document_Software/Document_Center/Routers/Catalog/SR_Router/SR8800/Configure/Operation_Manual/H3C_SR8800_CG-R3725P02-6W101/12/201601/906975_30005_0.htm

15-Host-monitor配置


1 Host-monitor

说明

l     本文中的“SPC单板”指的是单板丝印以“SPC”开头(如SPC-GP48LB)的接口板,“MPE单板”指的是单板丝印以“MPE”开头(如MPE-1004)的单板.

l     丝印为SPE-1010-II、SPE-1010-E-II、SPE-1020-II、SPE-1020-E-II的单板、SPC单板和MPE单板支持Host-monitor功能。

 

1.1  Host-monitor简介

Host-monitor(用户监控)是一种网络流量监控技术,用来监控和统计网络中用户的流量,并在此基础上将流量区分为合法流量和非法流量,为进一步进行用户上网管理提供了基础,同时通过监控网络中的非法流量,可以及时、快速地了解非法流量的来源。

1.1.1  Host-monitor的基本概念

1. 流

流是符合某类特征的报文集合。Host-monitor根据IPv4报文的源IP地址、目的IP地址、协议号、所属VPN实例、报文方向、报文流经的接口划分流。这些特征均相同的报文属于同一条流。

2. 固化表项

记录了合法数据流的关键信息以及统计信息的表项,称为固化表项。固化表项可以是流量触发生成,也可以由用户通过命令行手工添加。固化表用来保存固化表项。

固化表有两种状态:未固化状态和固化状态。在系统固化前,只有固化表,此时固化表处于未固化状态,新的数据流会触发创建新的固化表项;系统固化后,固化表处于固化状态,新的数据流将不能触发固化表项的生成。

3. 非法表项

记录了非法数据流的关键信息以及统计信息的表项,称为非法表项。非法表项由流量触发生成。非法表用来保存非法表项。非法表不影响报文的转发,网络管理员通过分析非法表决定下一步的处理。

在系统固化前,没有非法表项;系统固化后,新的不匹配固化表项的数据流会触发非法表项的生成。

1.1.2  Host-monitor的工作机制

Host-monitor的工作机制为:

(1)     开启Host-monitor功能,设备对所有流量进行流量信息的提取,并形成固化表项保存在设备上。

(2)     将系统固化。在正常情况下,设备运行一段时间后,系统的流量信息是稳定的,可以根据已经生成的固化表项来判断流量是否合法。将系统固化后,数据流进入设备时,需在这个固化表中查找是否有这条流,如果有,视为合法流量,更新固化表项中对应表项的统计信息;如果没有,则视为非法流量,非法流量触发生成非法表项。

(3)     维护固化表及清除非法表。系统固化过程完全基于设备上的流量信息,不能排除设备收集到的流量信息不全或其中有个别是存在问题的,用户能够手工添加或删除某条固化表项来保证固化表的完整、正确。另外用户还可以手工清除所有的非法表项。

说明

系统在固化之前,没有非法表,所有的数据流都被认为是合法的。

 

1.2  Host-monitor配置任务简介

Host-monitor的流量信息来源于NetStream,因此在配置Host-monitor功能之前,必须先开启Netstream功能。有关NetStream的详细介绍,请参见“网络管理和监控”中的“NetStream”。

表1-1 Host-monitor配置任务简介

配置任务

说明

详细配置

开启全局Host-monitor功能

必选

1.3.1 

系统固化

可选

1.3.2 

添加固化表项

可选

1.3.3 

删除固化表项

可选

1.3.4 

清除所有固化表项

可选

1.3.5 

清除所有非法表项

可选

1.3.6 

 

1.3  配置Host-monitor功能

在获取用户流量信息后,如果网络管理员同时还想将用户流量区分为合法流量和非法流量,了解非法流量的来源,需要配置Host-monitor功能。

1.3.1  开启全局Host-monitor功能

表1-2 开启全局Host-monitor功能

操作

命令

说明

进入系统视图

system-view

-

开启全局的Host-monitor功能

host-monitor { inbound | outbound }

必选

缺省情况下,Host-monitor功能处于关闭状态

 

1.3.2  系统固化

表1-3 系统固化

操作

命令

说明

进入系统视图

system-view

-

系统固化

host-monitor fixup [ slot slot-number ]

必选

缺省情况下,系统处于未固化状态

1.3.3  添加固化表项

表1-4 添加固化表项

操作

命令

说明

进入系统视图

system-view

-

添加固化表项

host-monitor add source source-ip destination destination-ip protocol protocol interface interface-type interface-number { inbound | outbound } [ vpn-instance vpn-instance-name ] [ slot slot-number ]

必选

 

1.3.4  删除固化表项

表1-5 删除固化表项

操作

命令

说明

进入系统视图

system-view

-

删除固化表项

host-monitor delete source source-ip destination destination-ip protocol protocol interface interface-type interface-number { inbound | outbound } [ vpn-instance vpn-instance-name ] [ slot slot-number ]

必选

 

1.3.5  清除所有固化表项

系统固化前,在用户视图下执行reset host-monitor entry命令可以清除所有固化表项。

表1-6 清除固化表项

操作

命令

说明

清除所有固化表项

reset host-monitor entry [ slot slot-number [ source-slot source-slot-number ] ]

必选

 

1.3.6  清除所有非法表项

系统固化后,在用户视图下执行reset host-monitor entry invalid命令可以清除所有非法表项。

表1-7 清除非法表项

操作

命令

说明

清除所有非法表项

reset host-monitor entry invalid [ slot slot-number [ source-slot source-slot-number ] ]

必选

 

1.4  Host-monitor显示和维护

在完成上述配置后,在任意视图下执行display命令可以显示配置Host-monitor后的运行情况,通过查看显示信息验证配置的效果。

在用户视图下执行reset命令可以清除Host-monitor固化表项的统计信息。

表1-8 Host-monitor显示和维护

操作

命令

显示Host-monitor的流表项信息

display host-monitor [ invalid ] [ verbose ] [destination ip-address | interface interface-type interface-number | source ip-address ] * [ slot slot-number ] [ | { begin | exclude | include } regular-expression ]

清除固化表项的统计信息

reset host-monitor statistics [ slot slot-number ]

 

1.5  Host-monitor典型配置举例

1.5.1  Host-monitor配置举例

1. 组网需求

图1-1所示,Router A需要监控接口GigabitEthernet2/1/1入方向的所有流量,同时将该接口上的流量区分为合法流量和非法流量,因此需要启动Host-monitor功能:在GigabitEthernet2/1/1上配置Host-monitor入统计。

Router A上4号槽位安装的单板为SPC单板、MPE单板或丝印为SPE-1010-II、SPE-1010-E-II、SPE-1020-II、SPE-1020-E-II的单板。

2. 组网图

图1-1 Host-monitor配置组网图

 

3. 配置步骤

# 配置接口GigabitEthernet2/1/1的IP地址。

<RouterA> system-view

[RouterA] interface GigabitEthernet2/1/1

[RouterA-GigabitEthernet2/1/1] ip address 21.1.1.0 255.255.255.0

[RouterA-GigabitEthernet2/1/1] quit

# 配置QoS策略,统计进入接口GigabitEthernet2/1/1的所有流量。

[RouterA] acl number 2000

[RouterA-acl-basic-2000] rule 1 permit source any

[RouterA-acl-basic-2000] quit

[RouterA] traffic classifier host-monitor

[RouterA-classifier-host-monitor] if-match acl 2000

[RouterA-classifier-host-monitor] quit

[RouterA] traffic behavior host-monitor

[RouterA-behavior-host-monitor] mirror-to interface Net-Stream 4/0/1

[RouterA-behavior-host-monitor] quit

[RouterA] qos policy host-monitor

[RouterA-qospolicy-host-monitor] classifier host-monitor behavior host-monitor

[RouterA-qospolicy-host-monitor] quit 

[Router] interface GigabitEthernet 2/1/1

[Router-GigabitEthernet2/1/1] qos apply policy host-monitor inbound

# 开启NetStream统计功能。

[RouterA] ip netstream

# 开启全局入方向的Host-monitor功能。

[RouterA] host-monitor inbound

# 查看2号接口板上生成的表项。

[RouterA] display host-monitor slot 2                                           

Total 10 flow(s) on slot 2.                                                    

State: Unfixed                                                                 

Source          Destination     Protocol Direction Interface    VPN            

-------------------------------------------------------------------------------

21.1.1.2        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.3        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.4        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.5        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.6        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.7        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.8        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.9        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.10       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.11       22.1.1.2        253      Inbound   GE2/1/1                       

# 待网络内的流量稳定后,将系统由未固化状态转为固化状态。

[RouterA] host-monitor fixup

[RouterA] display host-monitor slot 2

Total 10 flow(s) on slot 2.                                                    

State: Fixed                                                                   

Source          Destination     Protocol Direction Interface    VPN            

-------------------------------------------------------------------------------

21.1.1.2        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.3        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.4        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.5        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.6        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.7        22.1.1.2        253      Inbound   GE2/1/1                      

21.1.1.8        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.9        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.10       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.11       22.1.1.2        253      Inbound   GE2/1/1                     

# 系统固化后,有新的合法数据流或者无效的数据流,这时需要在固化表中通过命令行添加或者删除固化表项。

[RouterA] host-monitor add source 22.1.1.1 destination 21.1.1.1 protocol 255 interfa

ce GigabitEthernet2/1/1 inbound 

[RouterA] host-monitor delete source 21.1.1.10 destination 22.1.1.2 protocol 253 int

erface GigabitEthernet2/1/1 inbound

[RouterA] display host-monitor slot 2                                               

Total 10 flow(s) on slot 2.                                                    

State: Fixed                                                                   

Source          Destination     Protocol Direction Interface    VPN             

-------------------------------------------------------------------------------

22.1.1.1        21.1.1.1        255      Inbound   GE2/1/1

21.1.1.2        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.3        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.4        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.5        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.6        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.7        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.8        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.9        22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.11       22.1.1.2        253      Inbound   GE2/1/1                     

# 查看2号接口板上的非法流量。

[RouterA] display host-monitor invalid slot 2                                      

Total 10 flow(s) on slot 2.                                                    

Source          Destination     Protocol Direction Interface    VPN            

-------------------------------------------------------------------------------

21.1.1.20       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.21       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.22       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.23       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.24       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.25       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.26       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.27       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.28       22.1.1.2        253      Inbound   GE2/1/1                     

21.1.1.29       22.1.1.2        253      Inbound   GE2/1/1

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们