AWS Transit Gateway

One regional router that every VPC, VPN and Direct Connect Gateway plugs into. It turns a mesh of peerings into a star, and it is transitive — which is the one thing VPC Peering will never do for you.

Một router duy nhất trong Region, mọi VPC, VPN và Direct Connect Gateway đều cắm vào đó. Nó biến mớ peering chằng chịt thành hình sao, và quan trọng nhất là nó đi xuyên qua được — thứ mà VPC Peering không bao giờ làm được.

Two ideas carry the whole page: TGW route tables decide who may talk to whom, and TGW routes to attachments, never to a NAT Gateway ENI. Get those and everything else is detail.

Cả trang này xoay quanh hai ý: TGW route table quyết định ai được nói chuyện với ai, và TGW chỉ định tuyến tới attachment, không bao giờ trỏ thẳng vào ENI của NAT Gateway. Nắm hai ý đó rồi thì phần còn lại chỉ là chi tiết.

Reach for a Transit Gateway when… / peering is still fine when…Khi nào cần Transit Gateway… / khi nào peering vẫn ổn…

Transit GatewayDùng Transit Gateway

  • You are past a handful of VPCs. Full mesh costs n(n−1)/2 peerings — 10 VPCs is 45 links, and every new VPC touches all the others.Số VPC đã vượt quá mức đếm trên đầu ngón tay. Nối full mesh tốn n(n−1)/2 peering — 10 VPC là 45 đường, và thêm một VPC mới là phải động vào tất cả những cái còn lại.
  • Something needs transit: an App VPC using a NAT Gateway, NLB, PrivateLink or EFS that lives in another VPC.Có nhu cầu đi xuyên qua: App VPC muốn xài NAT Gateway, NLB, PrivateLink hay EFS nằm ở một VPC khác.
  • On-premises is in the picture — one Direct Connect Gateway or VPN reaching many VPCs, instead of one link per VPC.Có on-premises trong sơ đồ — một Direct Connect Gateway hoặc VPN với tới được nhiều VPC, thay vì mỗi VPC phải kéo một đường riêng.
  • A multi-account landing zone: the Network Services account owns the gateway and shares it with RAM.Mô hình landing zone nhiều account: account Network Services đứng tên gateway rồi chia sẻ ra bằng RAM.
  • You need environment segmentation — Prod, Pre-Prod, Staging, Dev on one gateway with separate route tables.Cần tách môi trường — Prod, Pre-Prod, Staging, Dev chung một gateway nhưng route table riêng.
  • The application needs IP Multicast. Nothing else in AWS does it.Ứng dụng cần IP Multicast. Trong AWS không còn lựa chọn nào khác.

Peering is still finePeering vẫn ổn

  • Two VPCs, one talks to the other, end of story. A star with two points is just a line.Chỉ có hai VPC, một bên gọi sang bên kia, hết. Hình sao mà có hai đỉnh thì chỉ là một đoạn thẳng.
  • No transit is needed — nobody is borrowing anyone's NAT, IGW or VPN.Không cần đi xuyên qua ai — không ai mượn NAT, IGW hay VPN của ai cả.
  • Cost matters and the flow is chatty: TGW bills per attachment-hour plus per GB processed; peering has no hourly gateway charge and no processing fee on the hop.Chi phí quan trọng mà luồng dữ liệu lại rất nhiều: TGW tính tiền theo giờ cho mỗi attachment, cộng tiền theo GB đi qua; còn peering không có phí gateway theo giờ, cũng không tính phí xử lý ở chặng đó.
  • You want the smallest blast radius: peering has no shared component in the middle to misconfigure or to lose.Bạn muốn phạm vi ảnh hưởng nhỏ nhất: peering không có thành phần dùng chung nào ở giữa để mà cấu hình sai hay chết cả cụm.
  • You rely on referencing a security group across the link — that works over peering in the same Region, not across a TGW.Bạn đang tham chiếu security group qua đường nối — cái đó chỉ chạy với peering trong cùng Region, qua TGW thì không.

The mesh problem — why a hub exists at allVấn đề của mesh — vì sao phải có hub

Left unchecked, the topology grows into something nobody can hold in their head: VPN connections landing in one VPC, peerings between every pair, a Direct Connect Gateway hanging off the side. Transit Gateway replaces the mesh with hub-and-spoke — every network becomes one attachment on one gateway. Cứ để mặc thì sơ đồ mạng sẽ phình ra tới mức không ai nhớ nổi: VPN cắm vào một VPC nào đó, peering nối chéo mọi cặp, thêm một Direct Connect Gateway lủng lẳng bên rìa. Transit Gateway thay cả mớ đó bằng hub-and-spoke — mỗi mạng chỉ còn là một attachment trên một gateway duy nhất.

Two panels side by side. On the left, six VPCs arranged in a circle with a peering line drawn between every pair, fifteen lines in total, forming a tangle. A note reads that six VPCs need fifteen peerings and ten VPCs need forty-five. On the right, the same six networks arranged around a single Transit Gateway in the centre, each joined by one straight line: four VPCs, one VPN connection and one Direct Connect Gateway, six attachments in total. the same six networks, drawn two ways mesh — every pair needs its own link hub-and-spoke — one attachment each VPC VPC VPC VPC VPN DX GW 6 links here = 15 peerings · 10 = 45 Transit Gateway VPC VPC VPC VPC VPN DX GW 6 attachments · 10 VPCs = 10 · linear full mesh = n(n-1)/2 links — 50 VPCs would be 1,225 peerings and the hub is transitive, which no number of peerings can fix

The count is the cheap argument; transitivity is the real one. Even if you were willing to draw 1,225 peerings, VPC B still could not use VPC A's NAT Gateway through them. The star does not just tidy the picture — it changes what is possible.

Con số 1.225 chỉ là lý do dễ thấy nhất; lý do thật nằm ở tính bắc cầu. Cho dù bạn đủ kiên nhẫn vẽ hết 1.225 đường peering, VPC B vẫn không thể đi nhờ NAT Gateway của VPC A. Hình sao không chỉ làm sơ đồ gọn hơn — nó mở ra những thứ trước đó không làm được.

Regional, but reaches outTheo Region, nhưng vươn ra ngoài A TGW belongs to one Region, yet works cross-Region, and you can peer two Transit Gateways to join Regions together.Một TGW thuộc về một Region, nhưng vẫn chạy xuyên Region, và bạn có thể peer hai Transit Gateway để nối các Region lại với nhau.
ScaleQuy mô Thousands of VPCs and on-premises networks on one gateway, all of it transitive.Hàng nghìn VPC và cả mạng on-premises trên cùng một gateway, và tất cả đều đi xuyên qua nhau được.
What can attachCắm được những gì VPCs, VPN connections, a Direct Connect Gateway, and other Transit Gateways via peering.VPC, VPN connection, một Direct Connect Gateway, và cả Transit Gateway khác thông qua peering.
What it unlocksMở khoá được gì Instances in one VPC can use a NAT Gateway, NLB, PrivateLink and EFS sitting in other attached VPCs.Instance ở VPC này dùng được NAT Gateway, NLB, PrivateLink và EFS đặt ở các VPC khác cùng cắm vào gateway.

The two routing layers — read this one twiceHai tầng định tuyến — đọc kỹ phần này

This is the mechanic that makes every TGW problem legible. The TGW route table only ever points at an attachment. It cannot point at a NAT Gateway, an instance or an ENI, because from the gateway's point of view a whole VPC is just one door. Once the packet is through that door, the VPC route table takes over and does the last hop. Đây là cơ chế làm cho mọi ca lỗi TGW trở nên dễ hiểu. TGW route table chỉ trỏ được vào attachment, không gì khác. Nó không trỏ được vào NAT Gateway, vào instance hay vào một ENI cụ thể, vì đứng từ phía gateway thì cả một VPC chỉ là một cánh cửa. Gói tin qua được cửa đó rồi thì VPC route table mới là bên tiếp quản và lo chặng cuối.

A vertical chain of six labelled bands showing one packet crossing two routing layers. From top: the App VPC route table sending 0.0.0.0/0 to the TGW attachment; the TGW attachment, which has ENIs in the subnets you select; the TGW route table, highlighted, annotated that it routes to attachments and never to a NAT Gateway ENI; the attachment inside the Egress VPC where the ENI sits in your subnet; the Egress VPC route table sending 0.0.0.0/0 to the NAT gateway; and finally the NAT Gateway leading to the IGW and the internet. Side notes mark the first and third bands as layer one inside the VPC and the middle band as layer two inside the Transit Gateway. one packet, two routing layers VPC route table · App VPC 0.0.0.0/0 -> tgw-0a1b2c3d target is the TGW id — you never name an attachment TGW attachment · App VPC what tgw-0a1b2c3d resolves to TGW route table 0.0.0.0/0 -> egress-attachment attachment · Egress VPC its ENI sits in your subnet VPC route table · Egress VPC 0.0.0.0/0 -> nat-gateway NAT Gateway -> IGW -> internet or EC2 · RDS · NLB · EFS layer 1 — your VPC picks the way out layer 2 — the gateway routes to attachments — never to a NAT Gateway ENI layer 1 again — the VPC does the final hop ENIs, one subnet per AZ. one per VPC per TGW, so naming the TGW names it traffic lands here, then the VPC decides chosen by the VPC table, not by the gateway debug order: VPC RT -> attachment -> TGW RT -> attachment -> VPC RT

Six bands, two owners. Blue bands are yours to fix in the VPC console; the purple band is the gateway's. Note that you never write the second band: a VPC has at most one attachment to a given gateway, so naming tgw-0a1b2c3d already names that door. It is drawn because it does two things — it carries the ENI the packet actually leaves through, and the attachment a packet arrives on is what decides which TGW route table is consulted. Most "TGW is broken" tickets are a missing route in a blue band, and the second most common is an attachment whose subnets do not cover the AZ the traffic is trying to reach.

Sáu ô, hai chủ sở hữu. Mấy ô màu xanh là phần bạn sửa trong console VPC; ô màu tím mới là phần của gateway. Để ý là ô thứ hai bạn không hề khai ở đâu cả: một VPC chỉ gắn được tối đa một attachment vào một gateway, nên viết tgw-0a1b2c3d là đã chỉ đúng cái cửa đó rồi. Nó vẫn được vẽ ra vì nó làm hai việc — nó giữ cái ENI mà gói tin thực sự đi ra, và attachment mà gói tin đi vào chính là thứ quyết định TGW sẽ tra ở route table nào. Phần lớn ca "TGW hỏng rồi" thật ra chỉ là thiếu một route ở ô xanh, và ca phổ biến thứ hai là attachment không có subnet ở đúng AZ mà traffic muốn tới.

Can the TGW route straight to a NAT Gateway ENI?TGW trỏ thẳng vào ENI của NAT Gateway được không? No. Ask for it and you will be looking for a target that does not exist in the dropdown. The TGW route table's targets are attachments and blackhole, full stop. The NAT Gateway is reached by the Egress VPC's own route table, one layer down, after the packet has already arrived through the attachment ENI. Không. Có muốn cũng chẳng tìm thấy target đó trong danh sách. Target của TGW route table chỉ gồm attachment và blackhole, hết. NAT Gateway là do route table của chính Egress VPC trỏ tới, ở tầng dưới, sau khi gói tin đã đi qua ENI của attachment vào bên trong VPC rồi.
What the attachment ENI is forENI của attachment để làm gì Same rule as everywhere else in a VPC: if something must appear as a network endpoint inside the VPC, it needs an ENI. A TGW VPC attachment is the gateway's presence and private IP inside your VPC — it is the doorway traffic enters through. You choose one subnet per AZ when you create it, and that choice is not cosmetic. Vẫn là quy tắc quen thuộc của VPC: cái gì muốn xuất hiện như một điểm cuối mạng bên trong VPC thì phải có ENI. TGW VPC attachment chính là chỗ đứng và địa chỉ private của gateway bên trong VPC của bạn — là cái cửa để traffic đi vào. Lúc tạo attachment bạn chọn mỗi AZ một subnet, và lựa chọn đó không hề vô thưởng vô phạt.

Route tables are the segmentation leverRoute table chính là cần gạt phân vùng

Everything attaches to one gateway. Who can reach whom is decided entirely by which TGW route table an attachment is associated with, and what that table contains. You do not build a second gateway to isolate an environment — you build a second route table. Tất cả cùng cắm vào một gateway. Ai nói chuyện được với ai hoàn toàn phụ thuộc vào attachment được gán vào TGW route table nào, và trong bảng đó có những route gì. Muốn cô lập một môi trường thì không dựng thêm gateway — chỉ tạo thêm một route table.

Worked example — four environments, one gatewayVí dụ cụ thể — bốn môi trường, một gateway

A Network Services account owns the Transit Gateway. Prod, Pre-Prod, Staging and Dev each live in their own account with their own VPC, and each creates an attachment onto the shared gateway. Then the gateway is split in two by route table. Transit Gateway do account Network Services đứng tên. Prod, Pre-Prod, Staging và Dev mỗi môi trường một account, một VPC riêng, và mỗi bên tạo một attachment lên gateway dùng chung. Sau đó gateway được chẻ làm đôi bằng route table.

Prod Route Table Staging Route Table
Associated attachmentsAttachment được gán vào Prod (VPC-A, 10.1.0.0/16) and Pre-Prod (VPC-B, 10.2.0.0/16)Prod (VPC-A, 10.1.0.0/16) và Pre-Prod (VPC-B, 10.2.0.0/16) Staging (VPC-C, 10.3.0.0/16) and Dev (VPC-D, 10.4.0.0/16)Staging (VPC-C, 10.3.0.0/16) và Dev (VPC-D, 10.4.0.0/16)
Routes it containsRoute bên trong 10.1.0.0/16 → Attachment-A
10.2.0.0/16 → Attachment-B
10.3.0.0/16 → Attachment-C
10.4.0.0/16 → Attachment-D
Who they can reachVới tới được ai each other, and nothing else on the gatewaychỉ hai bên với nhau, ngoài ra không ai khác trên gateway each other, and nothing else on the gatewaychỉ hai bên với nhau, ngoài ra không ai khác trên gateway
Why Prod cannot see DevVì sao Prod không thấy Dev A packet from Prod for 10.4.x.x is looked up in the Prod table, which has no entry for it. No route, no delivery. Both VPCs are attached to the same gateway and it makes no difference at all.Gói tin từ Prod đi tới 10.4.x.x sẽ được tra trong bảng Prod, mà bảng đó không có dòng nào cho dải này. Không có route thì không đi được. Hai VPC vẫn cắm chung một gateway, nhưng điều đó chẳng thay đổi gì cả.
Association vs propagation — the two words that confuse everyoneAssociation và propagation — hai từ hay khiến người ta rối Association answers "when traffic arrives from this attachment, which table do I look in?" — an attachment is associated with exactly one table. Propagation answers "whose routes get advertised into this table?" — one attachment can propagate into many. Segmentation is really just: associate carefully, propagate sparingly. Association trả lời câu "traffic đi vào từ attachment này thì tra bảng nào?" — mỗi attachment chỉ association vào đúng một bảng. Propagation trả lời câu "route của ai được quảng bá vào bảng này?" — một attachment có thể propagate vào nhiều bảng. Nói cho gọn, phân vùng chỉ là: association thì chọn kỹ, propagation thì cho ít thôi.
The default settings undo your segmentationCấu hình mặc định phá luôn ý đồ phân vùng A Transit Gateway is created with default route table association and default route table propagation switched on. Leave them on and every new attachment lands in the same table and advertises itself into it — a flat network where everything reaches everything. If you intend to segment, turn both defaults off and wire each attachment by hand. Khi tạo mới, Transit Gateway bật sẵn default route table association và default route table propagation. Cứ để nguyên thì attachment nào mới cắm vào cũng rơi vào cùng một bảng và tự quảng bá route vào đó — kết quả là một mạng phẳng, ai cũng với tới được ai. Đã có ý định phân vùng thì tắt cả hai tuỳ chọn mặc định và tự tay gán từng attachment.

Central NAT Gateway — the flagship patternNAT Gateway tập trung — pattern tiêu biểu nhất

Twenty App VPCs, twenty pairs of NAT Gateways, twenty Elastic IPs for the partner to allowlist. Instead: one Egress VPC holds the NAT Gateways — still one per AZ, that rule never goes away — and the IGW. Every App VPC routes 0.0.0.0/0 to its TGW attachment and gets the internet through the shared exit. Hai mươi App VPC là hai mươi cặp NAT Gateway, hai mươi Elastic IP để đối tác allowlist. Thay vào đó: một Egress VPC giữ toàn bộ NAT Gateway — vẫn mỗi AZ một cái, quy tắc đó không bao giờ mất — cùng với IGW. Mọi App VPC chỉ cần trỏ 0.0.0.0/0 vào attachment của mình là ra được internet qua lối chung đó.

A centralised egress design. On the left an Internet Gateway, joined to an Egress VPC with CIDR 192.168.0.0/16 that contains two Availability Zones, each holding one NAT Gateway. The Egress VPC attaches to a Transit Gateway named TGW-Internet in the middle, which in turn attaches to App1-VPC 10.0.0.0/16 and App2-VPC 10.1.0.0/16 on the right, each of whose own route tables send 0.0.0.0/0 to TGW-Internet. A crossed dashed line between the two App VPCs marks that there is no route between them. Below are the two Transit Gateway route tables: the App table sends 0.0.0.0/0 to the TGW-Internet attachment and blackholes the RFC1918 ranges, and the Egress table sends 10.0.0.0/16 to the App1 attachment and 10.1.0.0/16 to the App2 attachment. centralised egress — one internet exit for every VPC IGW Egress VPC · 192.168.0.0/16 AZ 1 NAT Gateway AZ 2 NAT Gateway VPC RT: 0.0.0.0/0 -> NAT · app CIDRs -> attachment attach TGW TGW-Internet App1-VPC · 10.0.0.0/16 10.0.0.0/16 -> local 0.0.0.0/0 -> TGW-Internet its own VPC route table App2-VPC · 10.1.0.0/16 10.1.0.0/16 -> local 0.0.0.0/0 -> TGW-Internet its own VPC route table no route TGW route table · App attachments 0.0.0.0/0 -> TGW-Internet 10.0.0.0/8 -> blackhole 172.16.0.0/12 -> blackhole 192.168.0.0/16 -> blackhole TGW route table · Egress attachment 10.0.0.0/16 -> App1 attachment 10.1.0.0/16 -> App2 attachment return traffic only — the apps never appear in each other's route table RFC1918 blackholed in the App table => App1 and App2 stay isolated both still get the internet, through one shared NAT per AZ

Read the App route table as a policy statement: "the internet, yes; anything private, no." The three blackhole lines are what keep App1 and App2 apart, and they beat the default route because the most specific match wins. The Egress table only needs the return paths.

Hãy đọc bảng route của App như một câu chính sách: "ra internet thì được; còn đi vào dải private thì không". Ba dòng blackhole chính là thứ giữ App1 và App2 tách nhau, và chúng thắng route mặc định vì route nào hẹp hơn thì thắng. Bảng Egress chỉ cần đủ đường cho traffic đi ngược về.

Why this is worth doingVì sao pattern này đáng làm One set of NAT Gateways to pay for instead of one set per VPC. One pair of Elastic IPs to hand a partner for allowlisting, forever. One place to put egress inspection later. And the App VPCs need no public subnets and no IGW at all — the only route they own that points outward is 0.0.0.0/0 to an attachment. Chỉ phải trả tiền cho một bộ NAT Gateway thay vì mỗi VPC một bộ. Chỉ có một cặp Elastic IP để đưa cho đối tác allowlist, và không đổi về sau. Chỉ một chỗ duy nhất để sau này gắn thêm lớp kiểm tra traffic đi ra. Và các App VPC không cần subnet public, cũng chẳng cần IGW — route duy nhất hướng ra ngoài của chúng là 0.0.0.0/0 trỏ vào một attachment.

Sharing, peering, and the on-premises sideChia sẻ, peering, và phía on-premises

Share it with AWS RAM — share, accept, useChia sẻ bằng AWS RAM — share, accept, use

The gateway lives in one account; the VPCs that need it live everywhere else. AWS RAM shares the Transit Gateway for VPC attachments across accounts or across an entire AWS Organization. The flow is three steps: account A shares, account B accepts, account B uses it — B creates its own attachment onto A's gateway, from its own account. Gateway nằm ở một account, còn các VPC cần dùng nó thì nằm rải khắp nơi. AWS RAM chia sẻ Transit Gateway để các bên tạo VPC attachment, sang từng account hoặc cho cả AWS Organization. Luồng có ba bước: account A share, account B accept, rồi B use — tức là B tự tạo attachment của mình lên gateway của A, ngay trong account của B.

1 · share The owning account (typically Network Services) creates a RAM resource share containing the Transit Gateway.Account đứng tên gateway (thường là Network Services) tạo một RAM resource share chứa Transit Gateway đó.
2 · accept The target account accepts the invitation. Share to an Organization and acceptance can be automatic.Account nhận bấm đồng ý. Nếu share cho cả Organization thì bước đồng ý có thể diễn ra tự động.
3 · use The target account creates its own VPC attachment onto the shared gateway. Routing stays with the owner.Account nhận tự tạo VPC attachment của mình lên gateway dùng chung. Phần định tuyến vẫn do bên chủ sở hữu nắm.

Peering Transit Gateways — inter- and intra-RegionPeering giữa các Transit Gateway — cùng Region và khác Region

  • You can peer Transit Gateways to each other — across Regions, or between two gateways in the same Region (yours, or a third party's). That is how a hub TGW ties several regional gateways together. Bạn có thể peer các Transit Gateway với nhau — khác Region, hoặc hai gateway trong cùng một Region (của bạn, hoặc của một bên thứ ba). Đây là cách một TGW đóng vai hub gom nhiều gateway ở các Region lại.
  • Billing: hourly for each peering attachment, with no data processing charge. If the data actually crosses Regions through the attachment, standard data transfer applies on top. Về tiền: tính theo giờ cho mỗi peering attachment, và không thu phí xử lý dữ liệu. Nhưng nếu dữ liệu thật sự đi xuyên Region qua attachment đó thì vẫn phải trả phí data transfer thông thường.
  • To set it up you specify the Transit Gateway ID of the far side. Note that a peering attachment does not propagate routes — add static routes pointing at it. Khi tạo, bạn khai Transit Gateway ID của đầu bên kia. Lưu ý: peering attachment không tự propagate route — phải tự thêm static route trỏ vào nó.

Direct Connect, in one paragraphDirect Connect, gói trong một đoạn

Direct Connect is not a VPC-to-VPC mechanism. It is a private, dedicated physical link from your data centre to AWS — no internet in the path. On its own it connects on-premises to AWS; combined with a Direct Connect Gateway in front of a Transit Gateway, that one on-prem connection reaches many VPCs, across Regions. Pair it with TGW peering and a single office link serves gateways in us-east-1 and us-west-2 alike. It gets its own page later. Direct Connect không phải là cách nối VPC với VPC. Nó là một đường truyền vật lý riêng, dành riêng, kéo từ data center của bạn tới AWS — không đi qua internet. Bản thân nó chỉ nối on-premises với AWS; nhưng đặt thêm một Direct Connect Gateway phía trước Transit Gateway thì chỉ một đường on-prem đó với tới được rất nhiều VPC, ở nhiều Region. Kết hợp thêm TGW peering nữa thì một đường duy nhất từ văn phòng phục vụ được cả gateway ở us-east-1 lẫn us-west-2. Phần chi tiết sẽ có trang riêng.

IP Multicast — the thing only this service doesIP Multicast — thứ duy nhất chỉ service này làm được

Three ways to address traffic: unicast = one to one, broadcast = one to everyone on the network, multicast = one sender to a chosen group of receivers. The sender transmits once; the network copies the packet to whoever has joined the group. Market data feeds, video distribution and old trading or telemetry software are built on it. Có ba kiểu gửi traffic: unicast = một tới một, broadcast = một tới tất cả mọi máy trong mạng, multicast = một người gửi tới một nhóm người nhận đã đăng ký. Bên gửi chỉ phát một lần; phần nhân bản gói tin cho từng thành viên trong nhóm là việc của mạng. Các hệ thống bắn giá chứng khoán, phân phối video, hay phần mềm giao dịch và telemetry đời cũ đều xây trên cơ chế này.

  • A VPC does not behave like a traditional LAN — there is no broadcast domain and no multicast by default. Software that "just worked" in the data centre will find nobody listening. Một VPC không hoạt động giống một LAN truyền thống — mặc định không có broadcast domain, cũng không có multicast. Phần mềm ở data center "cắm là chạy" đem lên đây sẽ thấy không ai nghe cả.
  • Transit Gateway Multicast is the exception, and the only one in AWS. If a question mentions multicast at all, this is the answer — there is nothing to compare it against. Transit Gateway Multicast là ngoại lệ duy nhất trong toàn bộ AWS. Đề bài nhắc tới multicast là gần như chắc chắn đáp án nằm ở đây — không có phương án nào khác để mà so.
  • The shape is a multicast domain on the gateway: you register the subnets that take part, and sources and group members are the ENIs inside them. Cách tổ chức là một multicast domain trên gateway: bạn đăng ký những subnet tham gia, còn nguồn phát và thành viên nhóm chính là các ENI nằm trong những subnet đó.

Things that catch you outNhững chỗ hay sập bẫy

  • Attaching a VPC changes nothing in your subnets. The attachment is only the door; the VPC route tables still need an entry sending the remote CIDR to the attachment. This is the single most common "it doesn't work". Cắm VPC vào gateway không tự động thay đổi gì trong subnet của bạn. Attachment chỉ là cái cửa; route table của VPC vẫn phải có dòng trỏ dải CIDR bên kia vào attachment. Đây là nguyên nhân số một của các ca "không chạy".
  • Subnet choice on the attachment is load-bearing. The attachment can only deliver into AZs where you gave it a subnet. Instances in an AZ you skipped are unreachable through the gateway, even though the route looks perfect. Pick one subnet per AZ you use. Chọn subnet cho attachment không phải chuyện hình thức. Attachment chỉ giao được traffic vào những AZ mà bạn đã cấp subnet cho nó. Instance nằm ở AZ bạn bỏ sót sẽ không ai tới được qua gateway, dù route nhìn vào thấy đúng hoàn toàn. Nhớ chọn mỗi AZ đang dùng một subnet.
  • Overlapping CIDRs still break everything. A Transit Gateway routes, it does not translate. Two VPCs both on 10.0.0.0/16 cannot coexist behind it any more than they could over peering. CIDR trùng nhau vẫn làm hỏng hết. Transit Gateway chỉ định tuyến chứ không dịch địa chỉ. Hai VPC cùng dùng 10.0.0.0/16 thì đứng sau TGW cũng bế tắc y như khi đi qua peering.
  • Security group referencing does not cross the gateway. Over peering in the same Region you can allow "the SG of that app"; across a TGW you are back to writing CIDRs. Tham chiếu security group không đi qua được gateway. Với peering trong cùng Region bạn có thể mở luật cho "cái SG của app kia"; còn qua TGW thì đành quay lại viết CIDR.
  • Blackhole is a feature, not damage. "Attached but must not talk" is expressed as a blackhole route, and it wins over a broader route because the most specific match applies. That is the trick behind the centralised-egress table. Blackhole là tính năng, không phải sự cố. Cái ý "vẫn cắm vào nhưng cấm nói chuyện" được diễn đạt bằng một route blackhole, và nó thắng route rộng hơn vì route nào hẹp hơn thì thắng. Đó chính là mẹo đứng sau bảng route của pattern egress tập trung.
  • Cross-AZ flow stickiness. A flow stays on the AZ it entered through unless you enable appliance mode on the attachment. Put a stateful firewall or NAT appliance behind a TGW without it and return traffic can come back through a different AZ and get dropped. Traffic bị "dính" vào AZ mà nó đi vào. Một flow sẽ ở nguyên AZ mà nó vào, trừ khi bạn bật appliance mode trên attachment. Đặt firewall stateful hay NAT appliance sau TGW mà quên bật thì traffic chiều về có thể đi vòng qua AZ khác và bị chặn.

Exam reflexesPhản xạ khi thi

The scenario says…Đề bài nói… Reach forChọn ngay
"Dozens of VPCs plus on-premises, the peering mesh is unmanageable""Mấy chục VPC cộng thêm on-premises, mớ peering không quản nổi nữa" Transit Gateway, hub-and-spoke. Transitive, and the link count goes from n(n−1)/2 to n.Transit Gateway, mô hình hub-and-spoke. Bắc cầu được, và số đường nối tụt từ n(n−1)/2 xuống còn n.
"Prod must never reach Dev, but both attach to the same gateway""Prod tuyệt đối không được với tới Dev, mà cả hai cùng cắm vào một gateway" Two TGW route tables. Associate Prod and Pre-Prod with one, Staging and Dev with the other. Never a second gateway.Hai TGW route table. Association Prod và Pre-Prod vào bảng này, Staging và Dev vào bảng kia. Đừng bao giờ dựng thêm gateway thứ hai.
"A single internet exit point for every VPC, one IP to allowlist""Chỉ một lối ra internet cho mọi VPC, chỉ một IP để đối tác allowlist" Central NAT Gateway in an Egress VPC (one NAT per AZ), App VPCs route 0.0.0.0/0 to the TGW attachment.NAT Gateway tập trung trong một Egress VPC (mỗi AZ một NAT), các App VPC trỏ 0.0.0.0/0 vào TGW attachment.
"The TGW route table points at the NAT Gateway and traffic dies""TGW route table trỏ vào NAT Gateway mà traffic vẫn chết" It cannot. TGW routes to attachments only — the Egress VPC route table is what sends the packet on to the NAT.Không trỏ được. TGW chỉ định tuyến tới attachment — chính route table của Egress VPC mới là bên đẩy gói tin tới NAT.
"VPC B must use VPC A's NAT Gateway / NLB / PrivateLink / EFS""VPC B phải dùng NAT Gateway / NLB / PrivateLink / EFS của VPC A" Not peering — it has no transit. Attach both to a Transit Gateway.Không phải peering — peering không bắc cầu được. Cắm cả hai vào một Transit Gateway.
"One on-prem link must privately reach VPCs in several Regions""Một đường on-prem duy nhất phải với tới VPC ở nhiều Region theo đường private" Direct Connect + Direct Connect Gateway → Transit Gateway, and TGW peering between the Regions.Direct Connect + Direct Connect Gateway → Transit Gateway, rồi peering TGW giữa các Region với nhau.
"The gateway lives in a Network Services account, the VPCs elsewhere""Gateway nằm ở account Network Services, còn VPC thì ở các account khác" AWS RAM: share the TGW across accounts or the whole Organization — share → accept → use.AWS RAM: chia sẻ TGW sang các account hoặc cho cả Organization — share → accept → use.
"A legacy application needs IP multicast in AWS""Một ứng dụng cũ cần IP multicast trên AWS" Transit Gateway Multicast. No other AWS service supports it, so there is no second candidate.Transit Gateway Multicast. Không service AWS nào khác hỗ trợ, nên cũng chẳng có phương án thứ hai để cân nhắc.