AWS NACL (Network Access Control List)
AWS NACL (Network Access Control List)
Amazon web services provide a wide list of services and makes sure that these services do not
have to compromise with security. AWS takes security with highest priority and provides a
comprehensive set of tools and features to help the users protect their data and applications in
the cloud.
Let's take a scenario where you have two VPC(VPC One and VPC Two) and a VPC peering is
established between both the VPCs. Now when a request comes from VPC two for particular
subnet of VPC one, how will the VPC one distinguish it? For this we use NACL. In NACL we
define which traffic is destined to enter and leave subnet One.
Example2:
Suppose you have a VPC and you have two subnets subnet1 and subnet two. Now you want to
give someone permission to work only with subnet two resources. This can be done using
NACL. Only permitted user will be given access to the subnet after verifying their by IP
address. Let's understand with a diagram:
https://www.geeksforgeeks.org/aws-nacl-network-access-control-list/ 1/6
3/5/25, 7:51 PM AWS NACL (Network Access Control List) - GeeksforGeeks
When a VPC is created, a modifiable default NACL is created for the subnets of the VPC. If
we do not intent to use default one, we can explicitly create our own NACL. However, if we
do not explicitly define then a default one gets associated automatically.
The default NACL allows inbound and outbound traffic from anywhere.
A Network ACL can be associated with multiple subnets. However, a subnet can only be
associated with a single NACL. After being associated with one NACL if we try to attach
again then the old association is removed.
NACL contains inbound and outbound rules each with a rule number(1 to 32766). Rules are
then evaluated in order, deciding whether to allow or deny.
5. NACLs are stateless which means the information about old traffic are not saved.
https://www.geeksforgeeks.org/aws-nacl-network-access-control-list/ 2/6
3/5/25, 7:51 PM AWS NACL (Network Access Control List) - GeeksforGeeks
So create one:
https://www.geeksforgeeks.org/aws-nacl-network-access-control-list/ 3/6
3/5/25, 7:51 PM AWS NACL (Network Access Control List) - GeeksforGeeks
Step 4: Click On the NACL created go to subnet association there click on Edit subnet
association
https://www.geeksforgeeks.org/aws-nacl-network-access-control-list/ 4/6
3/5/25, 7:51 PM AWS NACL (Network Access Control List) - GeeksforGeeks
Step 6: In edit rule give rule number-90 for SSH type traffic and give your pc's IP address and
"Deny" the permission.Save Changes
https://www.geeksforgeeks.org/aws-nacl-network-access-control-list/ 5/6
3/5/25, 7:51 PM AWS NACL (Network Access Control List) - GeeksforGeeks
Now try to ssh into the server through your cmd. You won't be able to SSH into the server due
to restriction by NACL
FAQs On NACL
NACLs operate at the subnet level and are stateless, whereas Security Groups operate at
the instance level and are stateful.
By default, AWS NACL has rule number 100 to allow all inbound and outbound traffic.
Yes, you can associate an NACL with one or more subnets within a VPC. This allows you
to apply the same set of rules to multiple subnets.
https://www.geeksforgeeks.org/aws-nacl-network-access-control-list/ 6/6