DEV Community

Aisalkyn Aidarova
Aisalkyn Aidarova

Posted on

NETWORK TROUBLESHOOTING LAB (DevOps)

πŸ“˜ PART 1 β€” HOW DEVOPS THINKS

When something β€œdoesn’t work,” DevOps engineers follow a logical flow:

  1. Do I have network connectivity?
  2. Does DNS resolve correctly?
  3. Is the server reachable?
  4. Is the port open?
  5. Is the application running?

We always troubleshoot layer by layer, not randomly.


πŸ§ͺ PART 2 β€” CORE NETWORK COMMANDS


1. Check Your IP Address

ip a
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • inet 192.168.x.x β†’ your machine’s IP
  • 127.0.0.1 β†’ localhost
  • eth0, ens33 β†’ network interfaces

βœ… When to use:

  • No internet
  • Checking if machine has an IP

2. Check Connectivity (Ping)

ping google.com
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • 64 bytes from ... β†’ connection is working
  • time=20ms β†’ latency
  • Request timeout β†’ no connection

βœ… When to use:

  • Server not responding
  • Check internet access

3. Trace Network Path

traceroute google.com
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • Each line = one hop
  • * * * β†’ failure at that point

βœ… When to use:

  • Ping works but app doesn’t
  • Identify where connection breaks

4. DNS Check

nslookup google.com
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • Address: β†’ resolved IP
  • Error β†’ DNS issue

βœ… When to use:

  • Domain not working
  • Suspected DNS problem

5. Advanced DNS Tool

dig google.com
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • ANSWER SECTION β†’ IP
  • status: NOERROR β†’ success

βœ… When to use:

  • Deep DNS troubleshooting

6. Test HTTP/HTTPS

curl http://example.com
Enter fullscreen mode Exit fullscreen mode

πŸ” Better version:

curl -I http://example.com
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • 200 OK β†’ success
  • 404 β†’ not found
  • 500 β†’ server error
  • Connection refused β†’ service down

βœ… When to use:

  • API testing
  • Website issues

7. Check Open Ports

netstat -tulnp
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • LISTEN β†’ port is open
  • :80, :443 β†’ ports
  • Process name β†’ service

8. Modern Alternative

ss -tulnp
Enter fullscreen mode Exit fullscreen mode

βœ… When to use:

  • Same as netstat (preferred today)

9. Check Which Process Uses a Port

lsof -i :3000
Enter fullscreen mode Exit fullscreen mode

πŸ” Output shows:

  • Process name
  • PID
  • Port

10. Test Port Connectivity

Option 1 β€” Telnet

telnet google.com 80
Enter fullscreen mode Exit fullscreen mode

Option 2 β€” Netcat (recommended)

nc -zv google.com 80
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • succeeded β†’ port open
  • failed β†’ port closed

11. Check Routing

ip route
Enter fullscreen mode Exit fullscreen mode

πŸ” How to read:

  • default via β†’ gateway (internet path)

12. Simple DNS Tool

host google.com
Enter fullscreen mode Exit fullscreen mode

13. Download Test

wget http://example.com
Enter fullscreen mode Exit fullscreen mode

πŸ§ͺ PART 3 β€” HANDS-ON LAB


πŸ”₯ Task 1 β€” Check Network Connectivity

ping 8.8.8.8
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ If this fails β†’ network issue


πŸ”₯ Task 2 β€” Check DNS

nslookup google.com
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ If this fails β†’ DNS problem


πŸ”₯ Task 3 β€” Check Website Response

curl -I https://google.com
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Find the status code


πŸ”₯ Task 4 β€” Check Port Availability

nc -zv google.com 443
Enter fullscreen mode Exit fullscreen mode

πŸ”₯ Task 5 β€” Check Local Service

Run your app:

node app.js
Enter fullscreen mode Exit fullscreen mode

Then check:

ss -tulnp | grep 3000
Enter fullscreen mode Exit fullscreen mode

πŸ”₯ Task 6 β€” Find Process Using Port

lsof -i :3000
Enter fullscreen mode Exit fullscreen mode

πŸ§ͺ PART 4 β€” REAL DEVOPS SCENARIO

❗ Problem:

β€œApplication is not accessible”

βœ… Step-by-step troubleshooting:

1. Check internet

ping 8.8.8.8
Enter fullscreen mode Exit fullscreen mode

2. Check DNS

nslookup myapp.com
Enter fullscreen mode Exit fullscreen mode

3. Check server

ping myapp.com
Enter fullscreen mode Exit fullscreen mode

4. Check port

nc -zv myapp.com 443
Enter fullscreen mode Exit fullscreen mode

5. Check HTTP

curl -I https://myapp.com
Enter fullscreen mode Exit fullscreen mode

🧠 PART 5 β€” IMPORTANT INTERVIEW KNOWLEDGE

You MUST understand:

  • ping β†’ connectivity
  • nslookup/dig β†’ DNS
  • curl β†’ HTTP
  • ss/netstat β†’ ports
  • nc β†’ port testing
  • traceroute β†’ path

Top comments (0)