【发布时间】:2019-03-23 08:06:32
【问题描述】:
有没有办法删除iptables 中的多行而不知道我的iptables 中有什么?
例如,我想删除端口 80 的所有端口转发,这里是 iptables:
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8080
REDIRECT tcp -- anywhere anywhere tcp dpt:https redir ports 8443
有没有办法在一个命令中删除这两行?
【问题讨论】:
-
你试过cat iptables的一些组合吗? grep(针对端口 80 的东西)> iptables ?
-
我找到了办法。但是我总是遇到这个错误:
/bin/sh: 527: [[: not found。你知道这是从哪里来的吗? -
为此我需要知道你在做什么。
-
感谢您的帮助。我终于找到了我的错误的根源:)
标签: linux networking iptables portforwarding