Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a problem on deleting a user-defined chain.
these the are rules I entered.

sudo iptables -t mangle -N internet
sudo iptables -t mangle -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j internet
sudo iptables -t mangle -A internet -j MARK --set-mark 99
sudo iptables -t nat -A PREROUTING -i eth1 -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination

When i'm using -X or -D, it gives me this error

iptables: No chain/target/match by that name.

this is the command i used to delete the "internet" chain

iptables -F internet

i also tried using this:

iptables -D internet


iptables -X internet

but it still gives me the same message.

share|improve this question
Sorry about that. i already edited my post – Raul Adrian Altavano Oct 22 '13 at 15:57
Could you provide the command you use when attempting the delete? – Roger Light Oct 22 '13 at 16:08
I have tried what you suggested but it still gives me the same error. I want to reconfigure my iptables and i need to delete those 4 commands I entered first. – Raul Adrian Altavano Oct 22 '13 at 16:55

To flush ALL your rules use:

sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -F
sudo iptables -X
sudo iptables -t nat -F
sudo iptables -t nat -X
sudo iptables -t mangle -F
sudo iptables -t mangle -X
share|improve this answer

Your Answer


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.