1.查看iptables中已经设置好的规则 sudo iptabes -L -n 2.清除现有的规则 sudo iptables -F 清除预设表filter中所有规则链的规则 sudo iptabels -X 清除预设表filter中使用者自定链中的规则 3.设定预设规则 sudo iptables -P INPUT DROP //不在里面的不通过(drop) sudo iptables -P OUTPUT ACCEPT //不在里面的通过(accept) sudo iptables -P FORWARD More