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.

link|improve this question

78% accept rate
feedback

2 Answers

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

iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
link|improve this answer
feedback

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

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

link|improve this answer
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 '11 at 23:49
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.