I ran

sudo iptables -A INPUT -p udp -j LOG --log-prefix "udp:"

How do I make it stop?


The corresponding flag to delete a rule is -D; you can either use the same specification that you previously added or you can use the rule number.

To undo:

sudo iptables -A INPUT -p udp -j LOG --log-prefix "udp:"

... use:

sudo iptables -D INPUT -p udp -j LOG --log-prefix "udp:"

... or find the rule number with:

iptables -L INPUT --line-numbers  # perhaps with a "|grep LOG" to narrow it down

receiving output such as:

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
8    LOG        udp  --  anywhere             anywhere             LOG level warning prefix "udp:"

... you could then remove it with:

iptables -D INPUT 8 

... where 8 is the "num" from the previous output that matches the rule you want to remove.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.