2

I'm having troubles removing this ipables rule in Ubuntu:

$ iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128

I've tried using the -D attribute but with no success. How can I remove this? I've tried flushing the tables but that didn't seem to work.

Any suggestions?

1
  • can you add output of iptables -t nat -nvL Commented Jun 2, 2014 at 6:13

1 Answer 1

4

It should just be:

sudo iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128

Or try to find line numbers (iptables -L --line-numbers), and use:

sudo iptables -D [number]

The second should definitely work.

Or try a third thing:

sudo iptables -F
sudo iptables -X
sudo iptables -t nat -F
sudo iptables -t nat -X

... you should be lucky with one of these.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.