环境是:centos7
输入一些规则命令后 执行 systemctl restart iptables 后光标就停止在那里不动了?怎么会这样?如何 fix ?先谢谢小伙伴们
1
msg7086 2018-05-03 00:28:53 +08:00
> 怎么会这样?
可能是你的规则有问题。 > 如何 fix ? 先连接到终端,然后找到有问题的规则,删除即可。 |
2
kmdd33 OP @msg7086
目前/ etc / sysconfig / iptables 里面的规则如下,能否帮忙看看哪些规则有问题? # Generated by iptables-save v1.4.21 on Wed May 2 14:25:01 2018 *nat :PREROUTING ACCEPT [42:3020] :INPUT ACCEPT [11:580] :OUTPUT ACCEPT [40:3157] :POSTROUTING ACCEPT [26:1797] COMMIT # Completed on Wed May 2 14:25:01 2018 # Generated by iptables-save v1.4.21 on Wed May 2 14:25:01 2018 *mangle :PREROUTING ACCEPT [699:342435] :INPUT ACCEPT [699:342435] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [666:372931] :POSTROUTING ACCEPT [652:371571] COMMIT # Completed on Wed May 2 14:25:01 2018 # Generated by iptables-save v1.4.21 on Wed May 2 14:25:01 2018 *raw :PREROUTING ACCEPT [699:342435] :OUTPUT ACCEPT [666:372931] COMMIT # Completed on Wed May 2 14:25:01 2018 # Generated by iptables-save v1.4.21 on Wed May 2 14:25:01 2018 *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT DROP [0:0] :ALLOWIN - [0:0] :ALLOWOUT - [0:0] :DENYIN - [0:0] :DENYOUT - [0:0] :INVALID - [0:0] :INVDROP - [0:0] :LOCALINPUT - [0:0] :LOCALOUTPUT - [0:0] :LOGDROPIN - [0:0] :LOGDROPOUT - [0:0] -A INPUT -s 67.207.67.2/32 ! -i lo -p tcp -m tcp --dport 53 -j ACCEPT -A INPUT -s 67.207.67.2/32 ! -i lo -p udp -m udp --dport 53 -j ACCEPT -A INPUT -s 67.207.67.2/32 ! -i lo -p tcp -m tcp --sport 53 -j ACCEPT -A INPUT -s 67.207.67.2/32 ! -i lo -p udp -m udp --sport 53 -j ACCEPT -A INPUT -s 67.207.67.3/32 ! -i lo -p tcp -m tcp --dport 53 -j ACCEPT -A INPUT -s 67.207.67.3/32 ! -i lo -p udp -m udp --dport 53 -j ACCEPT -A INPUT -s 67.207.67.3/32 ! -i lo -p tcp -m tcp --sport 53 -j ACCEPT -A INPUT -s 67.207.67.3/32 ! -i lo -p udp -m udp --sport 53 -j ACCEPT -A INPUT ! -i lo -j LOCALINPUT -A INPUT -i lo -j ACCEPT -A INPUT ! -i lo -p tcp -j INVALID -A INPUT ! -i lo -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 20 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 21 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 22 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 25 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 53 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 80 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 110 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 143 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 443 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 465 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 587 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 993 -j ACCEPT -A INPUT ! -i lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 995 -j ACCEPT -A INPUT ! -i lo -p udp -m conntrack --ctstate NEW -m udp --dport 20 -j ACCEPT -A INPUT ! -i lo -p udp -m conntrack --ctstate NEW -m udp --dport 21 -j ACCEPT -A INPUT ! -i lo -p udp -m conntrack --ctstate NEW -m udp --dport 53 -j ACCEPT -A INPUT ! -i lo -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j ACCEPT -A INPUT ! -i lo -p icmp -m icmp --icmp-type 0 -m limit --limit 1/sec -j ACCEPT -A INPUT ! -i lo -p icmp -m icmp --icmp-type 11 -j ACCEPT -A INPUT ! -i lo -p icmp -m icmp --icmp-type 3 -j ACCEPT -A INPUT ! -i lo -j LOGDROPIN -A INPUT -s 113.118.253.231/32 -j ACCEPT -A INPUT -s 103.21.244.0/22 -j ACCEPT -A INPUT -s 103.22.200.0/22 -j ACCEPT -A INPUT -s 103.31.4.0/22 -j ACCEPT -A INPUT -s 104.16.0.0/12 -j ACCEPT -A INPUT -s 108.162.192.0/18 -j ACCEPT -A INPUT -s 131.0.72.0/22 -j ACCEPT -A INPUT -s 141.101.64.0/18 -j ACCEPT -A INPUT -s 162.158.0.0/15 -j ACCEPT -A INPUT -s 172.64.0.0/13 -j ACCEPT -A INPUT -s 173.245.48.0/20 -j ACCEPT -A INPUT -s 188.114.96.0/20 -j ACCEPT -A INPUT -s 190.93.240.0/20 -j ACCEPT -A INPUT -s 197.234.240.0/22 -j ACCEPT -A INPUT -s 198.41.128.0/17 -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT -A INPUT -i eth0 -p udp -m udp --sport 53 -j ACCEPT -A INPUT -s 113.118.253.231/32 -i eth0 -p tcp -m tcp --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT -A INPUT -i eth0 -p tcp -m tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -m limit --limit 25/min --limit-burst 100 -j ACCEPT -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT -A FORWARD -i eth0 -o eth1 -j ACCEPT -A OUTPUT -d 67.207.67.2/32 ! -o lo -p tcp -m tcp --dport 53 -j ACCEPT -A OUTPUT -d 67.207.67.2/32 ! -o lo -p udp -m udp --dport 53 -j ACCEPT -A OUTPUT -d 67.207.67.2/32 ! -o lo -p tcp -m tcp --sport 53 -j ACCEPT -A OUTPUT -d 67.207.67.2/32 ! -o lo -p udp -m udp --sport 53 -j ACCEPT -A OUTPUT -d 67.207.67.3/32 ! -o lo -p tcp -m tcp --dport 53 -j ACCEPT -A OUTPUT -d 67.207.67.3/32 ! -o lo -p udp -m udp --dport 53 -j ACCEPT -A OUTPUT -d 67.207.67.3/32 ! -o lo -p tcp -m tcp --sport 53 -j ACCEPT -A OUTPUT -d 67.207.67.3/32 ! -o lo -p udp -m udp --sport 53 -j ACCEPT -A OUTPUT ! -o lo -j LOCALOUTPUT -A OUTPUT ! -o lo -p tcp -m tcp --dport 53 -j ACCEPT -A OUTPUT ! -o lo -p udp -m udp --dport 53 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m tcp --sport 53 -j ACCEPT -A OUTPUT ! -o lo -p udp -m udp --sport 53 -j ACCEPT -A OUTPUT -o lo -j ACCEPT |
3
kmdd33 OP -A OUTPUT ! -o lo -p tcp -j INVALID
-A OUTPUT ! -o lo -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 20 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 21 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 22 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 25 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 53 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 80 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 110 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 113 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 443 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 587 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 993 -j ACCEPT -A OUTPUT ! -o lo -p tcp -m conntrack --ctstate NEW -m tcp --dport 995 -j ACCEPT -A OUTPUT ! -o lo -p udp -m conntrack --ctstate NEW -m udp --dport 20 -j ACCEPT -A OUTPUT ! -o lo -p udp -m conntrack --ctstate NEW -m udp --dport 21 -j ACCEPT -A OUTPUT ! -o lo -p udp -m conntrack --ctstate NEW -m udp --dport 53 -j ACCEPT -A OUTPUT ! -o lo -p udp -m conntrack --ctstate NEW -m udp --dport 113 -j ACCEPT -A OUTPUT ! -o lo -p udp -m conntrack --ctstate NEW -m udp --dport 123 -j ACCEPT -A OUTPUT ! -o lo -p icmp -m icmp --icmp-type 0 -j ACCEPT -A OUTPUT ! -o lo -p icmp -m icmp --icmp-type 8 -j ACCEPT -A OUTPUT ! -o lo -p icmp -m icmp --icmp-type 11 -j ACCEPT -A OUTPUT ! -o lo -p icmp -m icmp --icmp-type 3 -j ACCEPT -A OUTPUT ! -o lo -j LOGDROPOUT -A OUTPUT -o eth0 -p udp -m udp --dport 53 -j ACCEPT -A OUTPUT -o eth0 -p tcp -m tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT -A OUTPUT -o eth0 -p tcp -m tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT -A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT -A OUTPUT -p tcp -m tcp --sport 80 -j ACCEPT -A OUTPUT -p tcp -m tcp --sport 443 -j ACCEPT -A OUTPUT -p tcp -m tcp --sport 3306 -j ACCEPT -A ALLOWIN -s 198.41.128.0/17 ! -i lo -j ACCEPT -A ALLOWIN -s 197.234.240.0/22 ! -i lo -j ACCEPT -A ALLOWIN -s 190.93.240.0/20 ! -i lo -j ACCEPT -A ALLOWIN -s 188.114.96.0/20 ! -i lo -j ACCEPT -A ALLOWIN -s 173.245.48.0/20 ! -i lo -j ACCEPT -A ALLOWIN -s 172.64.0.0/13 ! -i lo -j ACCEPT -A ALLOWIN -s 162.158.0.0/15 ! -i lo -j ACCEPT -A ALLOWIN -s 141.101.64.0/18 ! -i lo -j ACCEPT -A ALLOWIN -s 131.0.72.0/22 ! -i lo -j ACCEPT -A ALLOWIN -s 108.162.192.0/18 ! -i lo -j ACCEPT -A ALLOWIN -s 104.16.0.0/12 ! -i lo -j ACCEPT -A ALLOWIN -s 103.31.4.0/22 ! -i lo -j ACCEPT -A ALLOWIN -s 103.22.200.0/22 ! -i lo -j ACCEPT -A ALLOWIN -s 103.21.244.0/22 ! -i lo -j ACCEPT -A ALLOWIN -s 113.118.253.228/32 ! -i lo -j ACCEPT -A ALLOWIN -s 113.118.253.242/32 ! -i lo -j ACCEPT -A ALLOWIN -s 113.118.253.234/32 ! -i lo -j ACCEPT -A ALLOWOUT -d 198.41.128.0/17 ! -o lo -j ACCEPT -A ALLOWOUT -d 197.234.240.0/22 ! -o lo -j ACCEPT -A ALLOWOUT -d 190.93.240.0/20 ! -o lo -j ACCEPT -A ALLOWOUT -d 188.114.96.0/20 ! -o lo -j ACCEPT -A ALLOWOUT -d 173.245.48.0/20 ! -o lo -j ACCEPT -A ALLOWOUT -d 172.64.0.0/13 ! -o lo -j ACCEPT -A ALLOWOUT -d 162.158.0.0/15 ! -o lo -j ACCEPT -A ALLOWOUT -d 141.101.64.0/18 ! -o lo -j ACCEPT -A ALLOWOUT -d 131.0.72.0/22 ! -o lo -j ACCEPT -A ALLOWOUT -d 108.162.192.0/18 ! -o lo -j ACCEPT -A ALLOWOUT -d 104.16.0.0/12 ! -o lo -j ACCEPT -A ALLOWOUT -d 103.31.4.0/22 ! -o lo -j ACCEPT -A ALLOWOUT -d 103.22.200.0/22 ! -o lo -j ACCEPT -A ALLOWOUT -d 103.21.244.0/22 ! -o lo -j ACCEPT -A ALLOWOUT -d 113.118.253.228/32 ! -o lo -j ACCEPT -A ALLOWOUT -d 113.118.253.242/32 ! -o lo -j ACCEPT -A ALLOWOUT -d 113.118.253.234/32 ! -o lo -j ACCEPT -A DENYIN -s 60.13.146.146/32 ! -i lo -j DROP -A DENYIN -s 159.65.84.166/32 ! -i lo -j DROP -A DENYIN -s 188.166.118.251/32 ! -i lo -j DROP -A DENYIN -s 52.224.125.95/32 ! -i lo -j DROP -A DENYIN -s 54.95.198.124/32 ! -i lo -j DROP -A DENYIN -s 67.225.163.129/32 ! -i lo -j DROP -A DENYIN -s 211.110.184.22/32 ! -i lo -j DROP -A DENYIN -s 80.82.78.53/32 ! -i lo -j DROP -A DENYIN -s 103.207.36.78/32 ! -i lo -j DROP -A DENYIN -s 195.154.105.200/32 ! -i lo -j DROP -A DENYIN -s 149.202.178.136/32 ! -i lo -j DROP -A DENYIN -s 133.130.102.142/32 ! |