Feb 16, 2026

Como capturar pacote para análise e troubleshoot em roteadores Huawei VRP

Neste artigo, vou mostrar como fazer captura de pacotes em um roteador Huawei com o sistema operacional Huawei VRP (Versatile Routing Platform).

A análise de captura de pacotes é uma das ferramentas mais poderosas que um profissional de redes tem em seu arsenal, embora muitas vezes seja menosprezada ou até mesmo desconhecida por muitos.

A análise de um dump bem feito pode trazer luz a uma infinidade de situações nas quais você se vê em um beco sem saída.

Fazer a captura de pacotes em roteadores Huawei que utilizam o SO VRP é relativamente simples. Em capturas básicas, é possível visualizar os pacotes diretamente no terminal. Para troubleshootings mais complexos, você pode salvar as informações em um arquivo de dump (.cap ou .pcap) para baixar e analisar posteriormente.

Captura simples utilizando buffer

Vou começar com uma captura simples, sem muitos parâmetros, salvando apenas no buffer.

O comando utilizado é capture-packet, que pode ser executado diretamente no user view.

Uma documentação completa desse comando pode ser encontrada no site da Huawei (acessado em 10 de fevereiro de 2026): https://support.huawei.com/enterprise/en/doc/EDOC1100335691/89b641cc/packet-header-obtaining-configuration

Executando a captura

<HUAWEI_VRP>capture-packet forwarding interface Eth-Trunk10.39 buffer-only 

<HUAWEI_VRP>disp capture-packet information instance-id 1 verbose 

 Total capture instance number is            2

 Forward capture inbound instance number is  2

 Forward capture outbound instance number is 2

 Host capture instance number is             0

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

instance-id                               : 1

instance status                           : stopped

instance total time length of set         : 15s

instance packet number of set             : 10

instance file length of set               : 0M

instance total memory size of set         : 1M

instance capture packet number            : 10

instance capture packet size              : 200B

instance saved packet number              : 10

instance saved packet size                : 200B

instance deleted packet number            : 0

instance deleted packet size              : 0B

instance capture first packet time        : 2026-02-09 14:19:54-03:00

instance capture last packet time         : 2026-02-09 14:19:54-03:00

instance acl number/name                  : —

instance packet-num in memory             : <1-10>

instance remain time length be deleted    : 357s

instance saved packet device name         : —(Buffer only, no device name)

instance save packet file name            : —(Buffer only, no file name)

instance link type is                     : ethernet

instance interface name is                : Eth-Trunk10.39

instance type is                          : forwarding

instance direction is                     : both

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

packet NO        : 1

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 5ce8-83a1-b2c3

    Dest Mac     : 001b-21d4-e5f6

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

            

  L4 Type: unknow protocol

0000 00 1b 21 bc 58 39 5c e8 83 35 f0 56 81 00 0c 62

0010 08 00 45 c0 

 

packet NO        : 2

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 5ce8-83a1-b2c3

    Dest Mac     : 001b-21d4-e5f6

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

                

  L4 Type: unknow protocol

0000 00 1b 21 bc 58 39 5c e8 83 35 f0 56 81 00 0c 62

0010 08 00 45 c0 

 

packet NO        : 3

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 001b-21d4-e5f6

    Dest Mac     : 5ce8-83a1-b2c3

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 5c e8 83 35 f0 56 00 1b 21 bc 58 39 81 00 0c 62

0010 08 00 45 20 

 

packet NO        : 4

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 001b-21d4-e5f6

    Dest Mac     : 5ce8-83a1-b2c3

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 5c e8 83 35 f0 56 00 1b 21 bc 58 39 81 00 0c 62

0010 08 00 45 20 

 

packet NO        : 5

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 5ce8-83a1-b2c3

    Dest Mac     : 001b-21d4-e5f6

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 00 1b 21 bc 58 39 5c e8 83 35 f0 56 81 00 0c 62

0010 08 00 45 c0 

 

packet NO        : 6

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 001b-21d4-e5f6

    Dest Mac     : 5ce8-83a1-b2c3

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 5c e8 83 35 f0 56 00 1b 21 bc 58 39 81 00 0c 62

0010 08 00 45 20 

 

packet NO        : 7

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 5ce8-83a1-b2c3

    Dest Mac     : 001b-21d4-e5f6

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 00 1b 21 bc 58 39 5c e8 83 35 f0 56 81 00 0c 62

0010 08 00 45 c0 

 

packet NO        : 8

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 001b-21d4-e5f6

    Dest Mac     : 5ce8-83a1-b2c3

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4 

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 5c e8 83 35 f0 56 00 1b 21 bc 58 39 81 00 0c 62

0010 08 00 45 20 

 

packet NO        : 9

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 5ce8-83a1-b2c3

    Dest Mac     : 001b-21d4-e5f6

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

                

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 00 1b 21 bc 58 39 5c e8 83 35 f0 56 81 00 0c 62

0010 08 00 45 c0 

 

packet NO        : 10

packet length is : 20

capture-time     : 2026-02-09 14:19:54-03:00

  L2 Type: Ethernet

    Source Mac   : 5ce8-83a1-b2c3

    Dest Mac     : 001b-21d4-e5f6

    Ethernet type/length: 0x8100

    PeVlanid     : 3170

    CeVlanid     : 0

 

  L3 Type: IPv4

    Protocol Num : —

    Source Ip    : 0.0.0.0

    Dest Ip      : 0.0.0.0

    TOS/DSCP     : 0/0

    TTL          : 0

 

  L4 Type: unknow protocol

 

0000 00 1b 21 bc 58 39 5c e8 83 35 f0 56 81 00 0c 62

0010 08 00 45 c0 

Limitações da análise via CLI

Como você pode observar, analisar a captura diretamente pelo CLI não é exatamente prático nem funcional.

Além disso, a captura foi propositalmente simples e coletou apenas alguns poucos pacotes, o que pode ser insuficiente para qualquer troubleshooting mais sério. Esta etapa serviu apenas como aquecimento para cenários mais avançados.

Salvando a captura em arquivo para análise no Wireshark

Para visualizarmos capturas maiores, o ideal é instruir o VRP a salvar os pacotes em um arquivo que possa ser analisado posteriormente no Wireshark, por exemplo.

De fato, o comportamento padrão do comando capture-packet é salvar o dump em um arquivo dentro do diretório: cfcard:/logfile/.

Utilizando ACL para filtrar a captura

Para nossa próxima captura, vamos utilizar uma ACL do tipo Advanced para filtrar as informações que serão salvas no arquivo de dump, coletando apenas o tipo de pacote relevante para o troubleshooting em questão.

O uso de ACLs permite dar match em praticamente qualquer característica do pacote, incluindo:

    • Protocolo;
    • Endereço de origem;
    • Endereço de destino;
    • Porta de origem;
    • Porta de destino;
    • TCP flag;
    • TTL;
  • Fragment-type;
  • Packet-length;
  • Entre outros.

Você pode obter mais informações sobre a construção de ACLs na documentação da Huawei (acessado em 10 de fevereiro de 2026): https://support.huawei.com/enterprise/en/doc/EDOC1100279274/a0d829ef/acl-configuration

Cenário: captura de sessão BGP

Neste exemplo, irei capturar pacotes da “conversa” entre dois peers BGP, definindo um match na ACL para:

  • Protocolo TCP;
  • Porta 179 na origem;
  • Porta 179 no destino.

Qualquer pacote que não corresponda aos critérios definidos na ACL será ignorado e não será registrado no arquivo de dump.

Isso permite focar o troubleshooting e evita poluir o arquivo com informações irrelevantes.

Criando a ACL Advanced

acl name CAPTURA advanced

Definindo as regras

rule 5 permit tcp destination-port eq 179

rule 10 permit tcp source-port eq 179

Commit das configurações

É necessário “commitar” as configurações antes de iniciar a captura:

commit

Iniciando a captura com filtro ACL

Agora vamos iniciar a captura propriamente dita, referenciando a ACL “CAPTURA” criada, além de definir:

 

  • Interface;
  • Tamanho máximo do pacote;
  • Quantidade de pacotes;
  • Tempo máximo de captura.


capture-packet forwarding interface Eth-Trunk10.39 acl name CAPTURA packet-len 64 packet-num 10 time-out 600 

 

A captura será encerrada automaticamente quando o packet-num ou o time-out for atingido.

Acompanhando o andamento

É possível observar o andamento do processo através do comando abaixo:
display capture-packet information

Verificando o arquivo gerado

Assim que o processo for concluído, você pode conferir a existência do arquivo através do comando “dir”:
dir cfcard:/logfile | include .cap

[~HUAWEI_VRP]acl name CAPTURA advanced 

[*HUAWEI_VRP-acl4-advance-CAPTURA]rule 5 permit tcp destination-port eq 179

[*HUAWEI_VRP-acl4-advance-CAPTURA]rule 10 permit tcp source-port eq 179    

[*HUAWEI_VRP-acl4-advance-CAPTURA]commit

[~HUAWEI_VRP-acl4-advance-CAPTURA]quit

[~HUAWEI_VRP]capture-packet forwarding interface Eth-Trunk10.39 acl name CAPTURA packet-len 64 packet-num 10 time-out 600 

Warning: Generating a new capture packet file will trigger the deletion of the old file. Continue? [Y/N]:y

Info: Capture-packet data will be saved to cfcard:/logfile/capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-31-27.cap.

[~HUAWEI_VRP]display capture-packet information 

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

instance-id                               : 1

instance status                           : running

instance total time length of set         : 600s

instance remain time length               : 464s

instance packet number of set             : 10

instance file length of set               : 2M

instance total memory size of set         : 1M

instance capture packet number            : 5

instance capture packet size              : 0B

instance saved packet number              : 0

instance saved packet size                : 0B

instance deleted packet number            : 0

instance deleted packet size              : 0B

instance capture first packet time        : 2026-02-10 10:31:36-03:00

instance capture last packet time         : 2026-02-10 10:33:22-03:00

instance acl name                         : CAPTURA

instance packet-num in memory             : <1-5>

instance saved packet device name         : cfcard:/logfile/

instance save packet file name            : capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-31-27.cap

instance link type is                     : ethernet

instance interface name is                : Eth-Trunk10.39

instance type is                          : forwarding

instance direction is                     : both

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

 

[~HUAWEI_VRP]display capture-packet information 

 Total capture instance number is            1

 Forward capture inbound instance number is  1

 Forward capture outbound instance number is 1

 Host capture instance number is             0

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

instance-id                               : 1

instance status                           : running

instance total time length of set         : 600s

instance remain time length               : 369s

instance packet number of set             : 10

instance file length of set               : 2M

instance total memory size of set         : 1M

instance capture packet number            : 9

instance capture packet size              : 0B

instance saved packet number              : 0

instance saved packet size                : 0B

instance deleted packet number            : 0

instance deleted packet size              : 0B

instance capture first packet time        : 2026-02-10 10:31:36-03:00

instance capture last packet time         : 2026-02-10 10:35:16-03:00

instance acl name                         : CAPTURA

instance packet-num in memory             : <1-9>

instance saved packet device name         : cfcard:/logfile/

instance save packet file name            : capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-31-27.cap

instance link type is                     : ethernet

instance interface name is                : Eth-Trunk10.39

instance type is                          : forwarding

instance direction is                     : both

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

[~HUAWEI_VRP]display capture-packet information 

 Total capture instance number is            1

 Forward capture inbound instance number is  1

 Forward capture outbound instance number is 1

 Host capture instance number is             0

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

instance-id                               : 1

instance status                           : stopped

instance total time length of set         : 600s

instance packet number of set             : 10

instance file length of set               : 2M

instance total memory size of set         : 1M

instance capture packet number            : 10

instance capture packet size              : 640B

instance saved packet number              : 10

instance saved packet size                : 640B

instance deleted packet number            : 0

instance deleted packet size              : 0B

instance capture first packet time        : 2026-02-10 10:31:36-03:00

instance capture last packet time         : 2026-02-10 10:35:53-03:00

instance acl name                         : CAPTURA

instance packet-num in memory             : <1-10>

instance remain time length be deleted    : 536s

instance saved packet device name         : cfcard:/logfile/

instance save packet file name            : capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-31-27.cap

instance link type is                     : ethernet

instance interface name is                : Eth-Trunk10.39

instance type is                          : forwarding

instance direction is                     : both

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

[~HUAWEI_VRP]quit

<HUAWEI_VRP>dir cfcard:/logfile/ | include .cap

Info: It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break.

  Idx  Attr     Size(Byte)  Date        Time       FileName                     

    -rw-          7,656  May 07 2025 20:47:36   BGP6642.cap                  

    -rw-        152,656  Nov 09 2022 15:25:30   THS09.cap                    

    -rw-          5,460  May 07 2025 21:08:13   bgp664.cap                   

   10  -rw-            344  Feb 10 2026 10:30:56   capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-28-56.cap

   11  -rw-            824  Feb 10 2026 10:35:53   capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-31-27.cap             

<HUAWEI_VRP> 

 

Transferindo o arquivo de captura

Com a captura concluída, precisamos baixar o arquivo para analisá-lo no Wireshark ou software semelhante.

Isso pode ser feito:

  • Enviando o arquivo para um servidor FTP/SFTP;
  • Acessando o roteador via FTP, SFTP ou SCP.

Considerações de segurança

Não é recomendado manter o serviço FTP habilitado no roteador, pois trata-se de um protocolo inseguro.

Mesmo o SFTP deve ser habilitado apenas durante o uso e desabilitado em seguida. Caso seja necessário manter o serviço ativo, recomenda-se utilizar uma ACL para restringir o acesso a redes ou IPs específicos.

O mesmo se aplica ao SCP.

Enviando via FTP

<HUAWEI_VRP>ftp client-transfile put host-ip ftp.meuservidor.com.br username usuarioftp sourcefile

cfcard:/logfile/capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-31-27.cap destination ./capturas/

Enviando via SFTP

[~HUAWEI_VRP]sftp client-transfile put host-ip ftp.meuservidor.com.br username usuarioftp password senhaftp sourcefile

cfcard:/logfile/capture_fwd_Eth-Trunk10.39_both_2026-02-10-10-31-27.cap destination ./capturas/

Habilitando FTP/SFTP para download direto

Para permitir o download via FTP/SFTP:

ftp server enable

sftp server enable

Definindo diretório padrão

sftp server default-directory cfcard:/logfile/

Criando usuário local

[~HUAWEI_VRP]ftp server enable 

[~HUAWEI_VRP]sftp server enable 

[~HUAWEI_VRP]aaa

 local-user USUARIO service-type ftp terminal telnet ssh

 local-user USUARIO ftp-directory cfcard:/logfile/ access-permissio read 

[~HUAWEI_VRP]commit

Baixando com FileZilla

Você pode utilizar um cliente FTP como o FileZilla ou semelhante para acessar o roteador e baixar o arquivo.

  1. Abra o FileZilla;
  2. Vá em Arquivo > Gerenciador de Sites;
  3. Clique em Novo site;
  4. Defina o protocolo (recomendado: SFTP);
  5. Informe IP/hostname, usuário e senha;
  6. Clique em OK.

 

Se tudo estiver configurado corretamente, você conseguirá acessar o diretório cfcard:/logfile/, selecionar o arquivo .cap ou .pcap e realizar o download.

Se tudo estiver configurado corretamente, você conseguirá acessar o diretório cfcard:/logfile/, selecionar o arquivo .cap ou .pcap e realizar o download.

Analisando no Wireshark

Após baixar o arquivo, você poderá analisá-lo no Wireshark ou software equivalente.

No exemplo apresentado, é possível visualizar os pacotes contendo mensagens do protocolo BGP entre os dois roteadores que utilizam o enlace da interface selecionada para a captura.

Conclusão

Saber como realizar uma captura de pacotes e utilizar o dump dessas informações em um troubleshooting pode fazer a diferença não apenas para resolver o problema, mas para entender sua causa raiz.

A utilização desse recurso certamente tornará seu processo de troubleshooting mais eficiente, técnico e assertivo.

 

Por Evandro Alves

 

COMPARTILHE

Você também pode gostar

Figura encapuzada usando um laptop, representando um cibercriminoso. Ilustração de como ataques DDoS são conduzidos, um dos tipos de ataques DDoS que comprometem a segurança online.

Tipos de Ataques DDoS e Como Funcionam

Painéis de monitoramento exibindo tráfego global e anomalias ligadas à proteção contra malware e phishing em redes corporativas.

Proteção contra malware e phishing onde as redes falham

Pessoa mascarada em ambiente escuro, representando a ameaça cibernética do BGP Hijacking e invasões de rede.

BGP Hijacking: O que é e como funciona o vazamento de dados

TIRE SUAS DÚVIDAS NO WHATSAPP

Preencha seu nome, empresa, telefone e segmento para falar agora mesmo com um de nossos consultores.