How to do it...

  1. The first troubleshooting step starts with pinging the destination (any other host or internet).
Make sure that you test the destination from another server or your own computer because the destination host/website should have ICMP enabled.
  1. Verify that NAT Gateway and EC2 are attached to the desired subnet.
  2. Ensure that NAT Gateway has been created in a public subnet.
Public subnet should have a public Route Table having a default route pointing to the Internet Gateway.
  1. Check that the NAT Gateway is in an available state. If the NAT Gateway goes into a failed state, you will need to resolve the issue or create a new one immediately.
A failed NAT Gateway will be deleted automatically at some time, usually in an hour.

Get AWS Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.