No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuration Examples

Configuration Examples

This chapter provides examples for configuring original, aggregation, and flexible NetStream. You can comprehend the configuration procedures using the configuration flowchart. The configuration examples explain networking requirements, configuration notes, and configuration roadmap.

Example for Configuring Original Flow Statistics Exporting

Networking Requirements

As shown in Figure 14-52, Department 1 and Department 2 connect to the Internet through Switch ModuleA. Network administrators want to collect statistics about traffic between the two departments and the Internet for network planning.

Figure 14-52 NetStream networking diagram
Configuration Roadmap

You can configure IPv4 original flow statistics exporting on 10GE1/17/1 of Switch ModuleA. Configure Switch ModuleA to collect statistics about incoming and outgoing traffic on the interface, and to send the statistics to the NetStream server for further analysis. The analysis result helps you plan the network.

The configuration roadmap is as follows:

  1. Configure IP addresses for the interfaces on Switch ModuleA.
  2. Configure NetStream sampling.
  3. Configure NetStream flow aging.
  4. Configure original flow statistics exporting.
  5. Configure the version for exported packets.
  6. Enable original flow statistics collection on interfaces.

Procedure

  1. Configure IP addresses for the interfaces on Switch ModuleA according to Figure 14-52.

    # Assign IP addresses to the interfaces of Switch ModuleA.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 110
    [*Switch ModuleA-vlan110] quit
    [*Switch ModuleA] interface vlanif 110
    [*Switch ModuleA-Vlanif110] ip address 10.1.1.1 24
    [*Switch ModuleA-Vlanif110] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk pvid vlan 110
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 110
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] vlan 120
    [*Switch ModuleA-vlan120] quit
    [*Switch ModuleA] interface vlanif 120
    [*Switch ModuleA-Vlanif120] ip address 10.1.2.1 24
    [*Switch ModuleA-Vlanif120] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk pvid vlan 120
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 120
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] vlan 130
    [*Switch ModuleA-vlan130] quit
    [*Switch ModuleA] interface vlanif 130
    [*Switch ModuleA-Vlanif130] ip address 10.1.3.1 24
    [*Switch ModuleA-Vlanif130] quit
    [*Switch ModuleA] interface 10ge 1/17/3
    [*Switch ModuleA-10GE1/17/3] port link-type trunk
    [*Switch ModuleA-10GE1/17/3] port trunk pvid vlan 130
    [*Switch ModuleA-10GE1/17/3] port trunk allow-pass vlan 130
    [*Switch ModuleA-10GE1/17/3] quit
    [*Switch ModuleA] vlan 140
    [*Switch ModuleA-vlan140] quit
    [*Switch ModuleA] interface vlanif 140
    [*Switch ModuleA-Vlanif140] ip address 10.1.4.1 24
    [*Switch ModuleA-Vlanif140] quit
    [*Switch ModuleA] interface 10ge 1/17/4
    [*Switch ModuleA-10GE1/17/4] port link-type trunk
    [*Switch ModuleA-10GE1/17/4] port trunk pvid vlan 140
    [*Switch ModuleA-10GE1/17/4] port trunk allow-pass vlan 140
    [*Switch ModuleA-10GE1/17/4] quit
    

  2. Configure NetStream sampling.

    # Configure NetStream sampling for the incoming and outgoing packets on 10GE1/17/1 and set the sampling interval to 1200.

    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 inbound
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 outbound
    [*Switch ModuleA-10GE1/17/1] quit
    

  3. Configure NetStream flow aging.

    # Set the inactive aging time to 100 seconds and enable FIN- and RST-based aging.

    [*Switch ModuleA] netstream timeout ip inactive 100
    [*Switch ModuleA] netstream timeout ip tcp-session

  4. Configure NetStream original flow statistics exporting.

    # Set the source IP address of the exported packets carrying original flow statistics to 10.1.2.1, destination IP address to 10.1.2.2, and destination port number to 6000.

    [*Switch ModuleA] netstream export ip source 10.1.2.1
    [*Switch ModuleA] netstream export ip host 10.1.2.2 6000

  5. Configure the version for exported packets.

    # Set the version of exported packets to V9.

    [*Switch ModuleA] netstream export ip version 9

  6. Enable original flow statistics collection on the interface.

    # Enable NetStream statistics collection on 10GE1/17/1 for incoming and outgoing packets.

    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] netstream outbound ip
    [*Switch ModuleA-10GE1/17/1] netstream inbound ip
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] commit

  7. Verify the configuration.

    # View flow statistics.

    [~Switch ModuleA] display netstream statistics ip slot 1
     Time statistics were last cleared: -                                           
     -------------------------------------------------------------------------------
     Packet Length    : Number                                     
     ------------------------------------                                           
     1      ~    64   : 0                                                          
     65     ~    128  : 12                                                           
     129    ~    256  : 0                                                           
     257    ~    512  : 0                                                           
     513    ~    1024 : 0                                                           
     1025   ~    1500 : 0                                                           
     longer than 1500 : 0                                                           
     -------------------------------------------------------------------------------
     StreamType                                                                     
          Current           Aged        Created       Exported       Exported       
          (streams)         (streams)   (streams)     (streams)      (Packets)      
     -------------------------------------------------------------------------------
     origin                                                                         
                1              3              3              3              3       
    -------------------------------------------------------------------------------
     as                                                                             
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     as-tos                                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     protocol-port                                                                  
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     protocol-port-tos                                                              
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-prefix                                                                  
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-prefix-tos                                                              
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     destination-prefix                                                             
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     destination-prefix-tos                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     prefix                                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     prefix-tos                                                                     
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     vlan-id                                                                        
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     bgp-nexthop-tos                                                                
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     index-tos                                                                      
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-index-tos                                                               
                0              0              0              0              0       
     -------------------------------------------------------------------------------

Configuration Files

Configuration file of Switch ModuleA

#                                                                               
sysname Switch ModuleA 
#                                                                               
vlan batch 110 120 130 140 
# 
netstream timeout ip inactive 100                                               
netstream timeout ip tcp-session 
netstream export ip version 9
netstream export ip source 10.1.2.1
netstream export ip host 10.1.2.2 6000
#
interface Vlanif110                                                             
 ip address 10.1.1.1 255.255.255.0 
#                                                                               
interface Vlanif120                                                             
 ip address 10.1.2.1 255.255.255.0 
#                                                                               
interface Vlanif130                                                             
 ip address 10.1.3.1 255.255.255.0 
#                                                                               
interface Vlanif140                                                             
 ip address 10.1.4.1 255.255.255.0 
#                                                                               
interface 10GE1/17/1                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 110                                                       
 port trunk allow-pass vlan 110 
 netstream inbound ip                                                           
 netstream outbound ip                                                          
 netstream sampler random-packets 1200 inbound                                  
 netstream sampler random-packets 1200 outbound  
#                                                                               
interface 10GE1/17/2                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 120                                                       
 port trunk allow-pass vlan 120  
#                                                                               
interface 10GE1/17/3                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 130                                                       
 port trunk allow-pass vlan 130 
#                                                                               
interface 10GE1/17/4                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 140                                                       
 port trunk allow-pass vlan 140 
#
return

Example for Configuring Aggregation Flow Statistics Exporting

Networking Requirements

As shown in Figure 14-53, Department 1 and Department 2 connect to the Internet through Switch ModuleA. Network administrators want to obtain key information exchange between the two departments and the Internet to understand communication status and traffic sources.

Figure 14-53 NetStream networking diagram
Configuration Roadmap

You can configure IPv4 aggregation flow statistics exporting on 10GE1/17/1 of Switch ModuleA. Configure Switch ModuleA to collect statistics about incoming and outgoing traffic on the interface, and to send the statistics to the NetStream server for further analysis. The analysis result helps you understand communication status and traffic sources.

The configuration roadmap is as follows:

  1. Configure IP addresses for the interfaces on Switch ModuleA.
  2. Configure NetStream sampling.
  3. Configure NetStream aggregation flow statistics exporting.
  4. Configure the version for exported packets.
  5. Enable aggregation flow statistics collection on interfaces.

Procedure

  1. Configure IP addresses for the interfaces on Switch ModuleA according to Figure 14-53.

    # Assign IP addresses to the interfaces of Switch ModuleA.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 110
    [*Switch ModuleA-vlan110] quit
    [*Switch ModuleA] interface vlanif 110
    [*Switch ModuleA-Vlanif110] ip address 10.1.1.1 24
    [*Switch ModuleA-Vlanif110] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk pvid vlan 110
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 110
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] vlan 120
    [*Switch ModuleA-vlan120] quit
    [*Switch ModuleA] interface vlanif 120
    [*Switch ModuleA-Vlanif120] ip address 10.1.2.1 24
    [*Switch ModuleA-Vlanif120] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk pvid vlan 120
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 120
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] vlan 130
    [*Switch ModuleA-vlan130] quit
    [*Switch ModuleA] interface vlanif 130
    [*Switch ModuleA-Vlanif130] ip address 10.1.3.1 24
    [*Switch ModuleA-Vlanif130] quit
    [*Switch ModuleA] interface 10ge 1/17/3
    [*Switch ModuleA-10GE1/17/3] port link-type trunk
    [*Switch ModuleA-10GE1/17/3] port trunk pvid vlan 130
    [*Switch ModuleA-10GE1/17/3] port trunk allow-pass vlan 130
    [*Switch ModuleA-10GE1/17/3] quit
    [*Switch ModuleA] vlan 140
    [*Switch ModuleA-vlan140] quit
    [*Switch ModuleA] interface vlanif 140
    [*Switch ModuleA-Vlanif140] ip address 10.1.4.1 24
    [*Switch ModuleA-Vlanif140] quit
    [*Switch ModuleA] interface 10ge 1/17/4
    [*Switch ModuleA-10GE1/17/4] port link-type trunk
    [*Switch ModuleA-10GE1/17/4] port trunk pvid vlan 140
    [*Switch ModuleA-10GE1/17/4] port trunk allow-pass vlan 140
    [*Switch ModuleA-10GE1/17/4] quit
    

  2. Configure NetStream sampling.

    # Configure NetStream sampling for the incoming and outgoing packets on 10GE1/17/1 and set the sampling interval to 1200.

    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 inbound
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 outbound
    [*Switch ModuleA-10GE1/17/1] quit
    

  3. Configure NetStream aggregation flow statistics exporting.

    # Configure the protocol-port aggregation, and set the source IP address of the exported packets to 10.1.2.1, destination IP address to 10.1.2.2, and destination port number to 6000.

    [*Switch ModuleA] netstream aggregation ip protocol-port
    [*Switch ModuleA-netstream-aggregation-protport] netstream export ip source 10.1.2.1
    [*Switch ModuleA-netstream-aggregation-protport] netstream export ip host 10.1.2.2 6000
    [*Switch ModuleA-netstream-aggregation-protport] enable
    

  4. Configure the version for exported packets.

    # Set the version of the exported packets carrying aggregation flow statistics to V9.

    [*Switch ModuleA-netstream-aggregation-protport] export version 9
    [*Switch ModuleA-netstream-aggregation-protport] quit

  5. Enable aggregation flow statistics collection on the interface.

    # Enable NetStream statistics collection on 10GE1/17/1 for incoming and outgoing packets.

    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] netstream inbound ip 
    [*Switch ModuleA-10GE1/17/1] netstream outbound ip 
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] commit

  6. Verify the configuration.

    # View flow statistics.

    [~Switch ModuleA] display netstream statistics ip slot 1
     Time statistics were last cleared: 2013-10-11 14:11:52                         
     -------------------------------------------------------------------------------
     Packet Length    : Number                                                      
     -------------------------------------------------------------------------------
     1      ~    64   : 0                                                           
     65     ~    128  : 439                                                         
     129    ~    256  : 0                                                           
     257    ~    512  : 0                                                           
     513    ~    1024 : 0                                                           
     1025   ~    1500 : 0                                                           
     longer than 1500 : 0                                                           
     -------------------------------------------------------------------------------
     StreamType                                                                     
          Current           Aged        Created       Exported       Exported       
          (streams)         (streams)   (streams)     (streams)      (Packets)      
     -------------------------------------------------------------------------------
     origin                                                                         
                4              3              3              0              0       
     -------------------------------------------------------------------------------
     as                                                                             
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     as-tos                                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     protocol-port                                                                  
                3              0              3              0              0       
     -------------------------------------------------------------------------------
     protocol-port-tos                                                              
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-prefix                                                                  
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-prefix-tos                                                              
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     destination-prefix                                                             
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     destination-prefix-tos                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     prefix                                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     prefix-tos                                                                     
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     vlan-id                                                                        
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     bgp-nexthop-tos                                                                
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     index-tos                                                                      
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-index-tos                                                               
                0              0              0              0              0       
     -------------------------------------------------------------------------------

Configuration Files

Configuration file of Switch ModuleA

#                                                                               
sysname Switch ModuleA 
#                                                                               
vlan batch 110 120 130 140 
#                                                                               
interface Vlanif110                                                             
 ip address 10.1.1.1 255.255.255.0 
#                                                                               
interface Vlanif120                                                             
 ip address 10.1.2.1 255.255.255.0 
#                                                                               
interface Vlanif130                                                             
 ip address 10.1.3.1 255.255.255.0 
#                                                                               
interface Vlanif140                                                             
 ip address 10.1.4.1 255.255.255.0 
#                                                                                
interface 10GE1/17/1                                                 
 port link-type trunk                                                           
 port trunk pvid vlan 110                                                       
 port trunk allow-pass vlan 110 
 netstream inbound ip 
 netstream outbound ip 
 netstream sampler random-packets 1200 inbound           
 netstream sampler random-packets 1200 outbound 
#                                                                               
interface 10GE1/17/2                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 120                                                       
 port trunk allow-pass vlan 120  
#                                                                               
interface 10GE1/17/3                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 130                                                       
 port trunk allow-pass vlan 130 
#                                                                               
interface 10GE1/17/4                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 140                                                       
 port trunk allow-pass vlan 140 
#                                                                               
netstream aggregation ip protocol-port                                          
 enable                                                                         
 export version 9                                                               
 netstream export ip source 10.1.2.1                                            
 netstream export ip host 10.1.2.2 6000    
#
return

Example for Configuring Flexible Flow Statistics Exporting

Networking Requirements

As shown in Figure 14-54, Department 1 and Department 2 connect to the Internet through Switch ModuleA. Network administrators want to monitor communication between departments and the Internet and the websites often visited by the two departments.

Figure 14-54 NetStream networking diagram
Configuration Roadmap

You can configure IPv4 flexible flow statistics exporting on 10GE1/17/1 of Switch ModuleA. Configure Switch ModuleA to collect statistics about incoming and outgoing traffic on the interface, and to send the statistics to the NetStream server for further analysis. The analysis result helps you monitor the websites often visited by the two departments.

The configuration roadmap is as follows:

  1. Configure IP addresses for the interfaces on Switch ModuleA.
  2. Configure a flexible flow statistics template.
  3. Configure NetStream sampling.
  4. Configure NetStream flexible flow statistics exporting.
  5. Configure the version for exported packets.
  6. Enable flexible flow statistics collection on interfaces.

Procedure

  1. Configure IP addresses for the interfaces on Switch ModuleA according to Figure 14-54.

    # Assign IP addresses to the interfaces of Switch ModuleA.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 110
    [*Switch ModuleA-vlan110] quit
    [*Switch ModuleA] interface vlanif 110
    [*Switch ModuleA-Vlanif110] ip address 10.1.1.1 24
    [*Switch ModuleA-Vlanif110] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk pvid vlan 110
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 110
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] vlan 120
    [*Switch ModuleA-vlan120] quit
    [*Switch ModuleA] interface vlanif 120
    [*Switch ModuleA-Vlanif120] ip address 10.1.2.1 24
    [*Switch ModuleA-Vlanif120] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk pvid vlan 120
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 120
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] vlan 130
    [*Switch ModuleA-vlan130] quit
    [*Switch ModuleA] interface vlanif 130
    [*Switch ModuleA-Vlanif130] ip address 10.1.3.1 24
    [*Switch ModuleA-Vlanif130] quit
    [*Switch ModuleA] interface 10ge 1/17/3
    [*Switch ModuleA-10GE1/17/3] port link-type trunk
    [*Switch ModuleA-10GE1/17/3] port trunk pvid vlan 130
    [*Switch ModuleA-10GE1/17/3] port trunk allow-pass vlan 130
    [*Switch ModuleA-10GE1/17/3] quit
    [*Switch ModuleA] vlan 140
    [*Switch ModuleA-vlan140] quit
    [*Switch ModuleA] interface vlanif 140
    [*Switch ModuleA-Vlanif140] ip address 10.1.4.1 24
    [*Switch ModuleA-Vlanif140] quit
    [*Switch ModuleA] interface 10ge 1/17/4
    [*Switch ModuleA-10GE1/17/4] port link-type trunk
    [*Switch ModuleA-10GE1/17/4] port trunk pvid vlan 140
    [*Switch ModuleA-10GE1/17/4] port trunk allow-pass vlan 140
    [*Switch ModuleA-10GE1/17/4] quit
    

  2. Configure a flexible flow statistics template.

    # Create a template named record1 to aggregate flows based on destination and source IP addresses, and configure the exported packets to include the number of octets and packets.

    [*Switch ModuleA] netstream record record1 ip
    [*Switch ModuleA-netstream-record-record1] match ip destination-address
    [*Switch ModuleA-netstream-record-record1] match ip source-address
    [*Switch ModuleA-netstream-record-record1] collect counter bytes
    [*Switch ModuleA-netstream-record-record1] collect counter packets
    [*Switch ModuleA-netstream-record-record1] quit

  3. Configure NetStream sampling.

    # Configure NetStream sampling for the incoming and outgoing packets on 10GE1/17/1 and set the sampling interval to 1200.

    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 inbound
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 outbound
    [*Switch ModuleA-10GE1/17/1] quit
    

  4. Configure NetStream flexible flow statistics exporting.

    # Set the source IP address of the exported packets carrying flexible flow statistics to 10.1.2.1, destination IP address to 10.1.2.2, and destination port number to 6000.

    [*Switch ModuleA] netstream export ip source 10.1.2.1
    [*Switch ModuleA] netstream export ip host 10.1.2.2 6000

  5. Configure the version for exported packets.

    # Set the version of exported packets to V9.

    [*Switch ModuleA] netstream export ip version 9

  6. Enable flexible flow statistics collection on the interface.

    # Enable flexible flow statistics exporting for incoming and outgoing traffic on 10GE1/17/1, and apply the flexible flow statistics template to the interface.

    [*Switch ModuleA] interface 10ge 1/17/1 
    [*Switch ModuleA-10GE1/17/1] netstream record record1 ip
    [*Switch ModuleA-10GE1/17/1] netstream inbound ip
    [*Switch ModuleA-10GE1/17/1] netstream outbound ip 
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] commit

  7. Verify the configuration.

    # View flow statistics.

    [~Switch ModuleA] display netstream statistics ip slot 1
     Time statistics were last cleared: 2013-10-11 14:21:46                         
     -------------------------------------------------------------------------------
     Packet Length    : Number                                                      
     -------------------------------------------------------------------------------
     1      ~    64   : 0                                                           
     65     ~    128  : 100                                                        
     129    ~    256  : 0                                                           
     257    ~    512  : 0                                                           
     513    ~    1024 : 0                                                           
     1025   ~    1500 : 0                                                           
     longer than 1500 : 0                                                           
     -------------------------------------------------------------------------------
     StreamType                                                                     
          Current           Aged        Created       Exported       Exported       
          (streams)         (streams)   (streams)     (streams)      (Packets)      
     -------------------------------------------------------------------------------
     origin                                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     as                                                                             
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     as-tos                                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     protocol-port                                                                  
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     protocol-port-tos                                                              
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-prefix                                                                  
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-prefix-tos                                                              
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     destination-prefix                                                             
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     destination-prefix-tos                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     prefix                                                                         
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     prefix-tos                                                                     
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     vlan-id                                                                        
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     bgp-nexthop-tos                                                                
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     index-tos                                                                      
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     source-index-tos                                                               
                0              0              0              0              0       
     -------------------------------------------------------------------------------
     record1                                                                        
                5              1              2              0              0       
     -------------------------------------------------------------------------------

Configuration Files

Configuration file of Switch ModuleA

#                                                                               
sysname Switch ModuleA 
#                                                                               
vlan batch 110 120 130 140 
#
netstream export ip version 9
netstream export ip source 10.1.2.1
netstream export ip host 10.1.2.2 6000
#                                                                               
netstream record record1 ip                                                         
 match ip source-address                                                        
 match ip destination-address
 collect counter packets                                                        
 collect counter bytes 
#                                                                               
interface Vlanif110                                                             
 ip address 10.1.1.1 255.255.255.0 
#                                                                               
interface Vlanif120                                                             
 ip address 10.1.2.1 255.255.255.0 
#                                                                               
interface Vlanif130                                                             
 ip address 10.1.3.1 255.255.255.0 
#                                                                               
interface Vlanif140                                                             
 ip address 10.1.4.1 255.255.255.0 
#                                                                             
interface 10GE1/17/1        
 port link-type trunk                                                           
 port trunk pvid vlan 110                                                       
 port trunk allow-pass vlan 110 
 netstream inbound ip 
 netstream outbound ip 
 netstream sampler random-packets 1200 inbound 
 netstream sampler random-packets 1200 outbound 
 netstream record record1 ip 
#                                                                               
interface 10GE1/17/2                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 120                                                       
 port trunk allow-pass vlan 120  
#                                                                               
interface 10GE1/17/3                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 130                                                       
 port trunk allow-pass vlan 130 
#                                                                               
interface 10GE1/17/4                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 140                                                       
 port trunk allow-pass vlan 140 
#
return

Example for Configuring Layer 2 NetStream Flow Statistics Exporting

Networking Requirements

As shown in Figure 14-55, Department 1 and Department 2 connect to the Internet through Switch ModuleA. Network administrators want to monitor communication between the two departments and the Internet, and perform accounting for each department.

Figure 14-55 NetStream networking diagram
Configuration Roadmap

You can configure Layer 2 NetStream flow statistics exporting on 10GE1/17/1 of Switch ModuleA. Configure Switch ModuleA to collect statistics about incoming and outgoing traffic on the interface, and to send the statistics to the NetStream server for further analysis. In this way, you can monitor communication between the two departments and the Internet, and perform accounting for each department.

The configuration roadmap is as follows:

  1. Configure IP addresses for the interfaces on Switch ModuleA.
  2. Configure NetStream sampling.
  3. Configure Layer 2 NetStream flow statistics exporting.
  4. Configure the version for exported packets.
  5. Enable Layer 2 statistics collection on the interface.

Procedure

  1. Configure IP addresses for the interfaces on Switch ModuleA according to Figure 14-55.

    # Assign IP addresses to the interfaces of Switch ModuleA.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 110
    [*Switch ModuleA-vlan110] quit
    [*Switch ModuleA] interface vlanif 110
    [*Switch ModuleA-Vlanif110] ip address 10.1.1.1 24
    [*Switch ModuleA-Vlanif110] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk pvid vlan 110
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 110
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] vlan 120
    [*Switch ModuleA-vlan120] quit
    [*Switch ModuleA] interface vlanif 120
    [*Switch ModuleA-Vlanif120] ip address 10.1.2.1 24
    [*Switch ModuleA-Vlanif120] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk pvid vlan 120
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 120
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] vlan 130
    [*Switch ModuleA-vlan130] quit
    [*Switch ModuleA] interface vlanif 130
    [*Switch ModuleA-Vlanif130] ip address 10.1.3.1 24
    [*Switch ModuleA-Vlanif130] quit
    [*Switch ModuleA] interface 10ge 1/17/3
    [*Switch ModuleA-10GE1/17/3] port link-type trunk
    [*Switch ModuleA-10GE1/17/3] port trunk pvid vlan 130
    [*Switch ModuleA-10GE1/17/3] port trunk allow-pass vlan 130
    [*Switch ModuleA-10GE1/17/3] quit
    [*Switch ModuleA] vlan 140
    [*Switch ModuleA-vlan140] quit
    [*Switch ModuleA] interface vlanif 140
    [*Switch ModuleA-Vlanif140] ip address 10.1.4.1 24
    [*Switch ModuleA-Vlanif140] quit
    [*Switch ModuleA] interface 10ge 1/17/4
    [*Switch ModuleA-10GE1/17/4] port link-type trunk
    [*Switch ModuleA-10GE1/17/4] port trunk pvid vlan 140
    [*Switch ModuleA-10GE1/17/4] port trunk allow-pass vlan 140
    [*Switch ModuleA-10GE1/17/4] quit
    

  2. Configure NetStream sampling.

    # Configure NetStream sampling for the incoming and outgoing packets on 10GE1/17/1 and set the sampling interval to 1200.

    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 inbound
    [*Switch ModuleA-10GE1/17/1] netstream sampler random-packets 1200 outbound
    [*Switch ModuleA-10GE1/17/1] quit
    

  3. Configure Layer 2 NetStream flow statistics exporting.

    # Set the source IP address of the exported packets carrying Layer 2 NetStream flow statistics to 10.1.2.1, destination IP address to 10.1.2.2, and destination port number to 6000.

    [*Switch ModuleA] netstream export ethernet source 10.1.2.1
    [*Switch ModuleA] netstream export ethernet host 10.1.2.2 6000

  4. Configure the version for exported packets.

    # Set the version of exported packets to V9.

    [*Switch ModuleA] netstream export ethernet version 9

  5. Enable Layer 2 statistics collection on the interface.

    # Enable NetStream statistics collection on 10GE1/17/1 for incoming and outgoing packets.

    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] netstream inbound ethernet
    [*Switch ModuleA-10GE1/17/1] netstream outbound ethernet
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] commit

  6. Verify the configuration.

    # View flow statistics.

    [~Switch ModuleA] display netstream statistics ethernet slot 1
     Time statistics were last cleared: -                                           
     -------------------------------------------------------------------------------
     Packet Length    : Number                                                      
     -------------------------------------------------------------------------------
     1      ~    64   : 0                                                           
     65     ~    128  : 20                                                          
     129    ~    256  : 0                                                           
     257    ~    512  : 0                                                          
     513    ~    1024 : 0                                                           
     1025   ~    1500 : 0                                                           
     longer than 1500 : 0                                                           
     -------------------------------------------------------------------------------
     StreamType                                                                     
          Current           Aged        Created       Exported       Exported       
          (streams)         (streams)   (streams)     (streams)      (Packets)      
     -------------------------------------------------------------------------------
     ethernet                                                                       
                1             15             15             15             15       
     -------------------------------------------------------------------------------
    

Configuration Files

Configuration file of Switch ModuleA

#                                                                               
sysname Switch ModuleA 
#                                                                               
vlan batch 110 120 130 140 
# 
netstream export ethernet version 9                                             
netstream export ethernet source 10.1.2.1                                       
netstream export ethernet host 10.1.2.2 6000    
#                                                                               
interface Vlanif110                                                             
 ip address 10.1.1.1 255.255.255.0 
#                                                                               
interface Vlanif120                                                             
 ip address 10.1.2.1 255.255.255.0 
#                                                                               
interface Vlanif130                                                             
 ip address 10.1.3.1 255.255.255.0 
#                                                                               
interface Vlanif140                                                             
 ip address 10.1.4.1 255.255.255.0 
#                                                                                
interface 10GE1/17/1                                                 
 port link-type trunk                                                           
 port trunk pvid vlan 110                                                       
 port trunk allow-pass vlan 110 
 netstream inbound ethernet                                                      
 netstream outbound ethernet                                                     
 netstream sampler random-packets 1200 inbound                         
 netstream sampler random-packets 1200 outbound 
#                                                                               
interface 10GE1/17/2                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 120                                                       
 port trunk allow-pass vlan 120  
#                                                                               
interface 10GE1/17/3                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 130                                                       
 port trunk allow-pass vlan 130 
#                                                                               
interface 10GE1/17/4                                                  
 port link-type trunk                                                           
 port trunk pvid vlan 140                                                       
 port trunk allow-pass vlan 140 
#                                                                               
return
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 58857

Downloads: 3621

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next