- Newest
- Most votes
- Most comments
According to me the solution for this is to connect to the EC2 instance and drop the ip using the command #Check for IP tables
sudo iptables -A INPUT -s <IP-ADDRESS-TO-BLOCK> -j DROP
sudo service iptables save
Block an IP using firewalld
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="<IP-ADDRESS-TO-BLOCK>" drop' sudo firewall-cmd --reload
by following above steps we have block the IP tail -f /var/log/httpd/access_log # to check ip status
But if in the security group if AWS allows us to Drop an option in a custom where we can give the required ip i will be easier but this option we cant find.
create a rule in your Network Access Control List to deny traffic from that IP
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html
Relevant content
- asked 8 months ago
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 4 months ago
Thank you. But If we create NACL rule it will be denied for all the instances in that network. Even we cant login to the ec2 tried this solution