π Networking for Beginners: DevOps
In this blog, weβll understand:
Hub
Switch
Router
Gateway & Default Gateway
Modem & FTTH (ONU device)
Broadband & WiFi
Network Interface Card (NIC)
Firewall
VPN
VPC
DHCP
DNS
π§ First: What is a Network?
A network is simply:
A group of devices connected together to share data.
Example:
Your laptop
Your phone
Your TV
All connected to WiFi
Thatβs a network.
π Hub (Old Device)
π What is Hub?
A hub is a basic networking device that connects multiple computers.
π§ Simple analogy
Hub is like a teacher shouting in a classroom.
If one student talks, everyone hears it.
πΌ Hub Diagram
π« Problem with Hub
Sends data to all devices
Not secure
Slow
Thatβs why hubs are not used today.
π Switch (Modern Local Network Device)
π What is Switch?
A switch connects devices inside a network (like inside office or home LAN).
It sends data only to the correct device.
π§ Simple analogy
Switch is like a courier service.
If you send a parcel to John, only John receives it β not everyone.
πΌ Switch Diagram
β Used in:
Offices
Data centers
Schools
π Router
π What is Router?
Router connects different networks together.
Example:
- Your home network β Internet
π§ Simple analogy
Router is like a traffic police at a junction.
It decides:
Where data should go
Which path to take
πΌ Router Diagram
Real-time example
When you open:
google.com
Router sends your request to ISP β Internet β Google server.
πͺ Gateway & Default Gateway
π What is Gateway?
Gateway is a device that connects one network to another.
Usually your router acts as a gateway.
π Default Gateway
Default gateway is the IP address where your system sends traffic outside your local network.
Check it using:
ip route
Example output:
default via 192.168.1.1
Here:
192.168.1.1
is your default gateway.
π Modem & FTTH (ONU Device)
π What is Modem?
The modem converts ISP signal to digital signal for your router.
π FTTH (Fiber to the Home)
Modern homes use fiber connection.
Instead of a modem, we use:
ONU (Optical Network Unit)
This device:
Converts fiber light signals
Provides Ethernet & WiFi
πΌ FTTH ONU Diagram
π‘ Broadband & WiFi
Broadband = High-speed internet connection.
WiFi = Wireless connection provided by router/ONU.
Your phone connects via WiFi β Router β Internet.
π» Network Interface Card (NIC)
Every device has NIC.
It allows device to connect to network.
Check using:
ip addr
NIC example:
eth0
wlan0
π₯ Firewall
Firewall controls network traffic.
It allows or blocks traffic based on rules.
π§ Simple analogy
Firewall is like a security guard.
It checks:
Who can enter
Who should be blocked
πΌ Firewall Diagram
π VPN (Virtual Private Network)
VPN creates a secure tunnel over the internet.
Used for:
Office remote access
Secure browsing
π§ Analogy
VPN is like a private tunnel inside a public road.
πΌ VPN Diagram
βοΈ VPC (Virtual Private Cloud)
Used in cloud platforms like AWS.
VPC is:
Your private network inside the cloud.
Inside VPC:
Subnets
Route tables
Security groups
πΌ VPC Diagram
π§ DHCP (Dynamic Host Configuration Protocol)
DHCP automatically assigns IP addresses.
When you connect to WiFi:
- Router gives IP automatically.
Example:
192.168.1.10
Without DHCP, we must manually configure IP.
π DNS (Domain Name System)
DNS converts:
google.com β 142.250.x.x
Without DNS, we must remember IP addresses.
π Complete Home Network Flow (Real-Time)
Your phone connects to WiFi
Router assigns IP via DHCP
You type google.com
DNS resolves IP
Router sends request to ISP
ISP routes to Google server
Server responds
Webpage loads
All in milliseconds β‘
π οΈ Common Linux Networking Commands (With Real-Time Examples)
π 1οΈβ£ ip addr
π What it does:
Shows your IP address and network interface details.
ip addr
π§ Real-time use:
Check:
Do I have an IP address?
Is my network interface up?
Example output:
inet 192.168.1.10/24
If no IP β DHCP problem.
π 2οΈβ£ ip route
π What it does:
Shows routing table and default gateway.
ip route
Example:
default via 192.168.1.1
π§ Real-time use:
If internet not working, check:
- Is default gateway configured?
π‘ 3οΈβ£ ping
π What it does:
Checks connectivity between two devices.
ping google.com
π§ Real-time troubleshooting:
Test | Meaning |
|---|---|
| Local system check |
| Check router |
| Check internet |
| Check DNS |
If 8.8.8.8 works but google.com doesnβt β DNS issue.
π£οΈ 4οΈβ£ traceroute
π What it does:
Shows the path packets take to reach a server.
traceroute google.com
π§ Real-time use:
Find where network is failing:
Local network?
ISP?
External server?
π 5οΈβ£ nslookup
π What it does:
Query DNS server manually.
nslookup google.com
Use specific DNS:
nslookup google.com 8.8.8.8
π§ Real-time use:
Check if DNS server is responding.
π 6οΈβ£ dig
π What it does:
Advanced DNS lookup tool.
dig google.com
Check A record:
dig google.com A
Check MX record:
dig google.com MX
π§ Real-time use:
Used by DevOps engineers for deep DNS debugging.
π 7οΈβ£ ss
π What it does:
Shows open ports and connections.
ss -tulnp
π§ Real-time use:
Check:
Is service running?
Is port 80 open?
Is port 22 open?
π 8οΈβ£ netstat
netstat -tulnp
Used to:
Check listening ports
Check active connections
π₯ 9οΈβ£ curl
π What it does:
Send a request to the server from the terminal.
curl google.com
Check API:
curl http://192.168.1.20:8080
π§ Real-time use:
Check:
Is server responding?
Is website accessible?
π§± π telnet
π What it does:
Check if specific port is reachable.
telnet google.com 80
If connected β Port open
If connection refused β Port blocked
π 1οΈβ£1οΈβ£ arp
π What it does:
Shows MAC address mapping.
arp -a
Used when:
Local device not reachable
ARP issue suspected
π§ͺ 1οΈβ£2οΈβ£ mtr (Advanced traceroute)
mtr google.com
Shows:
Live latency
Packet loss
π 1οΈβ£3οΈβ£ Check DNS Config
cat /etc/resolv.conf
Shows:
nameserver 8.8.8.8
If wrong β DNS issue.
π§Ύ 1οΈβ£4οΈβ£ Check /etc/hosts
cat /etc/hosts
Used for:
Manual DNS override
Local testing
π οΈ Real-Time Troubleshooting Flow
Letβs say:
β Website not opening
Follow this:
Step 1:
ip addr
Do you have IP?
Step 2:
ip route
Check default gateway.
Step 3:
ping 8.8.8.8
Internet working?
Step 4:
ping google.com
If fails β DNS problem.
Step 5:
dig google.com
Check DNS resolution.
Step 6:
curl google.com
Check HTTP response.
π― Quick Troubleshooting Table
Problem | Command to Use |
|---|---|
No IP |
|
No internet |
|
DNS issue |
|
Port blocked |
|
Service not running |
|
Wrong DNS |
|
Routing issue |
|
High latency |
|
π― Final Thoughts
If you understand:
Switch
Router
Gateway
Firewall
VPN
DHCP
DNS
VPC
You understand the foundation of networking and cloud.
This is the base for:
DevOps
Cloud engineering
Cybersecurity
System administration