Squid 网络 - 警告子网

Jos*_*tes 8 proxy squid

执行以下命令:

squid-k parse

我收到以下警告:

WARNING: (B) '127.0.0.1' is a subnetwork of (A) '127.0.0.1'
2014/03/19 16:43:41| WARNING: because of this '127.0.0.1' is ignored to keep splay tree searching predictable
2014/03/19 16:43:41| WARNING: You should probably remove '127.0.0.1' from the ACL named 'localhost'
2014/03/19 16:43:41| WARNING: (B) '127.0.0.1' is a subnetwork of (A) '127.0.0.1'
2014/03/19 16:43:41| WARNING: because of this '127.0.0.1' is ignored to keep splay tree searching predictable
2014/03/19 16:43:41| WARNING: You should probably remove '127.0.0.1' from the ACL named 'localhost'
2014/03/19 16:43:41| Processing: acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
2014/03/19 16:43:41| WARNING: (B) '127.0.0.0/8' is a subnetwork of (A) '127.0.0.0/8'
2014/03/19 16:43:41| WARNING: because of this '127.0.0.0/8' is ignored to keep splay tree searching predictable
2014/03/19 16:43:41| WARNING: You should probably remove '127.0.0.0/8' from the ACL named 'to_localhost'
2014/03/19 16:43:41| WARNING: (B) '0.0.0.0' is a subnetwork of (A) '0.0.0.0'
2014/03/19 16:43:41| WARNING: because of this '0.0.0.0' is ignored to keep splay tree searching predictable
2014/03/19 16:43:41| WARNING: You should probably remove '0.0.0.0' from the ACL named 'to_localhost'
2014/03/19 16:43:41| WARNING: (B) '0.0.0.0' is a subnetwork of (A) '0.0.0.0'
2014/03/19 16:43:41| WARNING: because of this '0.0.0.0' is ignored to keep splay tree searching predictable
2014/03/19 16:43:41| WARNING: You should probably remove '0.0.0.0' from the ACL named 'to_localhost'
Run Code Online (Sandbox Code Playgroud)

鱿鱼代理服务启动并运行,但我不喜欢留下这些警告。

这些是出现问题的 ACL:

acl all src all
acl manager1 proto cache_object
acl localhost src 127.0.0.1/32 192.168.1.29/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
Run Code Online (Sandbox Code Playgroud)

提前致谢。

小智 18

我参加聚会晚了一年,但答案是从 3.2 到 3.4 的某个时候,localhost、to_localhost 和 manager acls 成为内置到 squid3 中。由于您在 squid.conf 中重新定义它们,但并未更改有效的网络子类,因此 squid 会生成警告错误。

除非您真的想重新定义它们,否则解决方案是从 squid.conf 中的 acl 定义中删除 localhost、to_localhost 和 manager 的定义。


小智 -1

不太熟悉这个设置,但它似乎是 ACL 的第四行。0.0.0.0/32 包含整个 IPv4 地址空间。指定 127.0.0.0/8 是多余的。尝试删除一个,看看警告是否消失。

  • /32 准确地表示该地址(所有 32 位),而不是任何位 - 因此不匹配任何地址。这种特殊情况称为“未指定地址”,并被视为“该网络上的该主机”的源地址 - 实际上大致相当于 127.0.0.1。尽管存在实际重复,但这并不是问题中错误的原因。这里的另一个较晚的答案解释了实际的问题是什么。 :) (2认同)