15
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

centos7 ファイアーウォール起動、停止、selinux

Last updated at Posted at 2017-07-09

#ファイアーウォール起動、停止
firewalldの開始、終了、ステータス
# status
systemctl status firewalld

# start
systemctl start firewalld

# stop
systemctl stop firewalld

#ファイアウォール設定を要確認
Firewall-cmdというファイアウォールが自動的に有効になっている場合があり、見落としがちです。

ポート80 (http) と 443 (https)を開けるには、下記のようにします。

[root@XXX ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0 eth1
sources:
services: dhcpv6-client ssh
ports: 10443/tcp 10080/tcp 10050/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

確認
firewall-cmd --list-all
追加
firewall-cmd --permanent --zone=public --add-service=http
追加
firewall-cmd --permanent --zone=public --add-service=https
削除
firewall-cmd --permanent --zone=public --remove-service=dhcpv6-client
再起動
firewall-cmd --reload
再確認
firewall-cmd --list-all

※参考URL
https://www.jdbc.tokyo/2014/10/centos7-firewalld-startup/

#selinux 無効にする
# getenforce
Enforcing ⇒有効

「/etc/selinux/config」 修正して無効にする。
SELINUX=enforcing
↓変更
SELINUX=disabled

15
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?