In Figure 1, departments 1 and 2 connect to the Internet through SwitchA. Network administrators want to monitor communication between departments and the Internet.
To monitor communication between the departments and the Internet, the network administrator needs to:
The configuration roadmap is as follows:
# Configure IP addresses for interfaces on SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 200 300 400 [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 10.1.1.1 24 [SwitchA-Vlanif100] quit [SwitchA] interface vlanif 200 [SwitchA-Vlanif200] ip address 10.1.2.1 24 [SwitchA-Vlanif200] quit [SwitchA] interface vlanif 300 [SwitchA-Vlanif300] ip address 10.1.3.1 24 [SwitchA-Vlanif300] quit [SwitchA] interface vlanif 400 [SwitchA-Vlanif400] ip address 10.1.4.1 24 [SwitchA-Vlanif400] quit [SwitchA] interface gigabitEthernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type hybrid [SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 100 [SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 100 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitEthernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type hybrid [SwitchA-GigabitEthernet0/0/2] port hybrid pvid vlan 200 [SwitchA-GigabitEthernet0/0/2] port hybrid untagged vlan 200 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface gigabitEthernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type hybrid [SwitchA-GigabitEthernet0/0/3] port hybrid pvid vlan 300 [SwitchA-GigabitEthernet0/0/3] port hybrid untagged vlan 300 [SwitchA-GigabitEthernet0/0/3] quit [SwitchA] interface gigabitEthernet 0/0/4 [SwitchA-GigabitEthernet0/0/4] port link-type hybrid [SwitchA-GigabitEthernet0/0/4] port hybrid pvid vlan 400 [SwitchA-GigabitEthernet0/0/4] port hybrid untagged vlan 400 [SwitchA-GigabitEthernet0/0/4] quit
# Configure protocol-port aggregation, and set the source IP address of the exported packets to 10.1.2.1, the destination IP address to 10.1.2.2, and the destination port number to 6000.
[SwitchA] ip netstream aggregation protocol-port [SwitchA-aggregation-protport] ip netstream export source 10.1.2.1 [SwitchA-aggregation-protport] ip netstream export host 10.1.2.2 6000 [SwitchA-aggregation-protport] enable
# Set the version of the exported packets carrying aggregation flow statistics to V9.
[SwitchA-aggregation-protport] export version 9 [SwitchA-aggregation-protport] quit
# Enable flow statistics on GE0/0/1.
[SwitchA] interface gigabitEthernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] ip netstream inbound [SwitchA-GigabitEthernet0/0/1] ip netstream outbound [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] quit
# After the configuration is complete, the NetStream server receives statistics packets from the device. Run the display ip netstream statistics command on the local device to view NetStream statistics.
<SwitchA> display ip netstream statistics slot 0 ===== Netstream statistics: ===== Origin/Flexible ingress entries : 95 Origin/Flexible ingress packets : 1036640 Origin/Flexible ingress octets : 340017920 Origin/Flexible egress entries : 0 Origin/Flexible egress packets : 0 Origin/Flexible egress octets : 0 Origin/Flexible total entries : 95 Handle origin entries : 95 Handle As aggre entries : 0 Handle ProtPort aggre entries : 8 Handle SrcPrefix aggre entries : 0 Handle DstPrefix aggre entries : 0 Handle Prefix aggre entries : 0 Handle AsTos aggre entries : 0 Handle ProtPortTos aggre entries : 0 Handle SrcPreTos aggre entries : 0 Handle DstPreTos aggre entries : 0 Handle PreTos aggre entries : 0
SwitchA configuration file
# sysname SwitchA # vlan batch 100 200 300 400 # interface Vlanif100 ip address 10.1.1.1 255.255.255.0 # interface Vlanif200 ip address 10.1.2.1 255.255.255.0 # interface Vlanif300 ip address 10.1.3.1 255.255.255.0 # interface Vlanif400 ip address 10.1.4.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 ip netstream inbound ip netstream outbound # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # interface GigabitEthernet0/0/3 port link-type hybrid port hybrid pvid vlan 300 port hybrid untagged vlan 300 # interface GigabitEthernet0/0/4 port link-type hybrid port hybrid pvid vlan 400 port hybrid untagged vlan 400 # ip netstream aggregation protocol-port ip netstream export source 10.1.2.1 ip netstream export host 10.1.2.2 6000 enable export version 9 # return