最終更新日: 2021年2月28日
CentOS7のファイアウォールの停止方法を紹介!
CentOS7のファイアウォールの停止方法を紹介します。CentOS7では初期のファイアウォールはiptablesではなくfirewalldに変更されています。firewalldを使ったファイアウォールの停止方法を解説していきます。
CentOS7からiptablesではなくfirewalld
CentOS7からファイアウォールの初期設定はiptables
ではなくfirewalld
に変更されています。
これまでiptables
で設定していた方は少し戸惑うかもしれませんが、新しいfirewalld
コマンドの使い方を覚えましょう。
CentOS7でファイアウォールの設定を確認する方法
まずファイアウォールの設定の確認方法です。下記のコマンドを実行しましょう。
ファイアウォールの設定を確認するコマンド
systemctl status firewalld
またファイアウォールの自動起動を確認したい場合は下記のコマンドを実行しましょう。
ファイアウォールの自動起動を確認するコマンド
systemctl is-enabled iptables
CentOS7のファイアウォールの停止方法
次にファイアウォールの停止方法について順番に紹介していきます。
ファイアウォールの停止
ファイアウォールを停止するには下記のコマンドを実行します。
ファイアウォールの停止方法
# 停止
systemctl stop firewalld
# 確認
systemctl status firewalld
ファイアウォールの自動起動の停止方法
ファイアウォールの自動起動の停止方法
# 停止
systemctl disable firewalld
# 確認
systemctl is-enabled iptables
# 再度自動起動したい場合
systemctl enable firewalld
