Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 192.168.3.1

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

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

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

iptables -F internet

i also tried using this:

iptables -D internet

and

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

1 Answer 1

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

 
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.