List all rules
sudo iptables -L --line-numbers

Above command will list all rules with (num) in first column for each rule.

Now we can delete them by num
sudo iptables -D INPUT (num)

Super awesome example is here.

To block an IP 
sudo iptables -A INPUT -s xxx.xxx.xxx.xxx -j DROP

xxx.xxx.xxx.xxx is any IP address
Advertisements