临时封锁
iptables -D INPUT -s 115.205.205.104 -j DROP
iptables -I INPUT -s 115.205.205.104 -j DROP
查看哪些端口已经开放
vim /etc/sysconfig/iptables
服务器重启也不会消失的做法
vim /etc/sysconfig/iptables
-A INPUT -s 115.205.205.104/32 -j DROP
-A 添加在指定链表尾部 -I添加在指定链表前面
因为service iptables save错误,缺少了iptables 服务
- systemctl stop firewalld
- yum install iptables-services
- systemctl enable iptables
- systemctl start iptables
- service iptables save
- 此时在/etc/sysconfig文件夹下就有了iptables文件
- systemctl start firewalld
1 | 启动: systemctl start firewalld |
开启防火墙之后端口无法访问
firewall-cmd --list-ports
防火墙开放的端口firewall-cmd --zone=public --add-port=80/tcp --permanent
开放80端口systemctl reload firewalld
docker启动报错 (iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport
重启Docker
systemctl restart docker