1

如果配置为的 O/P

[root@test2 ~]# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3045306 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3045306 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:969363066 (924.4 MiB)  TX bytes:969363066 (924.4 MiB)

p4p1      Link encap:Ethernet  HWaddr F0:4D:A2:F7:CE:20
          inet addr:192.168.250.58  Bcast:192.168.250.255  Mask:255.255.255.0
          inet6 addr: fe80::f24d:a2ff:fef7:ce20/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:222163621 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29525032 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:67504475609 (62.8 GiB)  TX bytes:13910424527 (12.9 GiB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:3C:38:60
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

当我执行 tcpdump 时,o/p 是

root@test2 ~]# tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on virbr0, link-type EN10MB (Ethernet), capture size 65535 bytes

它默认收听vibra0接口。我想将 p4p1 接口设置为默认接口,以便在执行 tcpdump 时可以获得适当的 o/p。

任何解决方案。

4

1 回答 1

1

您不能更改 tcpdump 的默认界面(除非您破解 tcpdump 或 libpcap 的代码)。

但是,您可以-i使用以下选项告诉 tcpdump 在特定接口上进行捕获:

tcpdump -i p4p1
于 2013-10-18T02:40:45.583 回答