devops-notes/04_Linux_Networking_Basics.md

1.5 KiB
Raw Blame History

Linux Networking Basics (Day 4)

What is Networking in Linux?

Networking means how computers and servers communicate with each other using IP addresses, ports, and protocols.

Every DevOps engineer must understand networking because applications run on networks.


Why Networking is Important for DevOps?

If networking fails:

  • app will not open
  • server looks “down”
  • deployment fails

Most DevOps issues are actually network issues.


IP Address

An IP address identifies a machine on a network.

Check IP:

ip a

or

ifconfig

Hostname

hostname

Ping Command

ping google.com

Stop ping:

Ctrl + C

curl Command (VERY IMPORTANT)

curl google.com
curl -I google.com

wget Command

wget https://example.com/file.txt

Ports (CRITICAL CONCEPT)

Common ports:

  • 22 → SSH
  • 80 → HTTP
  • 443 → HTTPS
  • 3306 → MySQL

Check Open Ports

netstat -tuln

or

ss -tuln

Check Which Process Uses a Port

sudo netstat -tulnp

DNS Resolution

nslookup google.com
dig google.com

Test Server Connectivity

telnet google.com 80

Real DevOps Scenario

Commands used:

curl
ping
netstat
ss

Common Mistakes

  • Forgetting port number
  • Confusing localhost and public IP

DevOps Rule

If something doesnt work → check network first.


Summary

Linux networking basics: IP, ports, ping, curl, DNS, and open ports.