iptables(ファイアフォール)の棚卸をする
from iptablesの基本的な使い方
iptables(ファイアフォール)の棚卸をする
Dockerとかが自動で書き換えるのであまり人間にやさしくない構造になっていることがある。
iptables-saveの値はソートされていてある程度見やすい形になっている
これを利用して、ルールを棚卸する
一度書き出しておく
code:sh
echo cp /etc/iptables/rules.v4{,_$(date +%F)}
出てきたコマンドを確認し、貼り付け
書き出し
code:sh
iptables-save > /etc/iptables/rules.v4
リロードする
Reloading iptables
code:plain
iptables-restore < /etc/iptables/rules.v4