Search code examples
amazon-web-servicessshbitnamiamazon-lightsail

Unblock an IP address on AWS LightSail


My website https://www.pinbargain.com is hosted on LightSail received some suspicious IP addresses, therefore, I followed this document https://docs.bitnami.com/aws/faq/configuration/block-suspicious-ip/ to block some suspicious IP address I use this command to block the IP address:

iptables -A INPUT -s 1.2.3.4 -j DROP

Now the problem is I accidentally blocked IP address from my Internal service. Therefore, I want to find the IP address I blocked and unlock them.

I have searched on docs.bitnami.com but I couldn't find the command to unblock.


Solution

  • I took a closer look at the article you sent (https://docs.bitnami.com/aws/faq/configuration/block-suspicious-ip/).

    At the bottom, it says how to delete a rule (aka how to unblock an IP).

    Basically, you would run this command (replace 1.2.3.4 with the IP):

    iptables -D INPUT -s 1.2.3.4 -j DROP
    

    I also found out how to see a list of blocked IPs by looking at the help menu:

    iptables --list-rules
    

    Also, don't forget to reboot.