Cloud concept · Updated

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

In short

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.

Cloud Concepts Hub →

6 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.

01
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.

02
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.

03
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.

04
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.

05
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.

06
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.

Amazon VPCAmazon 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.

AWS Transit GatewayAWS 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.

AWS Site-to-Site VPNAWS 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.

AWS Direct ConnectAWS 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.

IP Routing exam questions

Real practice exam questions on IP Routing, with the correct answer and its explanation. Answer them with every option in the exam simulator.

CLF-C02

A company launches a public-facing web server on an Amazon EC2 instance in a new subnet. The instance has a public IPv4 address, and an internet gateway is attached to the VPC. Security groups and network ACLs allow the required HTTPS traffic, but internet users cannot reach the server. The subnet's route table contains only the local route for the VPC. Which change will enable direct IPv4 connectivity between the server and internet users?

Show answerCORRECT ANSWER

Add a route for 0.0.0.0/0 to the subnet's route table with the internet gateway as the target.

The subnet needs a route to the internet gateway for destinations outside the VPC. With a public IPv4 address and appropriate security rules already in place, this route enables direct IPv4 internet connectivity.

SOA-C03

A company has an IPv4-only VPC with three route tables:

• Main: contains only the VPC local route. Database subnets have no explicit route table associations and must remain without any route to the internet.
• Application: contains the VPC local route and 0.0.0.0/0 → a public NAT gateway. Existing application subnets are explicitly associated with this table and have working internet access.
• Public: contains the VPC local route and 0.0.0.0/0 → an internet gateway. The NAT gateway is in a subnet explicitly associated with this table.

A CloudOps engineer creates a new application subnet but does not explicitly associate a route table with it. EC2 instances in the new subnet cannot download updates from the internet. The instances have only private IPv4 addresses and must retain that configuration. Security groups and network ACLs allow the required traffic.

Which change will restore internet access for the new instances while preserving the database subnets' isolation and existing application connectivity?

Show answerCORRECT ANSWER

Explicitly associate the new application subnet with the Application route table.

The new subnet currently inherits the Main route table, which has no internet route. Explicitly associating it with the Application route table directs outbound IPv4 traffic through the working public NAT gateway without changing routing for the database subnets or existing application subnets.

AIP-C01

A pharmaceutical company runs a generative AI preprocessing application on EC2 instances on an AWS Outposts rack at a regulated facility. The application retrieves unredacted laboratory records from an on-premises API at 172.26.40.20. Those records must not leave the facility. Only locally de-identified prompts may be sent to an approved foundation model in the parent AWS Region. That inference connection already works and must remain unchanged.

The Outpost subnet is 10.84.12.0/24 within VPC 10.84.0.0/16. Its explicitly associated route table currently sends traffic for destinations outside the VPC through a virtual private gateway to a network hub in the parent Region. The facility is also connected to that hub, but this path leaves the facility.

The Outposts local gateway uses direct VPC routing. Its route table is associated with the VPC and already contains a BGP-learned route for 172.26.40.0/24 through the facility network. The local gateway's physical connectivity and BGP session are healthy. The facility router currently reaches 10.84.12.0/24 only through the regional hub. All required security groups, network ACLs, and firewalls permit the API traffic, and there are no overlapping CIDRs or additional routing policies.

Which routing change enables compliant, bidirectional access to the laboratory API?

Show answerCORRECT ANSWER

Add 172.26.40.0/24 → local gateway to the Outpost subnet's associated route table. Advertise 10.84.12.0/24 through the local gateway's BGP connection and configure the facility router to prefer that path for the Outpost subnet.

The subnet route directs API requests to the local gateway instead of the regional hub. The local gateway already knows how to reach the API network. Direct VPC routing preserves the instances' private VPC addresses, so the facility also needs a preferred return route for 10.84.12.0/24 through the local gateway. Both directions remain within the facility, while the existing regional inference path is unchanged.

Practice IP Routing in a full exam

Questions on IP Routing in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is IP Routing

2 min read

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.

Learn IP Routing in lessons

10 short lessons on IP Routing in 5 certification courses.

and 4 more lessons

Open the lessons