-1
我想使用iptables來阻止所有傳入流量,但另一方面我想將所有傳出流量列入白名單。目前,我的iptables阻止我所有的傳出流量。我如何將這個白名單列入?如何阻止傳出流量?
iptables規則
iptables -F
iptables -P OUTPUT DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -A OUTPUT -o enp0s18 -j ACCEPT
iptables -I INPUT -p tcp --dport 26666 -j ACCEPT
的iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:26666
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
但它不工作:
curl http://google.com
curl: (6) Couldn't resolve host 'google.com'
有什麼不對?
非常感謝:)現在有效:) – Hanashi 2014-10-29 07:55:13