Volume 11 · Chapter 5 — Banking Production Support and Troubleshooting
Networking and Connectivity Troubleshooting
5.1 Introduction
Connectivity problems - a service can’t reach another, traffic can’t get in, a resource can’t reach the internet - are common and can be confusing because the network has several layers that all must permit traffic. Volume 2 covered VPC networking; this chapter applies it to troubleshooting, giving a systematic method to diagnose why connectivity is failing. Knowing the ordered sequence of things to check - routing, then firewalls, then DNS - is what turns a baffling “it can’t connect” into a quick diagnosis, and it’s a frequent practical interview scenario.
5.2 The Systematic Connectivity Check
When connectivity fails, check the layers in order rather than guessing. First, routing: does the subnet’s route table have a path to the destination (a route to an internet gateway for public, a NAT gateway for private outbound, the peering/Transit Gateway/endpoint for the target)? Second, the firewalls: do the security groups (resource-level, stateful) and network ACLs (subnet-level, stateless) allow the traffic in both directions - remembering NACLs need explicit return-traffic rules? Third, addressing: does the resource have the right IP (a public IP if it must be internet-reachable)? Fourth, DNS: does the name resolve to the right address? Checking route table → security group/NACL → IP/public-IP → DNS in that order systematically isolates where the traffic is being stopped.
flowchart TB
Fail[Connectivity failing] --> RT{Route table:\npath to destination?}
RT -->|No| FixRT[Add/fix route]
RT -->|Yes| SG{Security group + NACL\nallow both directions?}
SG -->|No| FixSG[Allow traffic; NACL needs return rule]
SG -->|Yes| IP{Correct IP / public IP\nif needed?}
IP -->|No| FixIP[Assign correct IP / NAT path]
IP -->|Yes| DNS{DNS resolves correctly?}
DNS -->|No| FixDNS[Fix DNS / endpoint]
DNS -->|Yes| Deeper[Check dependency health, TLS, ports] 5.3 Common Connectivity Failures
Specific failures map to specific layers. “Can’t reach the internet from a private resource” is usually a missing route to a NAT gateway, or the NAT/IGW path is broken. “Can’t reach my public resource from outside” is usually the subnet not routed to the internet gateway, no public IP, or a security group denying the inbound traffic - the three conditions that must all hold. “Service A can’t reach service B” is usually a security group not allowing the traffic (B’s group must permit A’s), or a NACL blocking it, or the wrong port. “Can’t reach an AWS service privately” may mean a missing or misconfigured VPC endpoint. “Half-working or timing-out connection” often points to a stateless NACL allowing one direction but not the return. Matching the symptom to its typical layer speeds diagnosis enormously.
5.4 Security Group and NACL Pitfalls
The firewall layers cause many connectivity puzzles. Because security groups are stateful, allowing inbound automatically allows the response - so if a connection half-works, suspect the stateless NACL, which needs explicit rules for both directions including the ephemeral return ports. Because security groups are allow-only and can reference other groups, a common fix is ensuring the target’s security group explicitly allows the source’s security group on the right port - not an IP that changes as instances scale. Overly broad rules cause a different problem (security exposure) but not connectivity failures. The systematic tell: if traffic is blocked, check the security group first (it’s the primary control and stateful), then the NACL (stateless - verify both directions), because between them they permit or deny most in-VPC traffic.
5.5 DNS and Endpoint Issues
When routing and firewalls are fine but connectivity still fails, DNS is often the culprit. A name not resolving, or resolving to the wrong address, breaks connectivity even when the network path is open - so verify the name resolves to the expected address. For private access to AWS services via interface endpoints, private DNS must be enabled so the service’s normal hostname resolves to the endpoint’s private IP; without it, the name resolves to the public endpoint and the private path isn’t used. For custom domains and failover, Route 53 configuration and its health checks and TTLs matter. Endpoint policies that are too restrictive can also block otherwise-valid calls. So after routing and firewalls, DNS resolution and endpoint configuration are the next things to verify.
5.6 Banking Production Scenario
A bank’s support team troubleshoots connectivity systematically. When a private application instance can’t reach an external payment network, they check routing first and find its subnet’s route to the NAT gateway is missing - adding it restores outbound access. When one microservice can’t reach another, they check security groups and find the target’s group doesn’t allow the source’s group on the service port - fixing the reference resolves it. When a private call to an AWS service fails despite the endpoint existing, they find private DNS wasn’t enabled so the hostname resolved to the public endpoint - enabling it fixes the private path. Because they check route table, then security groups and NACLs, then IP, then DNS in order, they isolate each failure to its layer quickly rather than guessing - the systematic method that makes network troubleshooting fast.
5.7 Troubleshooting: Connectivity Diagnosis Mistakes
Connectivity diagnosis goes wrong when it’s unsystematic. Guessing randomly instead of checking layers in order wastes time - go route table → security group/NACL → IP → DNS. Forgetting that NACLs are stateless (allowing one direction but not the return) explains many half-working connections - add return-traffic rules. Using IP-based security group rules that break as instances scale, instead of referencing the source’s security group, causes intermittent failures - reference the group. Overlooking DNS when the network path is fine misses a common cause - verify resolution and private DNS for endpoints. Forgetting the three conditions for internet reachability (route to IGW, public IP, permissive security rules) leaves public resources unreachable. The discipline is the ordered systematic check, awareness of stateful-versus-stateless firewalls, group references over IPs, and verifying DNS - which turns confusing connectivity failures into quick, layer-by-layer diagnoses.
A service can't connect to another resource in AWS. How do you troubleshoot it systematically?
I troubleshoot connectivity by checking the network layers in a definite order rather than guessing, because the network has several layers that all must permit traffic and the failure is in one of them. First, routing: I check whether the source subnet’s route table has a path to the destination - a route to an internet gateway for public internet access, to a NAT gateway for private outbound, or to the peering connection, Transit Gateway, or VPC endpoint for the target - because if there’s no route, traffic can’t get there regardless of anything else. Second, the firewalls: I check the security groups and network ACLs. Security groups are resource-level and stateful, so allowing inbound automatically allows the response, and they’re allow-only and can reference other security groups - so a very common fix is ensuring the target’s security group explicitly allows the source’s security group on the right port, referencing the group rather than an IP that changes as instances scale. Network ACLs are subnet-level and stateless, so they need explicit rules for both directions including the ephemeral return ports - which is why, if a connection half-works or times out, I suspect a NACL allowing one direction but not the return. Both must permit the traffic. Third, addressing: I check the resource has the right IP, and specifically a public IP if it must be reachable from the internet - remembering the three conditions for internet reachability are a route to the internet gateway, a public IP, and permissive security rules, all of which must hold. Fourth, DNS: if routing and firewalls are fine but it still fails, I verify the name resolves to the expected address, because a name not resolving or resolving wrongly breaks connectivity even with an open path; for private access to AWS services via interface endpoints, private DNS must be enabled so the hostname resolves to the endpoint’s private IP rather than the public endpoint. So my systematic order is route table, then security group and NACL, then IP and public-IP, then DNS - which isolates exactly where the traffic is being stopped. Matching the symptom to its typical layer speeds this up: “can’t reach the internet from a private resource” is usually a missing NAT route; “can’t reach my public resource from outside” is usually no IGW route, no public IP, or a security group denying it; “service A can’t reach service B” is usually B’s security group not allowing A’s, a NACL, or the wrong port; a half-working connection points to a stateless NACL missing the return rule; and a failing private AWS-service call may be a missing endpoint or private DNS. Checking the layers in this order, with awareness of stateful-versus-stateless firewalls and using group references over IPs, turns a confusing “it can’t connect” into a quick, methodical, layer-by-layer diagnosis.
Chapter Revision Notes
- Check connectivity layers in order: route table → security group + NACL → IP/public-IP → DNS.
- Security groups are stateful and allow-only (reference the source’s group); NACLs are stateless (need explicit return-traffic rules).
- Internet reachability needs all three: route to the IGW, a public IP, and permissive security rules.
- A half-working/timing-out connection often means a stateless NACL allows one direction but not the return.
- After routing and firewalls, verify DNS - including private DNS for interface endpoints so hostnames resolve to the private IP.