Skip to content

multiple subnets routing with a VPC

0

If I have multiple ec2 instances in different subnets within the same VPC, are they reachable to each other by default? Any way for me see the AWS system route table in a VPC ? I have the following: Enter image description here In my understanding, TGW installs an ENI in Service-VPC with IP 10.1.99.X. After TGW sends packets to Service-VPC, Service-VPC will use FrontEnd-RT to resolve the nexthop which is interface eth0.

Service-VPC has a system route table which is used to route all traffic between the subnets in Service-VPC, right ? If yes, does that mean from the firewall I am supposed to be able to ping 10.1.99.1 ? If yes, but I can't ping, where might the problem be ?

See the following: I don't understand why 10.1.1.254 treats 10.1.99.1 to be local.. Enter image description here

thanks a lot for any insights !!

asked 2 years ago770 views

2 Answers
1

Let's address your questions one by one:

  1. Multiple EC2 instances in different subnets within the same VPC are reachable to each other by default. This is because VPCs have a default local route that allows communication between all resources within the VPC, regardless of which subnet they're in.

  2. AWS doesn't expose a "system route table" for VPCs. Instead, each subnet in a VPC is associated with a route table, which can be either the main route table or a custom route table. You can view these route tables in the AWS Management Console, CLI, or API.

  3. Regarding your specific setup:

    • The Transit Gateway (TGW) does install an Elastic Network Interface (ENI) in the Service-VPC with an IP in the 10.1.99.X range.
    • After TGW sends packets to Service-VPC, the routing decision is indeed based on the route table associated with the subnet where the packet arrives (in this case, FrontEnd-RT).
    • There isn't a separate "system route table" for routing between subnets. The routing between subnets is handled by the local route in each subnet's route table.
  4. Regarding pinging 10.1.99.1 from the firewall:

    • In theory, you should be able to ping this address if it's within your VPC and there are no security groups or network ACLs blocking the traffic.
    • If you can't ping it, potential issues could be: a) Security group rules not allowing ICMP traffic b) Network ACLs blocking the traffic c) The firewall's own configuration preventing the ping
  5. The reason 10.1.1.254 treats 10.1.99.1 as local is because they are both within the VPC's CIDR range. The "local" target in a route table refers to any destination within the VPC's CIDR block, not just within the same subnet.

If you're still having issues, you might want to check:

  • The security group rules for both the source and destination instances
  • The network ACLs for the subnets involved
  • The firewall's configuration to ensure it's not blocking the traffic
  • The route tables for all subnets involved to ensure they have the correct local route

Remember, while instances in different subnets of the same VPC can communicate by default, this can be restricted by security groups, network ACLs, or custom route tables.
Sources
Subnets for your VPC - Amazon Virtual Private Cloud
Subnet route tables - Amazon Virtual Private Cloud
Achieve multipath load balancing in Amazon VPC using Virtual IPs | AWS for Industries

answered 2 years ago

EXPERT

reviewed 2 years ago

0

All my ACL are default which I think they allow all the traffic. All my security groups allow ssh,icmp, and all traffic.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.