我插入了一个规则到iptables来跟踪input到某个ip地址的使用情况。 vps服务器的IP为192.168.1.5,guest os的IP为192.168.1.115。 我在客户操作系统中运行“yum update”来获得一些networkingstream量。 然后我从pipe理程序运行iptables -vnL 。 但是,它仅向主机显示networking使用情况,而不显示给客户。
Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target source destination 0 0 0.0.0.0/0 0.0.0.0/0 destination IP range 192.168.1.115-192.168.1.115 1853 114K 0.0.0.0/0 0.0.0.0/0 destination IP range 192.168.1.5-192.168.1.5
我运行tcpdump ,日志显示有数据包到客户端操作系统。
16:17:43.932514 IP mirrordenver.fdcservers.net.http > 192.168.1.115.34471: Flags [.], seq 17694667:17696115, ack 1345, win 113, options [nop,nop,TS val 1060308643 ecr 1958781], length 1448 16:17:43.932559 IP 192.168.1.115.34471 > mirrordenver.fdcservers.net.http: Flags [.], ack 17696115, win 15287, options [nop,nop,TS val 1958869 ecr 1060308643], length 0
为什么客户操作系统的networking使用不能被跟踪?
iptables -L将返回INPUT链,如下所示:
Chain INPUT (policy ACCEPT) target prot opt source destination all -- anywhere anywhere destination IP range 192.168.1.115-192.168.1.115 all -- anywhere anywhere destination IP range 192.168.1.5-192.168.1.5 all -- anywhere anywhere Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 all -- * * 0.0.0.0/0 0.0.0.0/0 destination IP range 192.168.1.1-192.168.1.249
你没有说你如何安排stream量从VPS服务器的物理网卡到VPS的虚拟网卡,但是这可能是一个路由交易。 如果是这样,那么到VPS的stream量不会出现在VPS服务器的INPUT链上,而是在FORWARD链上。