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 am trying to delete an IP address that appears listed on the server's IPtable.

I'm using the following command to list the IPs:

iptables -L INPUT -n --line-numbers

Giving me a result like:

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    acctboth   all  --             
2    DROP       all  --  xxx.xx.xx.xx 


How to delete or unblock the entry number two, listed as xxx.xx.xx.xx ?

share|improve this question
man iptables whould give you all answers you wish – user61928 Sep 28 '12 at 5:57
up vote 3 down vote accepted

Look at the number on the left, then use number to delete it. For example delete line number 2, enter:

iptables -D INPUT 2
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.