• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

15-網絡管理和監控命令參考

目錄

07-IP Accounting命令

本章節下載 07-IP Accounting命令  (141.44 KB)

07-IP Accounting命令


1 IP Accounting

1.1  IP Accounting配置命令

1.1.1  display ip count

【命令】      

display ip count { inbound-packets | outbound-packets } { exterior | firewall-denied | interior } [ | { begin | exclude | include } regular-expression ]

【視圖】

任意視圖

【缺省級別】

1:監控級

【參數】

inbound-packets:顯示接收的IP報文的統計信息。

outbound-packets:顯示發送的IP報文的統計信息。

exterior:顯示exterior表中的IP報文統計信息,exterior表用來記錄不符合規則的合法IP報文的統計信息。

firewall-denied:顯示被防火牆拒絕的IP報文的統計信息。

interior:顯示interior表中的IP報文統計信息,interior表用來記錄符合規則的合法IP報文的統計信息。

當接口上沒有配置防火牆時,合法報文是指所有進出接口的IP報文;當接口上配置了防火牆時,合法報文是指通過了防火牆的IP報文。

 

|:使用正則表達式對顯示信息進行過濾。有關正則表達式的詳細介紹,請參見“基礎配置指導”中的“CLI”。

begin:從包含指定正則表達式的行開始顯示。

exclude:隻顯示不包含指定正則表達式的行。

include:隻顯示包含指定正則表達式的行。

regular-expression:表示正則表達式,為1~256個字符的字符串,區分大小寫。

【描述】

display ip count命令用來顯示IP Accounting統計的IP報文信息。

【舉例】

# 顯示接收的合法IP報文中,不符合規則的IP報文的統計信息。

<Sysname> display ip count inbound-packets exterior

6 Inbound streams information in exterior list:

  SrcIP            DstIP               Protocol  Pkts        Bytes

  0.0.0.0          255.255.255.255     UDP       28          9502

  10.153.72.181    10.153.73.255       UDP       174         38034

  10.153.72.137    239.255.255.250     UDP       4           644

  10.153.72.141    224.0.0.2           IGMP      4           128

  10.153.72.141    224.0.0.9           UDP       4           208

  10.153.72.141    224.0.0.9           IGMP      4           128

表1-1 display ip count命令顯示信息描述表

字段

描述

SrcIP

報文源IP地址

DstIP

報文目的IP地址

Protocol

報文的協議類型

Pkts

報文個數

Bytes

報文字節數

 

1.1.2  display ip count rule

【命令】

display ip count rule [ | { begin | exclude | include } regular-expression ]

【視圖】

任意視圖

【缺省級別】

1:監控級

【參數】

|:使用正則表達式對顯示信息進行過濾。有關正則表達式的詳細介紹,請參見“基礎配置指導”中的“CLI”。

begin:從包含指定正則表達式的行開始顯示。

exclude:隻顯示不包含指定正則表達式的行。

include:隻顯示包含指定正則表達式的行。

regular-expression:表示正則表達式,為1~256個字符的字符串,區分大小寫。

【描述】

display ip count rule命令用來顯示用戶配置的IP Accounting統計規則。

【舉例】

# 顯示用戶配置的IP Accounting統計規則。

<Sysname> display ip count rule

  IP Count rule list:

          IP address     address mask

             1.1.1.0    255.255.255.0

             2.0.0.0        255.0.0.0

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

  Total: 2 rules

表1-2 display ip count rule命令顯示信息描述表

字段

描述

IP address

網段地址

address mask

網絡掩碼

 

1.1.3  ip count enable

【命令】

ip count enable

undo ip count enable

【視圖】

係統視圖

【缺省級別】

2:係統級

【參數】

【描述】

ip count enable命令用來啟動IP Accounting報文統計功能。undo ip count enable命令用來取消IP Accounting報文統計功能。

缺省情況下,沒有啟動IP Accounting報文統計功能。

【舉例】

# 啟動IP Accounting報文統計功能。

<Sysname> system-view

[Sysname] ip count enable

1.1.4  ip count exterior-threshold

【命令】

ip count exterior-threshold number

undo ip count exterior-threshold

【視圖】

係統視圖

【缺省級別】

2:係統級

【參數】

number:exterior表中流記錄個數,取值範圍為0~8192。

【描述】

ip count exterior-threshold命令用來設置exterior統計表中流記錄個數的最大值。undo ip count exterior-threshold用來將exterior統計表中流記錄個數的最大值恢複為缺省值(如果該表中已經存在流記錄,則係統會提示用戶清空此表後再設置)。

缺省情況下,exterior統計表中流記錄個數的最大值為0,即係統不統計不符合IP Accounting統計規則的合法IP報文的信息。

【舉例】

# 設置exterior統計表中流記錄個數的最大值為100。

<Sysname> system-view

[Sysname] ip count exterior-threshold 100

1.1.5  ip count firewall-denied

【命令】

ip count firewall-denied { inbound-packets | outbound-packets }

undo ip count firewall-denied { inbound-packets | outbound-packets }

【視圖】

接口視圖

【缺省級別】

2:係統級

【參數】

inbound-packets:統計在當前接口上被防火牆拒絕接收的IP報文信息。

outbound-packets:統計在當前接口上被防火牆拒絕發送的IP報文信息。

【描述】

ip count firewall-denied命令用來配置對當前接口上被防火牆拒絕的IP報文信息進行統計。undo ip count firewall-denied命令用來恢複缺省情況。

缺省情況下,不統計被防火牆拒絕的IP報文信息。

通過在接口上使用上述命令,可以使IP Accounting特性對被防火牆拒絕接收或者發送的IP報文信息進行統計。對於統計的接收和發送的IP報文信息,統一存放在firewall-denied table中。

【舉例】

# 啟動對接口Ethernet1/1上被防火牆拒絕發送的IP報文信息的統計。

<Sysname> system-view

[Sysname] interface ethernet 1/1

[Sysname-Ethernet1/1] ip count firewall-denied outbound-packets

# 取消對接口Ethernet1/1上被防火牆拒絕發送的IP報文信息的統計。

<Sysname> system-view

[Sysname] interface ethernet 1/1

[Sysname-Ethernet1/1] undo ip count firewall-denied outbound-packets

1.1.6  ip count inbound-packets

【命令】

ip count inbound-packets

undo ip count inbound-packets

【視圖】

接口視圖

【缺省級別】

2:係統級

【參數】

【描述】

ip count inbound-packets命令用來配置對當前接口接收的合法IP報文信息進行統計。undo ip count inbound-packets命令用來恢複缺省情況。

缺省情況下,不統計接口接收到的合法IP報文信息。

通過在接口上使用ip count inbound-packets命令,可以使IP Accounting特性對接口接收到的合法IP報文信息進行統計,對於接收到的合法IP報文信息,根據是否匹配IP Accounting統計規則,將IP報文信息存儲在interior表或者exterior表中。

當接口上沒有配置防火牆時,合法報文是指所有進出接口的IP報文;當接口上配置了防火牆時,合法報文是指通過了防火牆的IP報文。

 

【舉例】

# 啟動對Ethernet1/1接收的合法IP報文信息的統計。

<Sysname> system-view

[Sysname] interface ethernet 1/1

[Sysname-Ethernet1/1] ip count inbound-packets

# 取消對Ethernet1/1接收的合法IP報文信息的統計。

<Sysname> system-view

[Sysname] interface ethernet 1/1

[Sysname-Ethernet1/1] undo ip count inbound-packets

1.1.7  ip count interior-threshold

【命令】

ip count interior-threshold number

undo ip count interior-threshold

【視圖】

係統視圖

【缺省級別】

2:係統級

【參數】

number:interior表中流記錄個數,取值範圍為0~16384。

【描述】

ip count interior-threshold命令用來設置interior統計表中流記錄個數的最大值。undo ip count interior-threshold命令用來將interior統計表中流記錄個數的最大值恢複為缺省值(如果表中已經存在的流記錄個數大於缺省值,則提示用戶清空此表後再設置)。

缺省情況下,interior統計表中流記錄個數的最大值為512。

【舉例】

# 設置interior統計表中流記錄個數的最大值為1000。

<Sysname> system-view

[Sysname] ip count interior-threshold 1000

1.1.8  ip count outbound-packets

【命令】

ip count outbound-packets

undo ip count outbound-packets

【視圖】

接口視圖

【缺省級別】

2:係統級

【參數】

【描述】

ip count outbound-packets命令用來配置對當前接口發送的合法IP報文信息進行統計。undo ip count outbound-packets命令用來恢複缺省情況。

缺省情況下,不統計接口發送的合法IP報文信息。

通過在接口上使用本命令,可以使IP Accounting特性對接口發送的合法IP報文信息進行統計。對於發送的合法IP報文信息,根據是否匹配規則,將IP報文信息存儲在interior表或者exterior表中。

【舉例】

# 啟動對Ethernet1/1發送的合法IP報文信息的統計。

<Sysname> system-view

[Sysname] interface ethernet 1/1

[Sysname-Ethernet1/1] ip count outbound-packets

1.1.9  ip count rule

【命令】

ip count rule ip-address { mask | mask-length }

undo ip count rule [ ip-address { mask | mask-length } ]

【視圖】

係統視圖

【缺省級別】

2:係統級

【參數】

ip-address:IP地址。

mask:網絡掩碼。

mask-length:網絡掩碼的長度,取值範圍為0~32。

【描述】

ip count rule命令用來配置IP Accounting統計的匹配規則。undo ip count rule命令用來刪除已經配置的匹配規則,如果不帶參數則刪除所有已經配置的IP Accounting統計規則。

用戶配置的規則由一個IP地址和相應的掩碼組成,規則表中記錄的是IP地址和其掩碼相“與”的結果,即網段的地址。對於通過了接口(當接口沒有配置防火牆時)或者接口上防火牆(當接口配置了防火牆時)的IP報文,如果IP報文的源IP地址或目的IP地址中隻要有一個匹配規則中的網段地址,就將該報文信息記錄在“符合規則的報文統計表(interior table)”中,否則就記錄在“不符合規則的報文統計表(exterior table)”中。

需要注意的是:

·     用戶最多可以配置32條規則。

·     如果不配置規則,則認為當前流都是用戶不關心的,統計到exterior表裏。

【舉例】

# 配置IP Accounting統計的匹配規則。

<Sysname> system-view

[Sysname] ip count rule 169.254.10.1 255.255.0.0

1.1.10  ip count timeout

【命令】

ip count timeout minutes

undo ip count timeout

【視圖】

係統視圖

【缺省級別】

2:係統級

【參數】

minutes:統計表中流記錄的老化時間,取值範圍為60~10080,單位為分鍾。

【描述】

ip count timeout命令用來配置IP Accounting統計表中流記錄的老化時間。undo ip count timeout命令用來恢複老化時間為缺省值。

缺省情況下,IP Accounting統計表中流記錄的老化時間為720分鍾(即12小時)。

如果某一統計表中流記錄信息在老化時間內沒有更新,則IP Accounting特性認為該信息已經超時,將其刪除。

【舉例】

# 設置IP Accounting表中流記錄的老化時間為100分鍾。

<Sysname> system-view

[Sysname] ip count timeout 100

1.1.11  reset ip count

【命令】

reset ip count { all | exterior | firewall | interior }

【視圖】

用戶視圖

【缺省級別】

2:係統級

【參數】

all:清除所有的統計信息。

firewall:清除firewall-denied表中的IP報文統計信息。

exterior:清除exterior表中的IP報文統計信息。

interior:清除interior表中的IP報文統計信息。

【描述】

reset ip count命令用來清除IP Accounting已有的IP報文統計信息。

【舉例】

# 清除所有的IP報文統計信息。

<Sysname> reset ip count all

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們