Como posso ver os pacotes marcados com VLAN com qualquer ID?

0

Estou tentando farejar com o tshark no debian e quero ver todo o tráfego, mas estou sentindo falta do tráfego da VLAN.

Eu posso configurar manualmente a interface para adicionar a VLAN 10 à interface eth0 e, em seguida, consultar:

# tshark -i eth0 -w /home/debian/capture/testcapture8.pcap
[NO PACKETS]

# vconfig add eth0 10
# tshark -i eth0 -w /home/debian/capture/testcapture8.pcap
[ALL PACKETS on VLAN 10 and on eth0]

# vconfig rem eth0.10
# vconfig add eth0 20
# tshark -i eth0 -w /home/debian/capture/testcapture8.pcap
[NO PACKETS]

Assim, só consigo ver os pacotes marcados com VLAN com o vconfig usando esse ID de VLAN específico. Como posso ver todos os pacotes sem saber o ID da VLAN para adicionar no vconfig?

    
por A. Rao 02.08.2017 / 04:09

1 resposta

1

Tente usar tshark -i eth0.10 -w /home/debian/capture/testcapture8.pcap para capturar pacotes para a VLAN 10.

De: link

(ênfase em negrito adicionada por mim)

[...]

Linux

To enable VLAN tagging, you need two things: the vlan rpm (e.g., vlan-1.8-23) and the 8021q kernel module. Once installed, the vconfig command can be used to create VLAN interfaces on an existing physical device. For more info, see the vconfig(8) man page.

After your VLAN interfaces are set up and traffic is flowing, you can run Wireshark and capture on the VLAN interface of your choice (e.g., eth0.100 for VLAN 100) or on the underlying physical interface (e.g., eth0). If you choose the former, you will only see frames destined for that VLAN; if you choose the latter, you may see all frames or you may see only untagged frames (if there are any). It depends on the NIC, the NIC firmware, the driver, and the alignment of the moon and planets. (A table enumerating the behaviors of various adapters, firmware versions, and drivers might be useful. -Guy Harris)

If you are capturing on the host system where the VLANs are configured, you will probably not see the VLAN tags in the captured frames -- even if you capture on the physical device. The driver is stripping the tags before the pcap library sees them. See the tech note from Intel mentioned in the Windows section below. (Do Linux drivers support getting VLAN tags, perhaps with a driver configuration option or other option, in the same way that the Intel Windows driver does? -Guy Harris) (e100 driver works great on 2.4.26 - Jaap Keuter)

Também vale a pena ler: link

    
por 02.08.2017 / 04:41