Bayaansanni
3 min readDec 31, 2023

AWS VPC NACL

This lab walks you through the steps to create a Custom NACL and associate with a Subnets

Architectural Diagram

Architectural Diagram

NACL act as a firewall for controlling traffic at the subnet level, allowing or denying inbound and outbound traffic based on the user-defined rules.

STEP 1: Create a NEW VPC

STEP 2: CREATE A SUBNETS

Subnet Name : DemoPublic and DemoPrivate Subnets

STEP 3: Create and Attach an Internet Gateway

IGW Name: bayaanIGW

Its important to attach the Internet Gateway to the VPC in other to enable internet access

STEP 4: CREATE ROUTE TABLE AND ASSOCIATE THEM IT WITH SUBNETS

In this step we would create a Public and Private Route table, Update route table and configure internet gateway and also important to enable auto-assign Public Ip for Public subnets

STEP 5: Launch an Ec2 instance

In this step we are going to launch our EC2 instance name MYpublicserver in the public subnet of BayaanVPC

In this step we would also be creating an ec2 instance in the private subnet named PrivateServer

So also we included our user data-Script when Launching our Ec2 instance

Step 6: Testing Both Ec2 intances

In this step we would be ping the IP address of our PrivateServer from our Public Server using SSH

STEP 7: CREATING CUSTOM NACL AND ASSOCIATE IT TO THE SUBNET

By default, both subnets will be associated with the Default NACL of MyVPC. Once you create a custom NACL and attach it to the public subnet and private Subnet. This custom NACL would restricts both inbound and Outbound traffic so its important to Add rules to our Custom NACL

STEP 8: Adding Rules to the Custom NACL (MyPublicNACL)

1. Navigate to VPC under the Services menu. Click on Network ACLs under Security.

2. Select MyPublicNACL from the list.