15-Host-monitor配置
本章节下载 (148.82 KB)
目 录
Host-monitor(用户监控)是一种网络流量监控技术,用来监控和统计网络中用户的流量,并在此基础上将流量区分为合法流量和非法流量,为进一步进行用户上网管理提供了基础,同时通过监控网络中的非法流量,可以及时、快速地了解非法流量的来源。
流是符合某类特征的报文集合。Host-monitor根据IPv4报文的源IP地址、目的IP地址、协议号、所属VPN实例、报文方向、报文流经的接口划分流。这些特征均相同的报文属于同一条流。
记录了合法数据流的关键信息以及统计信息的表项,称为固化表项。固化表项可以是流量触发生成,也可以由用户通过命令行手工添加。固化表用来保存固化表项。
固化表有两种状态:未固化状态和固化状态。在系统固化前,只有固化表,此时固化表处于未固化状态,新的数据流会触发创建新的固化表项;系统固化后,固化表处于固化状态,新的数据流将不能触发固化表项的生成。
记录了非法数据流的关键信息以及统计信息的表项,称为非法表项。非法表项由流量触发生成。非法表用来保存非法表项。非法表不影响报文的转发,网络管理员通过分析非法表决定下一步的处理。
在系统固化前,没有非法表项;系统固化后,新的不匹配固化表项的数据流会触发非法表项的生成。
Host-monitor的工作机制为:
(1) 开启Host-monitor功能,设备对所有流量进行流量信息的提取,并形成固化表项保存在设备上。
(2) 将系统固化。在正常情况下,设备运行一段时间后,系统的流量信息是稳定的,可以根据已经生成的固化表项来判断流量是否合法。将系统固化后,数据流进入设备时,需在这个固化表中查找是否有这条流,如果有,视为合法流量,更新固化表项中对应表项的统计信息;如果没有,则视为非法流量,非法流量触发生成非法表项。
(3) 维护固化表及清除非法表。系统固化过程完全基于设备上的流量信息,不能排除设备收集到的流量信息不全或其中有个别是存在问题的,用户能够手工添加或删除某条固化表项来保证固化表的完整、正确。另外用户还可以手工清除所有的非法表项。
系统在固化之前,没有非法表,所有的数据流都认为是合法的。
Host-monitor的流量信息来源于NetStream,因此在配置Host-monitor功能之前,必须先开启Netstream功能。有关NetStream的详细介绍,请参见“网络管理和监控”中的“NetStream”。
表1-1 Host-monitor配置任务简介
配置任务 |
说明 |
详细配置 |
开启Host-monitor功能 |
必选 |
|
系统固化 |
可选 |
|
添加固化表项 |
可选 |
|
删除固化表项 |
可选 |
|
清除所有处于未固化状态的固化表项 |
可选 |
|
清除所有非法表项 |
可选 |
在获取用户流量信息后,如果网络管理员同时还想将用户流量区分为合法流量和非法流量,了解非法流量的来源,需要配置Host-monitor功能。
表1-2 开启全局Host-monitor功能
操作 |
命令 |
说明 |
进入系统视图 |
system-view |
- |
开启全局的Host-monitor功能 |
host-monitor { inbound | outbound } |
必选 缺省情况下,Host-monitor功能处于关闭状态 Host-monitor功能的开启方向与NetStream功能的开启方向必须一致 |
表1-3 系统固化
操作 |
命令 |
说明 |
进入系统视图 |
system-view |
- |
系统固化(非IRF模式) |
host-monitor fixup [ slot slot-number ] |
必选 缺省情况下,系统处于未固化状态 |
系统固化(IRF模式) |
host-monitor fixup [ chassis chassis-number slot slot-number ] |
必选 缺省情况下,系统处于未固化状态 |
表1-4 添加固化表项
操作 |
命令 |
说明 |
进入系统视图 |
system-view |
- |
添加固化表项(非IRF模式) |
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 ] |
必选 |
添加固化表项(IRF模式) |
host-monitor add source source-ip destination destination-ip protocol protocol interface interface-type interface-number { inbound | outbound } [ vpn-instance vpn-instance-name ] [ chassis chassis-number slot slot-number ] |
必选 |
表1-5 删除固化表项
操作 |
命令 |
说明 |
进入系统视图 |
system-view |
- |
删除固化表项(非IRF模式) |
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 ] |
必选 |
删除固化表项(IRF模式) |
host-monitor delete source source-ip destination destination-ip protocol protocol interface interface-type interface-number } { inbound | outbound } [ vpn-instance vpn-instance-name ] [ chassis chassis-number slot slot-number ] |
必选 |
系统固化前,在用户视图下执行reset host-monitor entry命令可以清除所有处于未固化状态的固化表项。
表1-6 清除处于未固化状态的固化表项
操作 |
命令 |
说明 |
清除所有处于未固化状态的固化表项(非IRF模式-SR6602) |
reset host-monitor entry |
必选 |
清除所有处于未固化状态的固化表项(非IRF模式-SR6602-X/SR6604/SR6608/SR6616) |
reset host-monitor entry [ slot slot-number [ source-slot source-slot-number ] ] |
必选 |
清除所有处于未固化状态的固化表项(IRF模式) |
reset host-monitor entry [ chassis chassis-number slot slot-number [ source-slot source-slot-number ] ] |
必选 |
系统固化后,在用户视图下执行reset host-monitor entry invalid命令可以清除所有非法表项。
表1-7 清除非法表项
操作 |
命令 |
说明 |
清除所有非法表项(非IRF模式-SR6602) |
reset host-monitor entry invalid |
必选 |
清除所有非法表项(非IRF模式-SR6602-X/SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X) |
reset host-monitor entry invalid [ slot slot-number ] |
必选 |
清除所有非法表项(IRF模式) |
reset host-monitor entry invalid [ chassis chassis-number slot slot-number ] |
必选 |
在完成上述配置后,在任意视图下执行display命令可以显示配置Host-monitor后的运行情况,通过查看显示信息验证配置的效果。
在用户视图下执行reset命令可以清除Host-monitor固化表项的统计信息。
表1-8 Host-monitor显示和维护
操作 |
命令 |
显示Host-monitor的流表项信息(非IRF模式-SR6602) |
display host-monitor [ invalid ] [ verbose ] [ destination ip-address | interface interface-type interface-number | source ip-address ] * [ | { begin | exclude | include } regular-expression ] |
显示Host-monitor的流表项信息(非IRF模式-SR6602-X/SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X) |
display host-monitor [ invalid ] [ verbose ] [ destination ip-address | interface interface-type interface-number | source ip-address ] * [ slot slot-number ] [ | { begin | exclude | include } regular-expression ] |
显示Host-monitor的流表项信息(IRF模式) |
display host-monitor [ invalid ] [ verbose ] [ destination ip-address | interface interface-type interface-number | source ip-address ] * [ chassis chassis-number slot slot-number ] [ | { begin | exclude | include } regular-expression ] |
清除固化表项的统计信息(非IRF模式-SR6602) |
reset host-monitor statistics |
清除固化表项的统计信息(非IRF模式-SR6602-X/SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X) |
reset host-monitor statistics [ slot slot-number ] |
清除固化表项的统计信息(IRF模式) |
reset host-monitor statistics [ chassis chassis-number slot slot-number ] |
如图1-1所示,Router需要监控端口GigabitEthernet2/1/1入方向,以及端口GigabitEthernet2/1/2出方向的用户流量,
同时将这两个接口上的流量区分为合法流和非法流,因此需要启动Host-monitor功能。
图1-1 配置Host-monitor功能的组网图
# 配置GigabitEthernet2/1/1的IP地址。
<Router> system-view
[Router] interface gigabitethernet 2/1/1
[Router-GigabitEthernet2/1/1] ip address 192.168.40.1 255.255.255.0
[Router-GigabitEthernet2/1/1] quit
# 配置GigabitEthernet2/1/2的IP地址。
[Router] interface gigabitethernet 2/1/2
[Router-GigabitEthernet2/1/2] ip address 192.168.80.1 255.255.255.0
[Router-GigabitEthernet2/1/2] quit
# 在系统视图下配置Host-monitor统计功能。
[Router] host-monitor inbound
[Router] host-monitor outbound
# 显示所有学习到的表项的简要信息。
[Router] display host-monitor
Total 9 flow(s).
State: Unfixed
Source Destination Protocol Direction Interface VPN
-------------------------------------------------------------------------------
192.168.1.102 192.168.1.255 17 Inbound GE2/1/1
192.168.1.1 239.255.255.250 17 Inbound GE2/1/1
192.168.20.65 239.255.255.250 17 Inbound GE2/1/1
56.56.56.44 224.0.0.5 89 Inbound GE2/1/1
192.168.20.167 192.168.20.255 17 Inbound GE2/1/1
192.168.20.170 192.168.20.255 17 Inbound GE2/1/1
192.168.20.191 192.168.20.255 17 Inbound GE2/1/1
192.168.80.133 192.168.80.131 1 Outbound GE2/1/2
40.0.0.3 40.0.0.255 17 Inbound GE2/1/1
# 待网络内的流量稳定后,将系统由未固化状态转为固化状态。
[Router] host-monitor fixup
# 系统固化后,可能有新的合法数据流,这时需要在固化表中通过命令行添加固化表项。
[Router] host-monitor add source 192.168.40.2 destination 192.168.80.2 protocol 17 interface gigabitethernet 2/1/1 inbound
[Router] host-monitor add source 192.168.40.2 destination 192.168.80.2 protocol 17 interface gigabitethernet 2/1/2 outbound
# 系统固化后,固化表中存在某个无效的固化表项,通过命令行删除该固化表项。
[Router] host-monitor delete source 40.0.0.3 destination 40.0.0.255 protocol 17 interface gigabitethernet 2/1/1 inbound
# 显示此时固化表项的简要信息。
[Router] display host-monitor
Total 10 flow(s).
State: Fixed
Source Destination Protocol Direction Interface VPN
-------------------------------------------------------------------------------
192.168.1.102 192.168.1.255 17 Inbound GE2/1/1
192.168.1.1 239.255.255.250 17 Inbound GE2/1/1
192.168.20.65 239.255.255.250 17 Inbound GE2/1/1
56.56.56.44 224.0.0.5 89 Inbound GE2/1/1
192.168.20.167 192.168.20.255 17 Inbound GE2/1/1
192.168.20.170 192.168.20.255 17 Inbound GE2/1/1
192.168.20.191 192.168.20.255 17 Inbound GE2/1/1
192.168.40.2 192.168.80.2 17 Inbound GE2/1/1
192.168.40.2 192.168.80.2 17 Outbound GE2/1/2
192.168.80.133 192.168.80.131 1 Outbound GE2/1/2
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!
本站点使用Cookies,继续浏览表示您同意我们使用Cookies。 Cookies和隐私政策>