GNU/Linux >> Linux の 問題 >  >> Cent OS

CentOS/RHEL 7 および 8 で firewalld の代わりに iptables を使用する方法

CentOS/RHEL 7 以降、iptables は firewalld に置き換えられます。場合によっては、CentOS/RHEL 7 または 8 システムで、firewalld の代わりに古き良き iptables を使用したい場合があります。この投稿では、変換を実行するために必要な手順の概要を説明します。

1. iptables サービス パッケージをインストールします。

# /usr/bin/yum install iptables-services

2. firewalld サービスを停止します:

# /usr/bin/systemctl stop firewalld

3. firewalld サービスをマスクします (マスキングすると、firewalld サービスを開始できなくなります):

# /usr/bin/systemctl mask firewalld

4. iptables サービスを開始します:

# /usr/bin/systemctl start iptables

5. iptable サービスのステータスを確認します:

# /usr/bin/systemctl status iptables
● iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
Active: active (exited) since Fri 2019-12-13 14:39:38 IST; 1min 49s ago
...

6. ブート時に iptables が起動するようにします:

# /usr/bin/systemctl enable iptables

7. iptables ルールをリストします:

# /usr/sbin/iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
...


Cent OS
  1. CentOS / RHEL 7 :firewalld から iptables に切り替える方法

  2. CentOS / RHEL 7でfirewalldを無効にしてiptablesに切り替える方法

  3. CentOS/RHEL 8 で firewalld ロギングを構成する方法

  1. CentOS7にPHPComposerをインストールして使用する方法

  2. CentOS7でfirewalldを有効にして使用する方法

  3. CentOS7にifconfigをインストールして使用する方法

  1. CentOS8にCurlをインストールして使用する方法

  2. CentOS 7 / RHEL 7にReaR(移行およびリカバリツール)をインストールして使用する方法

  3. CentOS 8 /RHEL8にコックピットをインストールして使用する方法