debian上重启个iptables,关一下十分不习惯
关闭如下
#!/bin/bash iptables-save > iptables.rules iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT
检查一下
~# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
重新恢复规则
~# iptables-restore < ./iptables.rules
会发现重定向到文件中的规则又回来了