Block IP address in AWS VPC Network ACL

Home » Uncategorized » Block IP address in AWS VPC Network ACL
Uncategorized No Comments

Just like firewall we can create an entry in VPC Network ACL to block certain IP addresses e.g. repeated hacking attempts.

E.g. say we want to block this IP: 185.153.199.126

To do this in AWS Console, go to VPC > Network ACLs to add a DENY inbound rules entry.

50ALL TrafficALLALL185.153.199.126/32DENY

Or do this from AWS command line tool:

>aws --region ap-southeast-2 ec2 create-network-acl-entry --network-acl-id acl-10f62475 --ingress --rule-number 50 --protocol -1 --cidr-block 54.163.251.208/32 --rule-action deny

If using command line tool make sure the access key has the required permission e.g. use the SportLogic “cli” IAM user.