reset.sh
を実行し、初期設定を適用します。default.sh
を実行し、iptablesに規定値を設定します。save.sh
を実行し、iptablesに適用した設定を保存します。- iptablesサービスを再起動します。
$ systemctl [start|stop|status|restart] iptables
$ iptables -nvL
# 直接ファイルを見る場合。
$ cat /etc/iptables/iptables.rules
# 削除するルールのチェインと番号を確認する。
$ iptables -nvL --line-numbers
# チェインと番号を指定して削除する。
$ iptables -D <チェイン> <番号>
# マシンが最後に起動したときから記録されたパケットを全て表示する。
$ sudo journalctl -k | grep "IN=.*OUT=.*" | less