Linux Networking Fundamentals and AWS Basics for Beginners

Introduction
Linux networking and AWS concepts are essential for system administrators, cloud engineers, and DevOps professionals. This article covers the OSI model, subnetting, security groups, NAT, firewall concepts, AWS VPC architecture, important Linux commands, and Nginx installation.
1. OSI Model
The OSI (Open Systems Interconnection) model consists of seven layers.
. Application Layer
Protocols: HTTP, HTTPS, FTP
. Presentation Layer
Protocols: SSL, TLS
. Session Layer
Uses APIs and sockets
. Transport Layer
Protocols: TCP, UDP
. Network Layer
Protocols: IP, ICMP
. Data Link Layer
Handles node-to-node communication.
. Physical Layer
Responsible for physical transmission of data.
2. Subnetting
Subnetting divides a large network into smaller networks.
. CIDR (Classless Inter-Domain Routing)
Represents IP address ranges.
Example:
192.168.1.0/24
. Subnet Mask
Defines the network and host portions of an IP address.
Example:
255.255.255.0
. Private IP Address
Used within internal networks.
. Public IP Address
Accessible over the internet.
3. Security Groups
Security groups act as virtual firewalls for AWS EC2 instances.
Features of Security Groups
Controls inbound traffic.
Controls outbound traffic.
Stateful in nature.
4. Types of NAT
Network Address Translation (NAT) converts private IP addresses into public IP addresses.
Static NAT
One private IP ↔ One public IP.
Dynamic NAT
Private IPs are mapped to a pool of public IP addresses.
PAT (Port Address Translation)
Multiple devices share a single public IP address.
5. Firewall
A firewall protects a system from unauthorized access.
. VPN (Virtual Private Network)
Creates an encrypted tunnel for secure communication.
. Inbound Rules
Specify which incoming traffic is allowed.
Examples:
HTTP – Port 80
HTTPS – Port 443
SSH – Port 22
. Elastic IP
A fixed public IP provided by AWS.
. Static IP
An IP address that remains unchanged.
. Dynamic IP
An IP address that changes automatically.
6. AWS VPC Architecture
Amazon VPC enables users to create isolated virtual networks.
Components of AWS VPC
. VPC
A logically isolated network in AWS.
. Public Subnet
Contains resources accessible from the internet.
. Private Subnet
Contains resources that are not directly accessible from the internet.
. Internet Gateway
Connects the VPC to the internet.
. NAT Gateway
Provides internet access to private subnet resources.
. Route Table
Defines traffic routing rules.
. VPC Peering
Enables communication between two VPCs.
7. Essential Linux Networking Commands
. Ping Command
Tests network connectivity.
ping google.com
. Traceroute Command
Displays the path packets take.
traceroute netflix.com
. Nslookup Command
Finds the IP address of a domain.
nslookup google.com
. Curl Command
Transfers data from servers using HTTP or HTTPS.
curl https://www.google.com
. Wget Command
Downloads files from the internet.
wget https://example.com/file.zip
. Netstat Command (-tunlp)
Displays active connections, ports, and processes.
netstat -tunlp
. SS Command (-tunlp)
Modern replacement for netstat.
ss -tunlp
8. Installing Nginx
Step 1: Update the Package Repository
sudo apt update
Step 2: Install Nginx
sudo apt install nginx -y
Step 3: Check Nginx Status
sudo systemctl status nginx
Press:
Ctrl + C
to exit.
Step 4: Enable Nginx Service
sudo systemctl enable nginx
Step 5: Create an HTML Page
Move to the HTML Directory
cd /var/www/html
Open the File
sudo nano index.html
Save the File
Add your HTML code and save it using:
Ctrl + X
Y
Enter
Step 6: Restart Nginx
sudo systemctl restart nginx
Step 7: Configure Security Group
Add the Following Inbound Rules
HTTP → Port 80
HTTPS → Port 443
Verify Access
After adding these rules, access the website using the Public IP Address of the EC2 instance.
Conclusion
Understanding Linux networking concepts and AWS services is fundamental for anyone pursuing cloud computing, DevOps, or system administration. These concepts provide the foundation for building secure and scalable infrastructure.



