积少@成多 2015-05-31 01:11 采纳率: 0%
浏览 2625

在虚拟机上eth0 ping 主机,为什么在其他出接口(eth1)tcpdump还能看到报文?

主机信息:

连接特定的 DNS 后缀 . . . . . . . :
本地链接 IPv6 地址. . . . . . . . : fe80::998f:e20:1480:3aab%13
IPv4 地址 . . . . . . . . . . . . : 192.168.1.107
子网掩码 . . . . . . . . . . . . : 255.255.255.0
默认网关. . . . . . . . . . . . . : 192.168.1.1

虚拟机信息(路由和ip地址):
eth0 Link encap:Ethernet HWaddr 00:0C:29:A0:55:AB

inet addr:192.168.1.108 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fea0:55ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8313 errors:0 dropped:0 overruns:0 frame:0
TX packets:9646 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:612195 (597.8 KiB) TX bytes:2116557 (2.0 MiB)
Interrupt:19 Base address:0x2024

eth1 Link encap:Ethernet HWaddr 00:0C:29:A0:55:B5

inet addr:192.168.1.109 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fea0:55b5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1443 errors:0 dropped:0 overruns:0 frame:0
TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:128176 (125.1 KiB) TX bytes:5634 (5.5 KiB)
Interrupt:19 Base address:0x20a4

eth2 Link encap:Ethernet HWaddr 00:0C:29:A0:55:BF

inet addr:192.168.1.110 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fea0:55bf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8109 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1117965 (1.0 MiB) TX bytes:1408 (1.3 KiB)
Interrupt:16 Base address:0x2424

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:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1584 (1.5 KiB) TX bytes:1584 (1.5 KiB)

[root@localhost ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

在虚拟机上进行如下操作:(去ping主机的ip地址,用eth0)
[root@localhost ~]# ping 192.168.1.107 -I eth0
PING 192.168.1.107 (192.168.1.107) from 192.168.1.108 eth0: 56(84) bytes of data.
64 bytes from 192.168.1.107: icmp_seq=1 ttl=64 time=0.492 ms
64 bytes from 192.168.1.107: icmp_seq=2 ttl=64 time=0.500 ms
64 bytes from 192.168.1.107: icmp_seq=3 ttl=64 time=1.13 ms
64 bytes from 192.168.1.107: icmp_seq=4 ttl=64 time=0.517 ms
64 bytes from 192.168.1.107: icmp_seq=5 ttl=64 time=0.381 ms
在虚拟机上抓包(抓eth2)
[root@localhost ~]# tcpdump -i eth2 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth2, link-type EN10MB (Ethernet), capture size 65535 bytes
18:11:46.945393 IP 192.168.1.108 > 192.168.1.107: ICMP echo request, id 54537, seq 8, length 64
18:11:46.945438 IP 192.168.1.107 > 192.168.1.108: ICMP echo reply, id 54537, seq 8, length 64
18:11:47.947676 IP 192.168.1.108 > 192.168.1.107: ICMP echo request, id 54537, seq 9, length 64
竟然可以抓到。
我就很疑惑,虚拟机的网卡都是桥连的,感谢大牛为我解决疑惑。

  • 写回答

2条回答 默认 最新

  • oyljerry 2015-05-31 07:36
    关注

    本来所有虚拟网卡你抓包都可能抓到。

    评论

报告相同问题?

悬赏问题

  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码