CentOS7

firewalld インストール

IPTABLES停止

[root@centos ~]# systemctl stop iptables
[root@centos ~]# systemctl disable iptables
[root@centos ~]# systemctl is-enabled iptables

firewalldインストール

[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 ←設定を反映

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2018-08-05 (日) 11:18:32