service iptables save がCentOS 7で出来ない( ゚Д゚)

Pocket

CentOS 7を使い始めて、iptablesの設定をしようとゴチャゴチャ・・・

# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

出来ない!systemctl使えって言ってるよ!!

調べてみたら、なんかこんな感じで使える様になるらしいw

[root@localhost ~]# yum install iptables-services
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.riken.jp
 * epel: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.riken.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ iptables-services.x86_64 0:1.4.21-16.el7 を インストール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
 Package                  アーキテクチャー
                                        バージョン            リポジトリー
                                                                           容量
================================================================================
インストール中:
 iptables-services        x86_64        1.4.21-16.el7         base         50 k

トランザクションの要約
================================================================================
インストール  1 パッケージ

総ダウンロード容量: 50 k
インストール容量: 24 k
Is this ok [y/d/N]: y
Downloading packages:
iptables-services-1.4.21-16.el7.x86_64.rpm                 |  50 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  インストール中          : iptables-services-1.4.21-16.el7.x86_64          1/1
  検証中                  : iptables-services-1.4.21-16.el7.x86_64          1/1

インストール:
  iptables-services.x86_64 0:1.4.21-16.el7

完了しました!
[root@localhost ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
[root@localhost ~]#

無事完了!
結局、コマンドをそのまま使える様に、以下をインストールするだけということですね。

yum install iptables-services

それもあるのですが、centOS 7からfirewalldに移行していますので、なるべくそちらへ移行することが望ましいです。

コメントを残す

メールアドレスが公開されることはありません。

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください