Linux Networking Basics for Beginners

์ž‘์„ฑ์ž

์นดํ…Œ๊ณ ๋ฆฌ:

โ† ํ”ผ๋“œ๋กœ
DEV Community ยท Sreekanth Kuruba ยท 2026-06-23 ๊ฐœ๋ฐœ(SW)

Sreekanth Kuruba

Post: 6

Most Linux โ€œserver downโ€ problems are not actually system failures.

They are network issues.

๐Ÿ‘‰ The system is running fine
๐Ÿ‘‰ But it cannot talk to the outside world

Thatโ€™s why networking is one of the most critical skills in Linux, DevOps, and cloud environments.

Letโ€™s simplify it.

Basic Networking Concepts (Must Know First)

What is an IP Address?

An IP address is a unique address assigned to a device in a network.

Example:

192.168.1.10

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ Used for communication between systems.

What is localhost (127.0.0.1)?

localhost refers to your own computer.

127.0.0.1

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ This means โ€œyour own computerโ€

Used for:

  • testing apps
  • local development
  • debugging services

What is DNS?

DNS (Domain Name System) converts domain names into IP addresses.

Example:

google.com โ†’ 142.x.x.x

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ Without DNS, we would need to remember IPs manually.

What is a Port?

Ports are like โ€œdoorsโ€ for services.

Ports are communication endpoints used by applications.

Examples:

  • Port 80 โ†’ HTTP
  • Port 443 โ†’ HTTPS
  • Port 22 โ†’ SSH

๐Ÿ‘‰ One server can run multiple services using different ports.

1. Check Internet Connectivity with ping

ping google.com

Enter fullscreen mode Exit fullscreen mode

Limit requests:

ping -c 4 google.com

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ First command used in troubleshooting.

Checks:

is host reachable?
is network working?

2. Test Web Requests with curl

curl google.com

Enter fullscreen mode Exit fullscreen mode

Headers only:

curl -I google.com   # Show only HTTP headers

Enter fullscreen mode Exit fullscreen mode

Verbose mode:

curl -v google.com   # Verbose (detailed output)

Enter fullscreen mode Exit fullscreen mode

Used for:

API testing
checking web services
debugging HTTP issues

3. Check DNS Resolution

nslookup google.com

# More detailed DNS lookup
dig google.com

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ If DNS fails:

website wonโ€™t open
even if internet is working

4. Check Your IP Address

ip a          # full network interface details
hostname -I   # Show only IP addresses

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ Shows your systemโ€™s network identity

5. Check Routing path

ip route
ip route | grep default   # Show default gateway

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ Shows how traffic leaves your system

6. Check Open Ports

ss -tuln               # Show listening ports
ss -tuln | grep :80    # Check specific port

Enter fullscreen mode Exit fullscreen mode

Shows which services are listening on your system.

Modern replacement for netstat.

7. Trace Network Path with traceroute

traceroute google.com

Enter fullscreen mode Exit fullscreen mode

Install if needed:

sudo apt install traceroute    # Ubuntu/Debian
sudo dnf install traceroute    # Fedora/RHEL

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ Shows where delay or failure happens in network path

8. Enhanced Traceroute with mtr

mtr is a powerful combination of ping and traceroute. It continuously monitors the connection.

mtr google.com

Enter fullscreen mode Exit fullscreen mode

Install if needed:

sudo apt install mtr

Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ Combines:

ping
traceroute

Real-time network diagnostics tool

Simple Troubleshooting Flow (VERY IMPORTANT)

  1. ping 8.8.8.8 โ†’ check internet
  2. ping google.com โ†’ check DNS
  3. ip a โ†’ check IP
  4. ip route โ†’ check routing
  5. curl -I site โ†’ check HTTP
  6. traceroute / mtr โ†’ find failure point

๐Ÿ‘‰ This is real DevOps incident workflow

โš ๏ธ Common Beginner Mistakes

  • assuming internet is down (when DNS is broken)
  • not checking IP address first
  • using old tools (ifconfig, netstat)
  • routing checks

Simple Mental Model

Think of networking like delivery:

IP โ†’ house address
DNS โ†’ contact name โ†’ address lookup
Port โ†’ door number
Routing โ†’ delivery path
ping โ†’ โ€œare you there?โ€

Summary

You learned:

IP address basics
localhost (127.0.0.1)
DNS resolution
ports (80, 443, 22)
ping โ†’ connectivity
curl โ†’ web/API testing
nslookup, dig โ†’ DNS tools
ip a, ip route โ†’ network config
ss โ†’ open ports
traceroute, mtr โ†’ path debugging

Why This Matters

Networking is the backbone of:

cloud systems
DevOps pipelines
APIs
production servers

๐Ÿ‘‰ If networking breaks, everything breaks

Next Post:
Linux Logs Explained Simply,(journalctl, /var/log)

Question for You

Have you ever faced a situation where:

internet was working
but website still didnโ€™t load?

Thatโ€™s usually DNS โ€” Iโ€™ll show debugging in Part 8.

์›๋ฌธ์—์„œ ๊ณ„์† โ†—

์ถ”์ถœ ๋ณธ๋ฌธ ยท ์ถœ์ฒ˜: dev.to ยท https://dev.to/sreekanth_kuruba_91721e5d/linux-networking-basics-for-beginners-3e2e

์ฝ”๋ฉ˜ํŠธ

๋‹ต๊ธ€ ๋‚จ๊ธฐ๊ธฐ

์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ํ•„๋“œ๋Š” *๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค