> For the complete documentation index, see [llms.txt](https://terraform201.devart.tv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://terraform201.devart.tv/1.-vpc/vpc/best-practice-subnet.md).

# Best practice Subnet 이해

서브넷을 용도별로 구분?

<figure><img src="https://245442085-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP4i1OWLT5Rh5l7_TGf%2Fuploads%2FBM7l6eyruf5Goy6Syroi%2Fvpc-subnet-worst.png?alt=media&amp;token=edfa931b-ed47-41b8-a695-14d6e5e86958" alt=""><figcaption><p>VPC Subnets in 1 zone</p></figcaption></figure>

* 과거에는 On-premise 서브넷팅을 잘게잘게 쪼개는게 맞았다 ( o )
* Because 층별로 구역별로, 부서 by 부서, 사람 by 사람으로 인터넷 방화벽 셋팅이 필요했기 때문에
* IP추적이 필요했기 때문에

<figure><img src="https://245442085-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP4i1OWLT5Rh5l7_TGf%2Fuploads%2FlVwkVT5QHeGaA9BZkWuP%2Fvpc-by-zone.png?alt=media&amp;token=51fe4ccd-5ce8-4faa-ada2-2dc57c10ff9e" alt=""><figcaption><p>Subnet by Zone</p></figcaption></figure>

* AWS Zone 을 High Availiability를 위해 Zone 을 나누는게 중요

<figure><img src="https://245442085-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP4i1OWLT5Rh5l7_TGf%2Fuploads%2Fb8PC074UVcy8kPJpB4Jc%2Fvpc-by-zone2.png?alt=media&amp;token=158bfecb-db3c-498c-894d-9623716d9f33" alt=""><figcaption><p>Private and Public subnets-1</p></figcaption></figure>

* 과거에는 24bit 사용하는게 범용적이었다.
* Because 읽기 편하기 때문이었죠.
* C-Natative 더이상 IP를 사용하는 것보다 Security, IP대역 넣는게 아니라 SG ID를 넣는게 좋은 것이다.

<figure><img src="https://245442085-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP4i1OWLT5Rh5l7_TGf%2Fuploads%2F2zCNgCke0AIWgycRMvaq%2Fvpc-by-zone3.png?alt=media&amp;token=ccd8a7b3-26cb-4717-8768-fa35c572cf93" alt=""><figcaption><p>Private and Public subnets-2</p></figcaption></figure>

* Subnet을 나누는 기준은 용도별이 아니라 Routing Table 분할할때 사용하는 것이다.
* Route table 에 따라서 서브넷을 종속시키고, 구분시켜야 한다.
