Voici un cas rigolo qui m'est arrivé hier. Soit une machine
% sudo tcpdump -i eth1 -n
12:36:40.723290 IP 193.243.207.47.31619 > 192.93.0.129.53: 40691 [1au] MX? doublev.fr. (39)
12:36:40.723440 IP 192.93.0.129.53 > 193.243.207.47.31619: 40691- 0/2/3 (112)
12:36:40.723480 IP 212.96.9.225.2123 > 192.93.0.129.53: 46420+ MX? fema.fr. (25)
12:36:40.723634 IP 192.93.0.129.53 > 212.96.9.225.2123: 46420- 0/2/0 (81)
...
Mais aucun filtre BPF ne trouve ne serait-ce qu'un seul paquet. Dès
que je mets comme argument
La machine a deux interfaces dont une seule a ce problème (sur
l'autre, même puce donc même
Si j'enregistre les paquets avec l'option
% tcpdump -n -r /tmp/tcpdump-eth1.pcap | wc -l
reading from file /tmp/tcpdump-eth1.pcap, link-type EN10MB (Ethernet)
5722
% tcpdump -n -r /tmp/tcpdump-eth1.pcap ip | wc -l
reading from file /tmp/tcpdump-eth1.pcap, link-type EN10MB (Ethernet)
0
Utiliser l'option
Arrivé là, voyez si vous avez trouvé la solution...
Mon collègue Antonio Kin-Foo a trouvé. La configuration réseau avait été
refaite et le
Le bon moyen est de rajouter pour réparer le filtre est d'ajouter
tcpdump -n -i eth1 vlan and port 53
J'ai dû aussi modifier le code de l'outil que j'utilisais pour
analyser les paquets. Quelque chose du genre (en
size_layer2 = SIZE_ETHERNET;
ethernet = (struct sniff_ethernet *) (packet);
ethertype = ntohs(ethernet->ether_type);
if (ethertype == VLAN_ETHERTYPE) { /* NEW: if the packets are
tagged, move four bytes forward */
packet += 4;
ethernet = (struct sniff_ethernet *) (packet);
ethertype = ntohs(ethernet->ether_type);
}
if (ethertype == IPv6_ETHERTYPE) {
ip_version = 6;
} else if (ethertype == IPv4_ETHERTYPE) {
ip_version = 4;
} else { /* Ignore other Ethernet types */
goto next_packet;
}