1

アプリケーションで使用されている pcap ライブラリを使用しました。以前は機能していました。

コードに変更を加えていませんが、特定のインターフェイス「eth0」でのみパケットをキャプチャできません。ただし、eth1 や wlan0 などの他のインターフェイスでは、期待どおりに機能します。

Ifconfig コマンドの出力は次のとおりです。

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.1.14.128  netmask 255.255.255.0  broadcast 10.1.14.255
        inet6 fe80::5642:49ff:fee1:3a03  prefixlen 64  scopeid 0x20<link>
        ether 54:42:49:e1:3a:03  txqueuelen 1000  (Ethernet)
        RX packets 476  bytes 53618 (52.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 365  bytes 61306 (59.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 18  

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet6 fe80::280:c8ff:fe3c:fe04  prefixlen 64  scopeid 0x20<link>
        ether 00:80:c8:3c:fe:04  txqueuelen 1000  (Ethernet)
        RX packets 34500  bytes 48274193 (46.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 1732834 (1.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 10775  bytes 1170782 (1.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10775  bytes 1170782 (1.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 134.96.174.7  netmask 255.255.248.0  broadcast 134.96.175.255
        inet6 fe80::226:c7ff:fe9d:1f00  prefixlen 64  scopeid 0x20<link>
        ether 00:26:c7:9d:1f:00  txqueuelen 1000  (Ethernet)
        RX packets 981018  bytes 1250676710 (1.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 248507  bytes 31718095 (30.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

これらのフラグ ID (すべて同じ) は、私の問題と関係がありますか?

最高のヤッシュ

4

1 に答える 1

0

インターフェイスのドライバーは、NICに直接アドレス指定されていないパケットを収集するために、ifaceをプロミスキャスモードにすることをサポートする必要があります。

于 2013-01-18T08:58:41.230 に答える