我想知道这个,我似乎无法在互联网上找到解释。我有一个具有多个接口的 linux 网关:
eth0: external ip
eth1: 172.16.1.1/24
eth2: 172.16.2.1/24
ip_forward is enabled.
Run Code Online (Sandbox Code Playgroud)
IPtables 配置为 NAT 流量来自eth1 -> eth0
和eth2 -> eth0
。但配置为不转发eth1 <-> eth2
.
我的问题是:为什么172.16.2.0/24子网上的电脑可以ping 172.16.1.1(eth1接口的ip地址)?
纳特
Chain PREROUTING (policy ACCEPT 647K packets, 52M bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 17582 packets, 1160K bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 14951 packets, 1214K bytes)
pkts bytes target prot opt in …
Run Code Online (Sandbox Code Playgroud)