> For the complete documentation index, see [llms.txt](https://mamawhocode.gitbook.io/aws/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mamawhocode.gitbook.io/aws/services/network/vpc/subnet/nacl.md).

# NACL

## Overview

* is a virtual firewall that controls inbound and outbount traffic at the `SUBNET` level.
* like a passport control officer, who can `allow` or `disallow` a packet go through your `subnet`.&#x20;
* contains numbered list of rules. Lowest number = Highest priority.

## vs. Security Group

| level       | instance level                                    | subnet level                                  |
| ----------- | ------------------------------------------------- | --------------------------------------------- |
| state       | statefull                                         | stateless (remember **nothing**)              |
| rule        | only support `Allow` rule                         | support both `Allow` & `Deny` rules           |
| **default** | <p>- deny all inbound<br>- allow all outbound</p> | allow all in/outbound traffic                 |
| evaluate    | all the rule before deciding                      | proceed by pritority number, start from 100.. |

![](/files/CwEVQllegsCXnNvW5fkA)

## Trivia

* Only 1 NACL / subnet
* By default, NACL allows all inbound, outbound traffic
* Once a rule match, NACL stops proceed to the next rule.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mamawhocode.gitbook.io/aws/services/network/vpc/subnet/nacl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
