linux:commands:network:iptables

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:commands:network:iptables [2020/02/09 17:06] – [設定内容をチェインごとに表示] ともやんlinux:commands:network:iptables [2020/02/10 08:53] (現在) ともやん
行 31: 行 31:
 REDIRECT   tcp  --  0.0.0.0/           0.0.0.0/           tcp dpt:80 redir ports 3128 REDIRECT   tcp  --  0.0.0.0/           0.0.0.0/           tcp dpt:80 redir ports 3128
 REDIRECT   tcp  --  0.0.0.0/           0.0.0.0/           tcp dpt:443 redir ports 3129 REDIRECT   tcp  --  0.0.0.0/           0.0.0.0/           tcp dpt:443 redir ports 3129
 +</code>
 +
 +===== nat テーブルの削除 =====
 +**iptables -t <table> -nL <chain> --line-numbers** - ルール番号の表示\\
 +**iptables -t <table> -D <chain> <rule num>** - ルールの削除\\
 +<code>
 +$ sudo iptables -t nat -nL PREROUTING --line-numbers
 +Chain PREROUTING (policy ACCEPT)
 +num  target     prot opt source               destination
 +1    REDIRECT   tcp  --  0.0.0.0/           0.0.0.0/           tcp dpt:80 redir ports 3128
 +2    REDIRECT   tcp  --  0.0.0.0/           0.0.0.0/           tcp dpt:443 redir ports 3129
 +
 +$ sudo iptables -t nat -D PREROUTING 2
 +$ sudo iptables -t nat -D PREROUTING 1
 +
 +$ sudo iptables -t nat -nL PREROUTING --line-numbers
 +Chain PREROUTING (policy ACCEPT)
 +num  target     prot opt source               destination
 +
 </code> </code>
  
行 47: 行 66:
 $ sudo iptables-restore < iptables_save.txt $ sudo iptables-restore < iptables_save.txt
 </code> </code>
 +
 +===== 参考文献 =====
 +[[https://www.atmarkit.co.jp/ait/articles/0505/17/news131.html|natテーブルを利用したLinuxルータの作成 (1/6):習うより慣れろ! iptablesテンプレート集(2) - @IT]]\\
 +
  
  • linux/commands/network/iptables.1581235574.txt.gz
  • 最終更新: 2020/02/09 17:06
  • by ともやん