全球主机交流论坛
标题: debian 9 iptables 你们有没遇到问题 [打印本页]
作者: 大胡子 时间: 2017-11-14 20:44
标题: debian 9 iptables 你们有没遇到问题
- iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
- iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
- iptables -A OUTPUT -j ACCEPT
- iptables -A INPUT -p tcp --dport 80 -j ACCEPT
- iptables -A INPUT -p tcp --dport 22 -j ACCEPT
- iptables -A INPUT -p tcp --dport 443 -j ACCEPT
- iptables -A OUTPUT -p icmp -j ACCEPT
- iptables -A INPUT -p icmp -j ACCEPT
- iptables -A INPUT -j REJECT
- iptables -A FORWARD -j REJECT
- cat > /etc/network/if-post-down.d/iptables <<EOF
- #!/bin/bash
- iptables-save > /etc/iptables.rules
- EOF
- chmod +x /etc/network/if-post-down.d/iptables
- cat > /etc/network/if-pre-up.d/iptables <<EOF
- #!/bin/bash
- iptables-restore < /etc/iptables.rules
- EOF
- chmod +x /etc/network/if-pre-up.d/iptables
复制代码
重启后 所有端口都不能通了
以前都是这么操作的 有没相同问题的
作者: zhc670 时间: 2017-11-14 20:54
好像是运营商弄的,
我也碰到了,
一条条找吧。
作者: 大胡子 时间: 2017-11-14 21:01
啊 不是吧 规则清掉就可以 自己的问题
作者: 冻猫 时间: 2017-11-14 21:35
iptables -L -n --line-numbers看看本身默认有没有规则,是不是冲突了。
作者: hdown 时间: 2017-11-14 22:02
你这样有个问题,如果你设置之前,有其他iptables规则和你冲突就完蛋。
所以你开头应该加一句iptables -F INPUT 来清除之前所有的规则。
作者: ghost 时间: 2017-11-15 01:54
為什麼現在一萬分不給當神仙了...
作者: domin 时间: 2017-11-15 02:07
我知道是什么问题.
你是不是装了锐速
| 欢迎光临 全球主机交流论坛 (/) |
Powered by Discuz! X3.4 |