Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的服务器上运行 ubuntu server lts 12.04,我想查看使用 iptables 指定的所有规则。当我运行 iptables -L 时,我得到了规则列表,但是因为我没有使用任何界面,所以我无法看到所有这些界面,因为我无法上下滚动。我已经研究过是否有任何文件存储 iptables 规则,但我找不到任何有用的信息。因此,我在这里写我的问题:
iptables 在哪里存储它的规则?或者有什么办法可以一一查看黑屏规则?
十分感谢。
iptables 本身不会将当前规则存储在文件中。它只是配置内核中的表。
无论如何,您可以使用创建当前规则集的快照
iptables-save > /path/to/file
并稍后恢复它
iptables-restore < /path/to/file