Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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

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

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

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

share|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
    
@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 '12 at 18:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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