LoginSignup
5
3

More than 3 years have passed since last update.

iptables nat ルールの削除

Last updated at Posted at 2020-02-27

参考: https://www.cyberciti.biz/faq/how-to-iptables-delete-postrouting-rule/

$ sudo iptables -t nat -L --line-numbers

Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination
1    MASQUERADE  all  --  192.168.80.0/24      anywhere
2    MASQUERADE  all  --  192.168.50.0/24      anywhere

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

↑ の num を指定する

$ sudo iptables -t nat -D POSTROUTING 1
OR
$ sudo iptables -t nat --delete POSTROUTING 1

5
3
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
5
3