How Do I Route Traffic to 100.64.x.x Through an Enterprise Router?¶
Scenarios¶
A route with 100.64.x.x as the destination and an enterprise router as the next hop cannot be added to a VPC route table.
Solutions¶
If you want to route traffic to 100.64.x.x through an enterprise router, you need to create a transit VPC. Figure 1 shows the network diagram.
The request traffic from the service VPC to the on-premises data center will be forwarded through the transit VPC, but the response traffic will not. For details, see Table 1.
Path | Description |
---|---|
Request traffic: service VPC → transit VPC → enterprise router → virtual gateway → on-premises data center |
|
Response traffic: on-premises data center → virtual gateway → enterprise router → service VPC |
|
The required resources and routes are as follows:
Table 2: Required service VPC, transit VPC, enterprise router, and Direct Connect connection that connects the cloud and the on-premises data center
Table 3: Required routes of the service VPC, transit VPC, and enterprise router
Resource | Quantity | Description |
---|---|---|
VPC | 2 | Service VPC that your services are deployed and needs to be attached to the enterprise router
|
Transit VPC that is connected to the service VPC over a VPC peering connection and needs to be attached to the enterprise router
| ||
Enterprise router | 1 | Three attachments on the enterprise router:
|
Direct Connect | 1 |
|
Route Table | Destination | Next Hop | Route Type |
---|---|---|---|
Service VPC | 100.64.x.x | VPC peering connection | Static route (custom) |
Transit VPC | 2.2.2.2/32 Note 2.2.2.2/32 is mandatory and must be added. | VPC peering connection | Static route (custom) |
0.0.0.0/0 | Enterprise router | Static route (custom) | |
Enterprise router | 10.1.0.0/16 | Service VPC attachment | Propagated route |
100.64.x.x | Virtual gateway attachment | Propagated route |
Create a transit VPC, attach it to the enterprise router, and associate the transit VPC with the default route table of the enterprise router.
The subnet of the transit VPC cannot overlap with that of the service VPC, or the VPC peering connection to be created in 2 cannot take effect.
The transit VPC cannot have the following situations. Otherwise, the default route (0.0.0.0/0) to be configured in 3 cannot forward traffic.
An ECS in the VPC has an EIP bound.
The VPC is being used by ELB (either dedicated or shared load balancers), NAT Gateway, VPC Endpoint, and DCS.
Create a VPC peering connection between the service VPC and transit VPC.
Important
You do not need to add routes for the VPC peering connection. For details about the routes to be added, see 3.
Add routes to the VPC route tables.
For details about required routes, see Table 3.
Add the route to the service VPC route table.
Add two routes to the transit VPC route table.