Iptables Unblock / Delete an IP Address Listed in IPtables Tables

‮.www‬lautturi.com
Iptables Unblock / Delete an IP Address Listed in IPtables Tables

To unblock or delete an IP address that is listed in the iptables tables, you can use the iptables-D or -D option followed by the name of the chain and the rule number.

For example, to delete the first rule in the INPUT chain, you can use the following command:

iptables -D INPUT 1

To delete a specific rule that includes a specific IP address, you can use the -S option to list the current rules, then use the -D option to delete the appropriate rule.

For example, to delete a rule that blocks incoming connections from the IP address 192.0.2.1, you can use the following commands:

iptables -S
iptables -D INPUT -s 192.0.2.1 -j DROP

Note that the iptables command is not persistent, so if you reboot your system or restart the iptables service, your changes will be lost. To make the changes persistent, you can use the iptables-save and iptables-restore commands to save the current rules to a file and restore them on boot.

It's also worth noting that the iptables command is deprecated in many modern Linux distributions in favor of the nftables command. If you are using a recent version of Linux, you may want to consider using nftables instead.

Created Time:2017-10-29 22:08:49  Author:lautturi