0
0

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.

ubuntuのiptables操作

Posted at

はじめに

  • 自社の環境は大多数がCentOSubuntuは10%にも満たない。
  • そのubuntuのネットワーク設定変更依頼(特にiptables関連)はそれなりにあるが、CentOSとは異なり、忘れがちなのでノウハウとして残しておく。

概要

  • ubuntuのiptablesに関するノウハウ。

詳細

全般

  • ubuntuのバージョン確認
# cat /etc/os-release

※本資料は以下のバージョンで試しています
VERSION="16.04.3 LTS (Xenial Xerus)"
  • iptablesの場所
/etc/iptables/rules.v4

iptables更新の流れ

  • iptablesの保存
    • メモリにのみ展開されている設定があるかもしれないので、作業前に必ず行う
# iptables-save > /etc/iptables/rules.v4
  • iptablesの反映
    • リダイレクトの向きを間違うと、全ての設定が消えるので要注意
# iptables-restore < /etc/iptables/rules.v4
  • iptablesの設定内容確認
# iptables -L
# iptables -L -n > /tmp/iptables とすると、ファイル出力が可能
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?