[root@centos ~]# systemctl stop iptables |
[root@centos ~]# systemctl disable iptables |
[root@centos ~]# systemctl is-enabled iptables |
[root@centos ~]# yum -y install firewalld |
[root@centos ~]# systemctl start firewalld |
[root@centos ~]# systemctl enable firewalld |
[root@centos ~]# systemctl is-enabled firewalld |
enabled |
[root@centos ~]# firewall-cmd --list-all ←設定を確認 |
public (default) interfaces: sources: services: dhcpv6-client ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules: |
[root@centos ~]# firewall-cmd --permanent --zone=public --add-service=http ←httpを開放 |
[root@centos ~]# firewall-cmd --permanent --zone=public --add-service=https ←httpsを開放 |
[root@centos ~]# firewall-cmd --permanent --zone=public --add-service=smtp ←smtpを開放 |
[root@centos ~]# firewall-cmd --permanent --zone=public --add-service=pop3s ←pop3sを開放 |
[root@centos ~]# firewall-cmd --permanent --zone=public --add-service=imaps ←imapsを開放 |
[root@centos ~]# firewall-cmd --permanent --zone=public --add-service=smtps ←smtpsを開放 |
[root@centos ~]# firewall-cmd --reload ←設定を反映 |