Olá

Hoje vamos desmontar como configurar o seu roteador Huawei para exportar Netflow (IP Netstream).

Aqui temos a topologia da Rede e as informações do Servidor de Netflow

Topologia e informação do Servidor de Netflow

Estes são os passos necessários para configuração do Roteador Huawei para exportar Netflow v5/v9 via IP Netstream

  1. Configurar o Servidor de NTP
  2. Configurar o slot para exportar informação
  3. Configurar o IP Netstream com o Servidor de Netflow
  4. Configurar a interface para habilitar o Netflow na interface

Vamos para a Configuração passo a passo

1.Configurar o Servidor de NTP

É importante configurar um Servidor de NTP pois os dados Flows usam timestamp de acordo com a hora do Roteador, caso o roteador esteja com uma hora diferente do servidor os dados não irão estar de acordo com a hora, gerando um desencontro de informações.

É importante que seja configurado no mínimo 2 servidores de NTP e também o timezone de seu roteador.

ntp-service server disable 
ntp-service ipv6 server disable
ntp-service unicast-peer 200.160.0.8
ntp-service unicast-peer 200.189.40.8

2. Configurar o slot para exportar informação

Em roteadores Huawei é necessario configurar o Slot para exportar informação, para isso utilize os comandos:

slot 3  
ip netstream sampler to slot self
ipv6 netstream sampler to slot self

3. Configurar o IP Netstream com o Servidor de Netflow

Em roteadores Huawei você deve configurar o IP netstream para dizer qual é o servidor que irá receber os dados do Netflow, qual o sampling (sampler), qual versão do Netflow e IP de origem do Netflow. Para configuração use os seguintes comandos:

 ip netstream timeout active 1
ip netstream timeout inactive 15
ip netstream export version 9
ip netstream export index-switch 32
ip netstream export template timeout-rate 1
ip netstream sampler fix-packets 500 inbound
ip netstream sampler fix-packets 500 outbound
ip netstream export source 192.168.210.49
ip netstream export host 192.168.210.47 2055
ip netstream export template option sampler
ip netstream export template option timeout-rate 1
ip netstream as-mode 32
 ipv6 netstream as-mode 32
ipv6 netstream timeout active 1
ipv6 netstream timeout inactive 15
ipv6 netstream export version 9
ipv6 netstream export index-switch 32
ipv6 netstream export template timeout-rate 1
ipv6 netstream sampler fix-packets 500 inbound
ipv6 netstream sampler fix-packets 500 outbound
ipv6 netstream export source 192.168.210.49
ipv6 netstream export host 192.168.210.47 2055
ipv6 netstream export template option sampler
ipv6 netstream export template option timeout-rate 1
ipv6 netstream as-mode 32

4. Configurar a interface para habilitar o Netflow na interface

Por ultimo precisamos ativar nas interfaces que irão exportar o Netflow, para isso em cada interface utilize os comandos:

ip netstream inbound  
ipv6 netstream inbound

Segue abaixo a configuração completa do Roteador:

ntp-service server disable
ntp-service ipv6 server disable
ntp-service unicast-peer 200.160.0.8
ntp-service unicast-peer 200.189.40.8
slot 3
ip netstream sampler to slot self
ipv6 netstream sampler to slot self
ip netstream timeout active 1
ip netstream timeout inactive 15
ip netstream export version 9
ip netstream export index-switch 32
ip netstream export template timeout-rate 1
ip netstream sampler fix-packets 500 inbound
ip netstream sampler fix-packets 500 outbound
ip netstream export source 192.168.210.49
ip netstream export host 192.168.210.47 2055
ip netstream export template option sampler
ip netstream export template option timeout-rate 1
ip netstream as-mode 32
ipv6 netstream as-mode 32
ipv6 netstream timeout active 1
ipv6 netstream timeout inactive 15
ipv6 netstream export version 9
ipv6 netstream export index-switch 32
ipv6 netstream export template timeout-rate 1
ipv6 netstream sampler fix-packets 500 inbound
ipv6 netstream sampler fix-packets 500 outbound
ipv6 netstream export source 192.168.210.49
ipv6 netstream export host 192.168.210.47 2055
ipv6 netstream export template option sampler
ipv6 netstream export template option timeout-rate 1
ipv6 netstream as-mode 32
interface eth-trunk0.100 (exemplo de interface)
ip netstream inbound
ipv6 netstream inbound

Caso você tenha um NE40, segue abaixo um exemplo de configuração:

ntp-service server disable
ntp-service ipv6 server disable
ntp-service unicast-peer 200.160.0.8
ntp-service unicast-peer 200.189.40.8
slot 3
ip netstream sampler to slot self
ipv6 netstream sampler to slot self
ip netstream as-mode 32
ip netstream timeout inactive 15
ip netstream export version 9
ip netstream export index-switch 32
ip netstream export template timeout-rate 1
ip netstream sampler fix-packets 500 inbound
ip netstream sampler fix-packets 500 outbound
ip netstream export source 192.168.210.49
ip netstream export host 192.168.210.47 2055
ip netstream export template option sampler
ip netstream export template option timeout-rate 1
#
ipv6 netstream as-mode 32
ipv6 netstream timeout inactive 15
ipv6 netstream export version 9
ipv6 netstream export index-switch 32
ipv6 netstream export template timeout-rate 1
ipv6 netstream sampler fix-packets 500 inbound
ipv6 netstream sampler fix-packets 500 outbound
ipv6 netstream export source 192.168.210.49
ipv6 netstream export host 192.168.210.47 2055
ipv6 netstream export template option sampler
ipv6 netstream export template option timeout-rate 1
Em todas as interfaces adicionar
ip netstream inbound
ipv6 netstream inbound

Caso tenham algum roteador não mencionado aqui, envie um whats que iremos lhe enviar as configurações.

Espero ter ajudado e até a próxima.

Grande abraço.