0

I have iptables and masquerading enabled through this:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

How can I revert this rule? i.e I want to disable the masquerade.

I am afraid to test..because if I fail..there would be a lot of problems (for example lose ssh)

Also can I restart iptables hoping that it wouldn't start rejecting all conns.

2 Answers 2

1

Use -D to delete a rule from the selected chain:

iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
0

If you delete a rule, that functionality will be gone.

So any SSH sessions that depend on that rule will also disconnect.

2
  • wrong, it will affect new connections only in the case of MASQUERADE, and indeed any other rule you had in the nat table.
    – Olipro
    Nov 10, 2011 at 23:49
  • @Olipro While we appreciate your efforts, we can't let you dramatically change the meaning of someone's answer like that. You should post that as an Answer yourself. Thank you!
    – Chris S
    Nov 26, 2012 at 18:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .