如何对目标IP使用好了!选项?
我正试图将外接的广域网DNS流量重定向到我的天坑,但我无法让目的地好了!选项工作。
例如:
iptables -A OUTPUT -d ! 134.134.134.134 -j ACCEPT返回:
Bad argument `134.134.134.134'我一点也不知道我的语法出了什么问题。
发布于 2013-05-11 14:07:52
你把!放错地方了。它属于-d之前。
来自iptables手册页:
[!] -d, --destination address[/mask][,...]例如:
iptables -A OUTPUT ! -d 134.134.134.134 -j ACCEPT发布于 2013-05-11 14:07:13
试着把它放在--选项之前
[root@pineapple ~]# iptables -A OUTPUT -d! 134.134.134.134 -j ACCEPT
Using intrapositioned negation (`--option ! this`) is deprecated in favor of extrapositioned (`! --option this`).
[root@pineapple ~]# iptables -A OUTPUT ! -d 134.134.134.134 -j ACCEPT
[root@pineapple ~]# iptables -nvL | grep 134
78 92618 ACCEPT all -- * * 0.0.0.0/0 !134.134.134.134 https://serverfault.com/questions/506939
复制相似问题