0

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.

3
  • Sorry about that. i already edited my post Oct 22, 2013 at 15:57
  • Could you provide the command you use when attempting the delete? Oct 22, 2013 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. Oct 22, 2013 at 16:55

1 Answer 1

3

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .