23
20

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.

[RHEL][CentOS] OS 再起動時に /etc/sysconfig/iptables のルールが反映されない

Posted at

/etc/sysconfig/iptables を直接変更してルールを記述したら、service iptables save で設定を保存するのを忘れずに。

/etc/sysconfig/iptables に設定を書いて、service iptables reload すると、ルールが反映される。

$ sudo vim /etc/sysconfig/iptables

$ sudo service iptables reload
$ sudo iptables -L
# /etc/sysconfig/iptables で記述したルール

しかし、OS 再起動時は、iptables-restore で設定を反映するので、/etc/sysconfig/iptables のルールが反映されない。

# OS 再起動

$ sudo iptables -L
# /etc/sysconfig/iptables が反映されない...

設定変更後は、service iptables save しておく。

$ sudo vim /etc/sysconfig/iptables
$ sudo service iptables save
23
20
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
23
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?