我对 iptables 非常熟悉,而且我觉得iptables -L -v
很容易阅读。备份很容易,我对此很满意。
然而,在最近版本的 Ubuntu 中有 ufw 会严重污染 iptables。除了干净的规则列表之外,我还有很多不易阅读的规则:
$ iptables -L -v
Chain INPUT (policy DROP 6114 packets, 331K bytes)
pkts bytes target prot opt in out source destination
131K 76M ufw-before-logging-input all -- any any anywhere anywhere
131K 76M ufw-before-input all -- any any anywhere anywhere
6618 368K ufw-after-input all -- any any anywhere anywhere
6191 346K ufw-after-logging-input all -- any any anywhere anywhere
6191 346K ufw-reject-input all -- any any anywhere anywhere
6191 346K ufw-track-input all -- any any anywhere anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
390K 324M ufw-before-logging-forward all -- any any anywhere anywhere
390K 324M ufw-before-forward all -- any any anywhere anywhere
4 2160 ufw-after-forward all -- any any anywhere anywhere
4 2160 ufw-after-logging-forward all -- any any anywhere anywhere
4 2160 ufw-reject-forward all -- any any anywhere anywhere
4 2160 ufw-track-forward all -- any any anywhere anywhere
Chain OUTPUT (policy ACCEPT 1 packets, 52 bytes)
pkts bytes target prot opt in out source destination
326K 317M ufw-before-logging-output all -- any any anywhere anywhere
326K 317M ufw-before-output all -- any any anywhere anywhere
164 14960 ufw-after-output all -- any any anywhere anywhere
164 14960 ufw-after-logging-output all -- any any anywhere anywhere
164 14960 ufw-reject-output all -- any any anywhere anywhere
164 14960 ufw-track-output all -- any any anywhere anywhere
...
从这个角度来说。我真的不明白ufw的目的。它似乎增加了 iptables 的复杂性而没有真正的优势。
我错了吗?
如果您知道iptables
,如果您觉得iptables -L -v
很容易阅读并且喜欢它,那么您就不需要ufw
.
iptables
使用 Linux 内核中的数据包过滤规则表。您可以创建的表格、链和规则构成了一个强大而灵活的工具,但通常令人生畏且不够直观。有了它们,高级的东西是可能的,但基本的东西并不总是像新手用户(或一般用户)希望的那样容易。
此处输入ufw
(或其他类似工具)作为iptables
. 它使基本的事情变得容易,但不一定允许高级的事情。任何喜欢 GUI 的人都可以使用gufw
. Ubuntu 发布ufw
是因为它针对的是可能对引擎盖下的工作方式不感兴趣的用户。他们想要一个简单的界面,类似于他们在 Windows 或家庭路由器的 HTTP 界面中看到的界面。高级用户可以“手动”停用ufw
和使用iptables
。
的目的ufw
是有一个简单的前端。对于普通人此前端简单比对等“的规则清理名单”,你可以创建iptables
。ufw
实际创建的“大量不易阅读的规则”现在是后端。你说得对,ufw
增加了复杂性,但乔从来没有看到它。
一旦你决定使用ufw
(或继续使用它,如果它在那里默认),你不应该关心后端。将后端视为提供前端的工具的内部部分。
如果你想iptables
成为你的前端,那么不要使用ufw
,因为它ufw
把自己放在“更前面”。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句