It was necessary to drive a team

$ sudo iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 6000 

And accidentally drove the team

 $ sudo iptables -t nat -A PREROUTING -p tcp -j REDIRECT --to-port 6000 

How to return everything to its place? external devices have stopped working.

    3 answers 3

     iptables-save > iptables.config nano iptables.config - тут исправляем то, что нужно iptables-restore iptables.config 

      inadvertently drove the team

       $ sudo iptables -t nat -A PREROUTING -p tcp -j REDIRECT --to-port 6000 

      remove this rule by replacing the -A (add) option with -D (delete). all other options / parameters should be exactly the same:

       $ sudo iptables -t nat -D PREROUTING -p tcp -j REDIRECT --to-port 6000 

        restart the iptables service. Unless of course there was no conservation. Restarting the iptables service restores the original rules.

        • It is not the answer to the question. To leave your comments or ask the author to clarify, leave a comment to the appropriate post. - From the queue of checks - Mr. Black
        • is an. For those who do not understand deciphered - maint
        • This response pulls the maximum to the comment - Mr. Black
        • this is the answer. Restarting the service depends on the management system. And what it will be systemd, upstart or sysv is no longer important. Restart and all - maint
        • @Doofy, for the particular case - quite the answer. maint , but the fact that this is a special case (availability of the service and / or start-stop iptables script) should be explicitly stated in the answer. Yes, and what “saving” is also a good idea to mention explicitly (I suspect that we are talking about something like the package iptables-persistent , which also does not necessarily have to be present, either in the system or in the distribution repository). - aleksandr barakin