Amazon VPC — the basics
A private network you draw yourself: a CIDR block, subnets carved out of it, route tables that say where packets go, and two firewalls with opposite personalities. Almost every "it can't connect" is one of five things, and they are all on this page.
Một mạng riêng do chính bạn vẽ ra: một khối CIDR, các subnet cắt ra từ đó, route table quyết định gói tin đi đâu, và hai loại firewall với tính cách trái ngược. Gần như mọi ca "không kết nối được" đều nằm trong năm nguyên nhân, và tất cả đều có ở trang này.
Put it in a public subnet when… / keep it private when…Khi nào đặt ở subnet public… / khi nào giữ trong private…
Public subnetSubnet public
- It is the front door — an internet-facing load balancer, see ELB · ASG.Nó là cửa ngõ đón request từ internet — ví dụ một load balancer public, xem ELB · ASG.
- It is the egress path: a NAT Gateway or NAT Instance. The NAT itself must be public or nothing gets out.Nó chính là đường ra: NAT Gateway hoặc NAT Instance. Bản thân NAT bắt buộc phải nằm ở subnet public, không thì chính nó cũng không ra được internet.
- A third party must allowlist a fixed source IP → the NAT Gateway's Elastic IP is what they see.Bên thứ ba cần allowlist một IP nguồn cố định → IP họ nhìn thấy chính là Elastic IP của NAT Gateway.
- A bastion host — and even then, check whether Session Manager makes it unnecessary.Một bastion host — nhưng trước khi dựng, hãy cân nhắc Session Manager, thường là không cần bastion nữa.
Keep it privateGiữ ở subnet private
- App servers, workers, ECS · EKS tasks — they only ever initiate outbound. Give them a NAT, not a public IP.App server, worker, task ECS · EKS — chúng chỉ chủ động gọi ra ngoài, không ai gọi vào. Cho chúng đi qua NAT, đừng cấp public IP.
- Every database: RDS · Aurora and caches. A DB in a public subnet is a finding, not a design.Mọi database: RDS · Aurora và cache. Để database ở subnet public là lỗi kiến trúc — đi audit là bị bắt ngay.
- A Lambda attached to the VPC — it gets an ENI in your subnet precisely so it can talk to private things.Một Lambda gắn vào VPC — cái ENI nó nhận trong subnet của bạn chính là thứ để nó gọi được tới các tài nguyên private.
- Anything you were about to expose "just so I can SSH in" — use Systems Manager Session Manager instead.Bất cứ thứ gì bạn định mở ra "chỉ để SSH vào" — hãy dùng Session Manager của Systems Manager thay vì mở cổng.
Addressing — CIDR, private ranges, the five AWS takesĐịa chỉ — CIDR, các dải private, và 5 địa chỉ AWS giữ
A CIDR is just a block of IP addresses. 192.168.0.0/26 means 192.168.0.0–192.168.0.63, so 64 addresses. The same notation shows up in security groups, route tables, VPCs and subnets — learn it once and it reads everywhere.
CIDR chỉ là cách viết gọn một khối địa chỉ IP. 192.168.0.0/26 nghĩa là từ 192.168.0.0 đến 192.168.0.63, tức 64 địa chỉ. Cách viết này dùng chung cho security group, route table, VPC và subnet — hiểu một lần là đọc được ở mọi chỗ.
The three private ranges — everything else is publicBa dải private — ngoài ba dải này đều là public
10.0.0.0/8
10.0.0.0 – 10.255.255.255 · 16,777,216 addresses — the range big networks use16.777.216 địa chỉ — dải mà mạng lớn hay dùng
172.16.0.0/12
172.16.0.0 – 172.31.255.255 · 1,048,576 addresses — the block starts at 172.16, not 172.01.048.576 địa chỉ — khối bắt đầu từ 172.16 chứ không phải 172.0
192.168.0.0/16
192.168.0.0 – 192.168.255.255 · 65,536 addresses — home routers65.536 địa chỉ — router ở nhà hay dùng
10.0.1.0/24: .0 network address · .1 the VPC router · .2 the AWS DNS resolver · .3 reserved for future use · .255 broadcast. So 256 − 5 = 251 usable. This is why a /28 — the smallest allowed — gives you only 11 instances.
Luôn là bốn địa chỉ đầu và một địa chỉ cuối. Với 10.0.1.0/24: .0 là địa chỉ mạng · .1 là router của VPC · .2 là DNS của AWS · .3 để dành · .255 là broadcast. Vậy 256 − 5 = 251 địa chỉ dùng được. Đó cũng là lý do một /28 — cỡ nhỏ nhất được phép — chỉ đặt được 11 instance.
Anatomy — subnets, route tables, and what makes a subnet publicCấu tạo — subnet, route table, và cái gì làm subnet thành public
Route tables control where traffic is directed and are associated with specific subnets. Every table carries a local route for the VPC CIDR that cannot be removed. When two routes match, the most specific wins — 192.168.0.0/24 beats 0.0.0.0/0.
Route table quyết định gói tin đi đâu, và được gán cho từng subnet cụ thể. Table nào cũng có sẵn route local cho CIDR của VPC và không xoá được. Khi hai route cùng khớp thì route nào hẹp hơn sẽ thắng — 192.168.0.0/24 thắng 0.0.0.0/0.
There is no "make this subnet public" switch in AWS. Compare the two route tables: the local route is identical, and exactly one line differs — 0.0.0.0/0 to the igw against 0.0.0.0/0 to the nat. That single line is what makes a subnet public or private. The name you give the subnet means nothing.
AWS không có nút nào để "đặt subnet này thành public" cả. Hãy so hai route table trong hình: route local giống hệt nhau, chỉ khác đúng một dòng — 0.0.0.0/0 trỏ vào igw so với 0.0.0.0/0 trỏ vào nat. Chính một dòng đó quyết định subnet là public hay private. Tên bạn đặt cho subnet không có ý nghĩa gì.
NAT Instance vs NAT GatewayNAT Instance và NAT Gateway
Both sit in a public subnet and both exist so that private resources can start outbound connections. The protection is structural: NAT only translates connections the private resource initiates. There is no mapping for an unsolicited inbound packet, so there is nowhere for it to go. Cả hai đều nằm ở subnet public, và đều sinh ra để tài nguyên private mở được kết nối đi ra. Tính bảo vệ nằm ngay trong cách nó hoạt động: NAT chỉ dịch những kết nối do phía private chủ động mở. Gói tin từ ngoài tự dưng gửi vào thì không khớp với bản ghi nào, nên NAT không biết chuyển tiếp đi đâu và gói tin rơi ngay tại đó.
| NAT Instance | NAT Gateway | |
|---|---|---|
| What it isLà gì | an EC2 instance you deploy in a public subnet; point the private subnet's 0.0.0.0/0 at itmột EC2 instance bạn tự dựng ở subnet public; rồi trỏ 0.0.0.0/0 của subnet private vào nó |
managed by AWS; point the private subnet's 0.0.0.0/0 at it and forget it existsAWS quản lý hộ; trỏ 0.0.0.0/0 của subnet private vào nó rồi quên nó đi |
| ResilienceKhả năng chịu lỗi | not resilient — you manage failover yourselfkhông chịu lỗi được — bạn phải tự lo failover | resilient within a single AZ only → deploy one per AZ for HAchỉ chịu lỗi trong phạm vi một AZ → muốn HA thì mỗi AZ dựng một cái |
| BandwidthBăng thông | capped by the instance type you chosegiới hạn theo loại instance bạn chọn | scales automatically, up to 100 Gbpstự co giãn, tới 100 Gbps |
| Security groupSecurity group | yes — it's an ENI like any othercó — nó cũng là một ENI như mọi ENI khác | none. You cannot attach one; filter at the instance SG and the subnet NACLkhông có. Không gắn được vào đâu cả; muốn lọc thì lọc ở SG của instance hoặc NACL của subnet |
| Extra tricksLàm được thêm gì | port forwarding, and it can double as a bastion hostport forwarding, và có thể kiêm luôn vai trò bastion host | none — TCP/UDP/ICMP only, no inbound, no port forwardingkhông — chỉ TCP/UDP/ICMP, không nhận inbound, không port forwarding |
| Source IP outsideIP nguồn nhìn từ ngoài | the instance's Elastic IPElastic IP của instance | its Elastic IP — hand this to the third party who must allowlist youElastic IP của nó — đây là IP bạn đưa cho bên thứ ba để họ allowlist |
| IPv6 | not the mechanism for itkhông phải cơ chế dành cho IPv6 | does not handle IPv6 — that is the Egress-Only IGWkhông xử lý IPv6 — việc đó thuộc về Egress-Only IGW |
Security Groups vs NACLsSecurity Group và NACL
Two firewalls, opposite personalities. The NACL guards the subnet and forgets you between packets. The security group guards the ENI and remembers the connection. Draw the reply path and the difference stops being abstract. Hai loại firewall với hai tính cách ngược nhau. NACL đứng ở cửa subnet và không nhớ gì cả — mỗi gói tin nó xét lại từ đầu. Security group đứng ở ENI và nhớ kết nối đã mở. Cứ vẽ ra đường đi của gói tin trả lời là thấy ngay khác biệt.
The asymmetry is the whole point: the packet is inspected twice by the NACL and once by the security group. Everyone remembers the inbound rule; the outbound ephemeral-port rule is the one that gets forgotten.
Điểm mấu chốt nằm ở chỗ không cân xứng: NACL xét gói tin hai lần — cả lượt đi lẫn lượt về — còn security group chỉ xét một lần. Ai cũng nhớ mở luật chiều vào; luật ephemeral port cho chiều ra mới là thứ hay bị quên.
| NACL | Security GroupSecurity Group | |
|---|---|---|
| Attached toGắn vào | the subnet — applies to every instance inside itsubnet — áp cho mọi instance nằm trong đó | an ENI — the instance levelmột ENI — mức instance |
| StateCó nhớ kết nối không | stateless — return traffic must be explicitly allowedstateless — gói tin chiều về phải có luật cho phép riêng | stateful — return traffic is allowed automatically, regardless of rulesstateful — gói tin chiều về tự động được cho qua, không cần luật |
| RulesLuật | allow and deny, evaluated in rule-number order, first match winscó cả allow lẫn deny, xét lần lượt theo số hiệu luật, khớp cái nào trước thì dùng cái đó | allow only — no deny. All rules are evaluated togetherchỉ có allow, không có deny. Tất cả luật được xét chung một lượt |
| Source can beSource có thể là gì | a CIDR, nothing elsechỉ có thể là một CIDR | a CIDR or another security group in the same Region — works across a peered VPC and cross-accountmột CIDR, hoặc một security group khác trong cùng Region — dùng được cả qua VPC đã peer lẫn qua tài khoản khác |
| Good forDùng để | cheaply and quickly blocking a specific IPchặn nhanh và rẻ một IP cụ thể | expressing "only the app tier may reach the DB" without hardcoding addressesdiễn đạt ý "chỉ tầng app mới được gọi vào DB" mà không cần ghi cứng địa chỉ IP |
ENI — the network identityENI — danh tính mạng
Think of an ENI as a virtual network card. It carries a private IP, a MAC address, the security groups, and the subnet association. The rule: if something needs to appear as a network endpoint inside the VPC, it needs an ENI. Once that clicks, most of the rest of networking is just "which thing has an ENI where". Cứ hình dung ENI là một card mạng ảo. Nó giữ private IP, một địa chỉ MAC, các security group, và biết mình thuộc subnet nào. Quy tắc: cái gì muốn có mặt như một điểm cuối mạng trong VPC thì đều phải có ENI. Hiểu được điều này rồi thì phần lớn kiến thức networking còn lại chỉ là câu hỏi "thứ này có ENI nằm ở đâu".
awsvpc
each task gets its own ENI and private IP — 10.0.1.10, 10.0.1.11. Fargate always uses awsvpcmỗi task có ENI và private IP riêng — 10.0.1.10, 10.0.1.11. Fargate thì luôn chạy awsvpc
Seeing traffic, and getting a shellNhìn được traffic, và vào được máy
VPC Flow LogsVPC Flow Logs
Metadata about traffic, not payloads. Definable at VPC, subnet or ENI level, and delivered to CloudWatch Logs, S3 or Kinesis Data Firehose. The reason to care: they are how you see traffic that was denied — a security group or NACL rejection leaves no trace anywhere else. Ghi lại thông tin về traffic chứ không ghi nội dung gói tin. Bật được ở mức VPC, subnet hoặc ENI, và đẩy sang CloudWatch Logs, S3 hoặc Kinesis Data Firehose. Lý do cần nó: đây là chỗ để nhìn thấy traffic bị chặn — security group hay NACL chặn một gói tin thì không ghi lại ở đâu khác.
Bastion host vs Session ManagerBastion host và Session Manager
A bastion host is a public EC2 instance you SSH into first, then hop onward to private instances. It works, and it is yours to manage: failover, recovery, patching, key distribution, and a port 22 open to somewhere. Bastion host là một EC2 nằm ở subnet public: bạn SSH vào đó trước, rồi mới nhảy tiếp sang các instance private. Cách này chạy được, nhưng mọi thứ bạn phải tự lo: failover, phục hồi, vá lỗi, phát key, và luôn có một cổng 22 mở ra ngoài.
IPv6, in shortIPv6, tóm gọn
All IPv6 addresses are public. There is no private IPv6 range — the concept does not exist. There are 3.4×10³⁸ of them against 4.3 billion IPv4, so addresses are effectively unscannable: nobody sweeps that space. Example CIDR: 2600:1f18:80c:a900::/56.
Mọi địa chỉ IPv6 đều là public — không hề có khái niệm dải IPv6 private. Tổng cộng có 3,4×10³⁸ địa chỉ, so với 4,3 tỉ của IPv4, nhiều tới mức không ai quét hết nổi. Ví dụ một CIDR: 2600:1f18:80c:a900::/56.
- Turning it on: add an IPv6 CIDR to the VPC and use the IGW, which supports IPv6. Cách bật: thêm một CIDR IPv6 cho VPC, rồi dùng IGW — IGW vốn đã hỗ trợ IPv6 sẵn.
-
Public subnet: an instance with IPv6 support, plus a route table entry for
::/0→ IGW.::/0is the IPv6 way of writing "everything". Subnet public: instance phải bật IPv6, và route table cần một dòng::/0→ IGW.::/0là cách IPv6 viết chữ "tất cả". -
Private subnet — instances can reach IPv6 out but cannot be reached in — needs an Egress-Only Internet Gateway, with
::/0routed to it. It is the IPv6 equivalent of a NAT Gateway, and it exists because there is no private IPv6 to translate to. Subnet private — instance đi ra ngoài bằng IPv6 được, nhưng bên ngoài không vào được — cần Egress-Only Internet Gateway, và trỏ::/0vào nó. Đây chính là NAT Gateway phiên bản IPv6; nó tồn tại vì IPv6 không có địa chỉ private để mà dịch sang. -
Consequence worth writing down: a dual-stack instance in a subnet you believe is private can be reachable over IPv6 if the route table sends
::/0to the IGW instead of the egress-only IGW. The IPv4 side looks perfectly locked down while the IPv6 side is wide open. Điều đáng ghi lại: một instance chạy cả IPv4 lẫn IPv6 (dual-stack) nằm trong subnet mà bạn đinh ninh là private vẫn có thể bị truy cập từ ngoài qua IPv6, nếu route table trỏ::/0vào IGW thay vì egress-only IGW. Nhìn phía IPv4 thì kín mít, còn phía IPv6 lại mở toang.
When traffic doesn't work — walk the pathKhi traffic không chạy — lần theo từng chặng
Don't guess. Traffic is a chain, and exactly one link is broken. Walk it left to right, out loud, and check the one thing each link is responsible for. Đừng đoán. Đường đi của traffic là một chuỗi mắt xích, và thường chỉ đúng một mắt bị đứt. Cứ lần từ trái sang phải, đọc to lên, và ở mỗi chặng chỉ kiểm đúng thứ mà chặng đó phụ trách.
Both route tables, not just the source one. Half of all "mysterious" failures are a perfectly good request arriving somewhere that has no route home.
Phải xem cả hai route table, không chỉ table phía nguồn. Một nửa số ca "không hiểu sao không chạy" thật ra là request đi tới nơi hoàn toàn bình thường, nhưng chỗ đó lại không có đường quay về.
Things that catch you outNhững chỗ dễ vấp
-
A
/24is 251 usable, not 256. Size subnets with the five reserved addresses in mind — and remember the VPC CIDR list is fixed at creation, so a subnet plan that only just fits today is a rebuild tomorrow. Một/24chỉ dùng được 251 địa chỉ, không phải 256. Khi chia subnet nhớ trừ đi năm địa chỉ AWS giữ — và nhớ rằng danh sách CIDR của VPC cố định ngay từ lúc tạo, nên kế hoạch subnet vừa khít hôm nay đồng nghĩa với việc phải dựng lại VPC sau này. - One NAT Gateway is not high availability. It is resilient within its AZ. Lose that AZ and every private subnet pointing at it loses egress — including the ones in surviving AZs. One per AZ, with each private route table pointing at its own. Một NAT Gateway không phải là HA. Nó chỉ chịu được lỗi trong chính AZ của nó. Mất AZ đó là mọi subnet private đang trỏ vào nó đều mất đường ra internet — kể cả subnet ở những AZ vẫn còn sống. Đúng cách là mỗi AZ một NAT Gateway, và route table private của AZ nào thì trỏ vào NAT của AZ đó.
- The NAT Gateway has no security group. There is nothing to attach one to. If a question asks you to filter what goes through the NAT, the answer lives on the instance security groups, the subnet NACL, or a proxy — never on the NAT itself. NAT Gateway không có security group. Không có chỗ nào để gắn cả. Nếu đề hỏi cách lọc traffic đi qua NAT thì đáp án nằm ở security group của instance, ở NACL của subnet, hoặc ở một proxy — không bao giờ nằm ở bản thân NAT Gateway.
- NACL rules are evaluated in number order and the first match wins. A deny at rule 200 never fires if an allow at rule 100 already matched. Number your denies low. Luật NACL xét theo số thứ tự, khớp cái nào trước thì dừng ở đó. Một luật deny đánh số 200 sẽ không bao giờ chạy nếu luật allow số 100 đã khớp trước rồi. Vậy nên các luật deny hãy đánh số nhỏ.
-
The
localroute cannot be removed, and being the most specific match for the VPC CIDR it always wins. You cannot force intra-VPC traffic through an appliance by adding a competing route for the same CIDR. Routelocalkhông xoá được, và vì nó là route hẹp nhất khớp với CIDR của VPC nên luôn thắng. Nghĩa là bạn không thể ép traffic nội bộ trong VPC chạy vòng qua một thiết bị trung gian bằng cách thêm một route khác cho cùng dải CIDR đó. - An auto-assigned public IPv4 changes on stop/start; an Elastic IP doesn't. Anything a third party allowlists — a NAT, a bastion, an outbound proxy — needs the Elastic IP, not the auto-assigned one. Public IPv4 do AWS tự cấp sẽ đổi mỗi lần stop/start, còn Elastic IP thì giữ nguyên. Bất cứ thứ gì bên thứ ba phải allowlist — NAT, bastion, proxy đi ra — đều phải dùng Elastic IP, không dùng IP tự cấp.
Prefix lists — a named bag of CIDRsPrefix list — một túi CIDR có tên
Instead of four security-group rules for four office ranges, make one customer-managed prefix list and write one rule against its ID. Change the list, and every rule and route table referencing it follows — across every account you shared it with. Thay vì bốn rule security group cho bốn dải văn phòng, tạo một customer-managed prefix list và viết một rule trỏ vào ID của nó. Sửa list, và mọi rule và route table đang tham chiếu đều theo — trên mọi account bạn đã share.
# thay vì
allow tcp/443 from 10.10.0.0/16 # Hanoi
allow tcp/443 from 10.20.0.0/16 # HCMC
allow tcp/443 from 10.30.0.0/16 # Singapore
allow tcp/443 from 10.40.0.0/16 # London
# chỉ còn
allow tcp/443 from pl-0123global-offices # network team sửa list, mọi SG tự theo
com.amazonaws.<region>.s3 and ...dynamodb, used in route tables for gateway endpoints and in egress rules.Danh sách read-only do AWS duy trì cho dải của chính service AWS — ví dụ com.amazonaws.<region>.s3 và ...dynamodb, dùng trong route table cho gateway endpoint và trong rule egress.
- A prefix list is Regional. Multi-Region deployments need one per Region, kept in sync.Prefix list là Regional. Triển khai nhiều Region thì mỗi Region một cái, phải đồng bộ.
MaxEntriesis what counts against your security-group rule quota — a list sized for 20 entries consumes 20 rule slots even while it holds 4. Size it realistically.MaxEntriesmới là thứ tính vào quota rule của security group — list đặt cỡ 20 entry chiếm 20 slot dù chỉ đang chứa 4. Đặt cỡ cho sát.- Don't confuse it with a security-group reference.
SG-A allows SG-Bmeans "traffic from ENIs that have SG-B attached" — it does not inherit the CIDRs written inside SG-B, and an on-prem office has no ENI to attach anything to.Đừng nhầm với security-group reference.SG-A allow SG-Bnghĩa là "traffic từ ENI đang gắn SG-B" — nó không kế thừa các CIDR viết bên trong SG-B, và văn phòng on-prem thì không có ENI để gắn gì cả.
Public IPv4 — who can actually hold onePublic IPv4 — ai thật sự giữ được một cái
An Internet Gateway is not a device. It has no ENI, no private IP, no subnet, no security group — it's a logical, horizontally-scaled thing AWS runs at the VPC edge. So there is nowhere on it to attach an Elastic IP. An EIP always attaches to something with a network identity. Internet Gateway không phải một thiết bị. Nó không có ENI, không private IP, không subnet, không security group — nó là một thứ logic, scale ngang, do AWS chạy ở rìa VPC. Nên trên nó không có chỗ nào để gắn Elastic IP. EIP luôn gắn vào thứ có network identity.
"Public subnet" is only a statement about the route table. A resource still needs a public IPv4 of its own to use the IGW — which is exactly why a VPC-attached Lambda in a public subnet still has no internet.
"Public subnet" chỉ là một khẳng định về route table. Resource vẫn phải tự có public IPv4 mới dùng được IGW — đó chính là lý do Lambda gắn VPC nằm trong public subnet vẫn không có internet.
- Outbound-only for IPv6 is the egress-only internet gateway. It is IPv6-only and takes no Elastic IP.Chỉ đi ra với IPv6 là egress-only internet gateway. Nó chỉ dành cho IPv6 và không nhận Elastic IP.
- One NAT gateway per AZ, each with its own EIP — both for availability and to avoid cross-AZ data charges. Give the partner all of them.Mỗi AZ một NAT gateway, mỗi cái một EIP — vừa để sẵn sàng cao vừa để tránh phí data cross-AZ. Đưa đối tác cả bộ.
- Inbound vs outbound are different questions. Inbound is
client → ALB → EC2; outbound isEC2 → NAT → third party. A partner allow-listing your source IP cares only about the outbound path, so the EIP goes on the NAT gateway, never on the ALB.Chiều vào và chiều ra là hai câu hỏi khác nhau. Vào làclient → ALB → EC2; ra làEC2 → NAT → bên thứ ba. Đối tác allow-list IP nguồn của bạn chỉ quan tâm đường ra, nên EIP gắn vào NAT gateway, không bao giờ gắn vào ALB.
BYOIP · bring your own IP rangemang dải IP của bạn vào AWS
When a question says "register a block of customer-owned public IP addresses in the AWS account", it means BYOIP: you already own a routable public CIDR, and you let AWS advertise it so you can allocate Elastic IPs out of it. Partners keep the allow-list they already have. Khi đề nói "đăng ký một khối public IP thuộc sở hữu khách hàng vào AWS account", đó là BYOIP: bạn vốn đã sở hữu một CIDR public routable, và bạn cho AWS quảng bá nó để cấp Elastic IP từ đó. Đối tác giữ nguyên allow-list họ đang có.
# 1. CIDR phải thật sự là của bạn, đăng ký với RIR (APNIC/ARIN/RIPE), IPv4 tối thiểu /24
# 2. Uỷ quyền cho AWS quảng bá (RPKI ROA + chuỗi ký xác thực quyền sở hữu)
aws ec2 provision-byoip-cidr --cidr 203.0.113.0/24 # → tạo một public IPv4 pool
aws ec2 advertise-byoip-cidr --cidr 203.0.113.0/24 # → internet bắt đầu route về AWS
aws ec2 allocate-address --domain vpc \
--public-ipv4-pool ipv4pool-ec2-0123456789abcdef # → EIP nằm trong dải của bạn
# 3. gắn EIP đó vào NAT gateway ở mỗi AZ → đối tác allow-list nguyên 203.0.113.0/24
- BYOIP is only for CIDRs you genuinely own and can prove control of. You cannot register
10.0.0.0/16or a range you picked.BYOIP chỉ dành cho CIDR bạn thật sự sở hữu và chứng minh được quyền kiểm soát. Không đăng ký được10.0.0.0/16hay một dải bạn tự chọn. - Once provisioned, the pool feeds Elastic IPs for NAT gateways, EC2, and NLBs — and Global Accelerator can use BYOIP addresses too.Sau khi provision, pool cấp Elastic IP cho NAT gateway, EC2 và NLB — và Global Accelerator cũng dùng được địa chỉ BYOIP.
- "Enable public IP addressing on the public subnets" does nothing for instances in private subnets — their traffic still leaves via NAT."Bật public IP addressing cho public subnet" chẳng ảnh hưởng gì tới instance nằm trong subnet private — traffic của chúng vẫn đi ra qua NAT.
Exam reflexesPhản xạ khi thi
| The question says…Đề nói… | AnswerĐáp án |
|---|---|
| "Private instances must download patches from the internet""Instance private phải tải bản vá từ internet" | NAT Gateway in a public subnet, private route table 0.0.0.0/0 → nat — one per AZNAT Gateway ở subnet public, route table private 0.0.0.0/0 → nat — mỗi AZ một cái |
| "We deployed a NAT instance and nothing routes through it""Đã dựng NAT instance mà chẳng có traffic nào đi qua" | Source/Destination Check is still enabled — disable itSource/Destination Check vẫn đang bật — hãy tắt nó |
| "A partner must allowlist one source IP for our outbound calls""Đối tác cần allowlist một IP nguồn cho các kết nối đi ra của mình" | The NAT Gateway's Elastic IP — that's the source they seeElastic IP của NAT Gateway — đó là source mà họ nhìn thấy |
| "Block one abusive IP address quickly and cheaply""Chặn nhanh và rẻ một IP đang phá" | NACL deny rule — a security group cannot deny anythingLuật deny của NACL — security group không deny được |
| "Requests leave but responses never arrive""Request gửi đi được nhưng không bao giờ nhận được phản hồi" | NACL is stateless — allow outbound 1024–65535 for the return trafficNACL là stateless — phải mở outbound 1024–65535 cho gói tin chiều về |
| "Only the app tier may reach the database, and it autoscales""Chỉ tầng app được chạm tới database, mà tầng đó lại autoscale" | DB security group with the app tier's security group as the source, not a CIDRSecurity group của DB đặt source là security group của tầng app, chứ không phải một dải CIDR |
| "We need to see traffic that was denied""Cần nhìn thấy traffic đã bị chặn" | VPC Flow Logs at VPC / subnet / ENI level → CloudWatch Logs, S3 or FirehoseVPC Flow Logs ở mức VPC / subnet / ENI → CloudWatch Logs, S3 hoặc Firehose |
| "Shell access to private instances, no bastion, no open port 22""Vào được shell của instance private, không dùng bastion, không mở cổng 22" | SSM Session Manager — Systems Manager, IAM-controlled and auditedSSM Session Manager — Systems Manager, do IAM kiểm soát và có ghi log |
| "Private instances need outbound IPv6 but must stay unreachable""Instance private cần đi ra IPv6 nhưng phải không ai vào được" | Egress-Only Internet Gateway, route ::/0 to it — the IPv6 NAT GatewayEgress-Only Internet Gateway, trỏ ::/0 vào nó — bản NAT Gateway cho IPv6 |