Chapter 1: Networking Fundamentals
Common Mistakes I See Students Make
Friends, this list comes from my classroom – these networking mistakes happen in every batch. Read it once and keep it in mind; it will save you time later on AWS.
मित्रांनो, ही लिस्ट माझ्या क्लासमधली आहे – नेटवर्किंगच्या या चुका प्रत्येक बॅचमध्ये होतात. एकदा वाचून ठेवा, म्हणजे पुढे AWS वर तुमचा वेळ वाचेल.
दोस्तों, ये लिस्ट मेरी क्लास की है – नेटवर्किंग की ये गलतियाँ हर बैच में होती हैं. एक बार पढ़कर रखो, तो आगे AWS पर आपका टाइम बचेगा.
- Confusing IP and port. Opening port 80 in the security group does not give your server a public IP, and having a public IP does not open any port. You need both.
- Opening every port to 0.0.0.0/0 "just to test". Then forgetting to close it. Databases like MySQL (3306) and MongoDB (27017) get attacked within hours.
- Thinking 192.168.x.x or 10.x.x.x is reachable from the internet. Private IPs never route on the internet; that is the whole point of RFC 1918.
- Forgetting that the auto-assigned public IP changes after stop/start. Students update their DNS or WordPress URL, stop the instance for the night, and the next day nothing works.
- Using
::twice in an IPv6 address (e.g.2001::1::5) — invalid, because the length becomes ambiguous. - Counting all addresses as usable. A /24 in AWS gives 251 usable IPs, not 256 or 254.
Extended notes for this AWS lesson
Why students get stuck here
AWS pages look simple until three things collide: the service setting, the VPC/security group, and the app configuration. The expansions below separate those layers with real stacks and sample commands.
The same pattern in app stacks
Whether the data store is RDS MySQL, PostgreSQL, or another engine, apps read an endpoint + user + password from the environment.
Java / Spring Boot
spring.datasource.url=jdbc:mysql://ENDPOINT:3306/db with password from Secrets Manager / env.
Python / Django / Flask
HOST from env; never commit settings with real hosts.
Node.js
mysql2/pg clients with process.env.DB_HOST.
.NET
ConnectionStrings via env or Parameter Store.
PHP / Laravel
DB_HOST in .env, not in Git.
Go
database/sql with env-based DSN.
Indian company (sample)
Suppose we are a junior cloud engineer at Swiggy or Razorpay-style infrastructure. A new microservice cannot reach RDS. You check: 1) SG on RDS allows the app SG on 3306/5432. 2) App is in a private subnet with a route to the DB subnet. 3) The secret in Secrets Manager matches the rotated password. 4) You connect with the mysql/psql client from the app host before blaming the ORM.
Global practice
AWS Well-Architected Security and Reliability pillars: least-privilege SG, Multi-AZ for production relational DBs, automated backups, no public DB reachability.
Everyday analogy
A warehouse (RDS) should not open onto the street. Delivery bikes (app servers) enter through a staff gate (security group) with a badge (password/IAM auth).
Engines and ports
MySQL / MariaDB on RDS
Port 3306. Users and grants like self-managed MySQL.
PostgreSQL on RDS
Port 5432. Prefer scram auth.
SQL Server on RDS
Port 1433. Common with .NET shops.
Amazon Aurora
MySQL or PostgreSQL compatible; learn the endpoint types (cluster vs reader).
Load balancers in one breath
ALB is for HTTP/HTTPS apps (Spring, Node, Django, .NET). NLB is for extreme performance/TCP. GLB is for virtual appliances. Classic LB is legacy—prefer ALB/NLB for new work. Always put TLS on the balancer with ACM when you can.
Common EC2 and Linux mistakes (expanded)
- Losing the SSH key → use SSM Session Manager next time.
- Editing on the server without backups → keep AMI + user-data scripts.
- Opening 0.0.0.0/0 on SSH → restrict to your IP or VPN.
- Forgetting Elastic IP / DNS when testing restarts.
- Growing EBS without extending the Linux filesystem (growpart + resize2fs/xfs_growfs).
Common mistakes
- Publicly accessible RDS "for a quick test" left open.
- Mixing Classic LB advice with ALB listener rules.
- Hard-coding IPs instead of DNS names for RDS endpoints.
- Taking snapshots but never testing restore.
Worksheet
- Draw your VPC boxes: public subnet, private subnet, RDS subnet.
- Write the SG rules in a table.
- From the app host, run a one-line DB client connect.
- Take a snapshot and write the restore steps without looking.
Recap
- Service + network + app config.
- Private databases.
- Prefer ALB + ACM for web apps.
- Practise restore, not only backup.