CLOUD CONCEPT

IP Routing

IP routing is the process of selecting paths and forwarding Internet Protocol packets between networks using destination addresses and routing information.

Cloud Concepts Hub →

What is IP Routing

IP routing determines how traffic moves between subnets, private networks, and the internet. In cloud environments, understanding routes, subnet associations, and gateways is essential for designing connectivity and diagnosing why a workload can or cannot reach a destination.

IP routing moves packets between networks by examining their destination IP addresses and selecting an appropriate next hop. A route normally identifies a destination address range, expressed as a CIDR prefix, and a forwarding target such as a gateway or network interface. Routers and cloud networking systems use routing information to decide where traffic should go; routing does not itself decide whether an application is authorized to receive that traffic.

When multiple routes match a destination, the most specific matching prefix generally wins. For example, a route for 10.20.0.0/16 takes precedence over a default route for 0.0.0.0/0 when the destination is 10.20.5.8. The default route handles IPv4 destinations without a more specific match. IPv6 uses separate routes, with ::/0 representing its default route. Configuring an IPv4 route does not automatically provide an equivalent IPv6 path.

In cloud networks, a virtual private network boundary contains subnets and routing configuration. In AWS, Amazon VPC provides this network boundary, and each subnet is associated with one subnet route table at a time. Without an explicit association, the subnet uses the VPC's main route table. Multiple subnets can share a route table. VPC route tables include local routes for communication within the VPC address ranges, although security controls can still block that communication.

AWS classifies a subnet as public when its route table has a direct route to an internet gateway. For direct IPv4 internet communication through that gateway, an instance also needs a public IPv4 address or Elastic IP address and appropriate security rules. Merely attaching an internet gateway to the VPC does not make every subnet public, and placing a resource in a public subnet does not automatically make it reachable from the internet.

A private subnet can support outbound IPv4 internet access by routing traffic to a public NAT gateway in a public subnet. The public subnet then routes internet traffic through an internet gateway. For example, application servers can download software updates without accepting unsolicited inbound internet connections through the NAT gateway. NAT translates addresses; routing selects the forwarding path. For IPv6, an egress-only internet gateway supports outbound-initiated internet communication without performing NAT.

Routing also connects cloud networks to other cloud networks and on-premises environments. Peering connections, transit gateways, VPNs, and dedicated connectivity provide different forwarding targets and network topologies. Static routes offer explicit control but require maintenance. Dynamic routing can distribute network reachability automatically, but introduces route propagation and policy considerations. Address planning matters because overlapping network ranges can prevent straightforward private connectivity.

Practical troubleshooting follows both the outbound and return paths. Check the source subnet's route table, the selected target, destination-side routing, and security controls. Security groups filter traffic at supported resource network interfaces, while network ACLs filter traffic at subnet boundaries; neither replaces routing. A valid route can still lead to blocked traffic, and an allow rule cannot create a missing route. Centralized gateways can simplify management, but their placement and design affect availability, traffic inspection, and processing or data-transfer costs.

Key aspects of IP Routing

Reliable IP routing combines precise destination routes, correct subnet associations, suitable gateways, independent security controls, and valid paths in both directions.

Destination-based path selection

Routes map destination CIDR ranges to forwarding targets. The most specific matching prefix generally takes precedence, so a dedicated private-network route can override a broader internet default route.

Subnet route-table associations

A subnet's associated route table determines its configured forwarding paths. In AWS, each subnet uses one subnet route table at a time, either through an explicit association or through the VPC's main route table.

Gateway roles and subnet classification

Internet gateways, NAT gateways, and private connectivity gateways serve different purposes. A public subnet has a direct route to an internet gateway; a private subnet can use NAT for outbound IPv4 internet access without becoming public.

Routing and security are separate

A route establishes a forwarding path, not permission to communicate. Security groups, network ACLs, host firewalls, and application controls must independently allow the required traffic.

End-to-end and return-path reachability

Successful communication requires usable paths in both directions. Missing return routes or paths that bypass stateful inspection devices can break connections even when the source route appears correct.

Address-family and topology planning

IPv4 and IPv6 require separate routing configuration. Nonoverlapping address ranges and deliberate gateway placement help avoid connectivity conflicts, unnecessary costs, and availability dependencies.

Cloud services for IP Routing

Amazon VPC supplies the subnet-level routing foundation, including routes to local networks, internet gateways, and NAT gateways. AWS Transit Gateway connects multiple networks through a central routing hub when connectivity requirements extend beyond an individual VPC. AWS Site-to-Site VPN and AWS Direct Connect extend routing to on-premises environments through encrypted tunnels or dedicated connectivity, respectively. These services must have compatible address plans and correctly configured routes across every participating network. Security controls remain separate, and both forward and return paths must support the intended communication.

Virtual private cloud VPC_32 image Amazon VPC

Amazon VPC provides isolated virtual networks with subnets and route tables. Its internet gateways, NAT gateways, and other routing targets support public, private, and outbound-only connectivity patterns.

Open Amazon VPC →
AWS Transit Gateway image AWS Transit Gateway

AWS Transit Gateway acts as a routing hub connecting VPCs and on-premises networks. Its route tables control forwarding between attachments and can separate groups of networks with different connectivity requirements.

Open AWS Transit Gateway →
AWS Site to Site VPN image AWS Site-to-Site VPN

AWS Site-to-Site VPN provides encrypted connectivity between an on-premises network and AWS. Static routing or dynamic routing with BGP establishes which destination networks are reachable through the VPN.

Open AWS Site-to-Site VPN →
AWS Direct Connect image AWS Direct Connect

AWS Direct Connect provides dedicated network connectivity to AWS and uses BGP to exchange routing information. Appropriate virtual interfaces and gateway connections enable access to supported private or public AWS destinations.

Open AWS Direct Connect →