Iptables Unblock / Delete an IP Address Listed in IPtables Tables
To unblock or delete an IP address listed in the iptables tables, follow these steps:
- Check the
iptablesrules for the IP address you want to unblock by running the following command:sudo iptables -L -n --line-numbersThis will display a list of all
iptablesrules, along with their line numbers. Look for the rule that blocks the IP address you want to unblock. - Note the line number of the rule that blocks the IP address. For example, if the rule blocking the IP address has a line number of 3, note the number 3.
- To unblock the IP address, delete the corresponding rule using the following command:
sudo iptables -D INPUT <line-number>Replace
<line-number>with the line number of the rule that blocks the IP address. For example, if the rule blocking the IP address has a line number of 3, run the following command:sudo iptables -D INPUT 3 - Verify that the rule has been deleted by running the following command:
sudo iptables -L -n --line-numbersThe output should not contain the rule that was blocking the IP address.
iptables tables and should now be able to access your server.