将iptables规则映射到本地文件,对文件进行编辑

sudo iptables-save >/tmp/iptables-rule

编辑之后再次还原到iptables里即可

sudo iptables-restore < /tmp/iptables-rule