我有以下非常简单的iptables
配置:
# iptables -n -v -L INPUT --line-numbers
Chain INPUT (policy DROP 21 packets, 1683 bytes)
num pkts bytes target prot opt in out source destination
1 4 336 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
#
如上所示,我没有明确允许连接到 127/8 网络,因此当我echo reply
从 接收例如 ICMP 消息时,如果我 ping 127.0.0.1(配置到接口),8.8.8.8
我不会收到任何内容:lo
# ping -qc4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 5.247/5.305/5.357/0.099 ms
# ping -qc4 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
--- 127.0.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3024ms
#
iptables
为什么发送到 127.0.0.1 的数据包与接受已建立的相关连接的规则不匹配?