Networking for DevOps: The Concepts You Actually Need

A surprising number of “the app is down” tickets turn out to be networking problems: a DNS record pointing at an old server, a firewall rule that blocks a port, a container listening on localhost when it should listen on every interface. DevOps engineers who can tell these apart in five minutes save their teams hours.

The short answer: for DevOps you need IP addresses and CIDR ranges, subnets, ports and protocols (TCP, UDP, HTTP, HTTPS), DNS, routing and NAT, firewalls and security groups, load balancers, and TLS certificates. Add a handful of troubleshooting commands such as ping, dig, curl and ss. You do not need router configuration or a CCNA to start.

Networking is the topic many beginners skip and later regret, so it is worth learning alongside Linux early in any DevOps training in Pune. This guide covers what to learn and shows how each idea appears in real work.

IP addresses, CIDR and subnets

Every machine on a network has an IP address, such as 10.0.1.25. A CIDR range like 10.0.0.0/16 describes a block of addresses: the number after the slash says how many bits are fixed, so /16 gives about 65,000 addresses and /24 gives 256.

You will meet CIDR the first time you build a cloud network. A typical layout gives the whole network 10.0.0.0/16, then carves it into 10.0.1.0/24 for public subnets and 10.0.2.0/24 for private ones. Know the private ranges too: 10.x, 172.16-31.x and 192.168.x are never routed on the public internet.

Ports and protocols

An IP address finds the machine; a port finds the program on it. SSH listens on 22, HTTP on 80, HTTPS on 443, PostgreSQL on 5432 and MySQL on 3306. When someone says “open port 443”, they mean allow traffic to whatever is listening there.

TCP is the reliable, connection-based protocol used by web traffic, SSH and databases. UDP is faster and fire-and-forget, used by DNS lookups and video streaming. HTTP sits on top of TCP, and HTTPS is HTTP wrapped in TLS encryption. Knowing which layer a problem lives at is half of debugging it.

DNS: the cause of more outages than you would expect

DNS turns names like api.example.com into IP addresses. The record types you will use most are A (name to IPv4 address), CNAME (name to another name), MX (mail) and TXT (verification and policy). Each record has a TTL that says how long resolvers may cache it.

TTL is where the trouble starts. Change a record with a one-day TTL and some users will keep hitting the old server for a day. Before a planned migration, teams lower the TTL to a few minutes a day or two ahead. Inside Kubernetes, services also find each other by DNS name, so these ideas follow you into containers.

Routing, gateways and NAT

A route table tells traffic where to go next. Traffic for addresses inside the network stays local; everything else goes to a default gateway. In a cloud VPC, public subnets route to an internet gateway, while private subnets route through a NAT gateway.

NAT lets many private machines share one public address for outgoing traffic, so a private server can download updates without anyone on the internet being able to reach it directly. Drawing this layout from memory is a common interview task; our guide to AWS services for DevOps shows how it maps onto a real VPC.

Firewalls, security groups and load balancers

Firewalls decide which traffic is allowed in or out. On a Linux server that might be ufw or iptables; in AWS it is security groups and network ACLs; in Kubernetes it is NetworkPolicies. The principle is the same everywhere: allow only what is needed, from only where it is needed.

A load balancer spreads requests across several servers and stops sending traffic to any that fail a health check. Layer 4 load balancers work with TCP connections, while Layer 7 ones understand HTTP and can route by path, such as sending /api to one group of servers and everything else to another.

TLS and certificates

TLS encrypts traffic and proves a server is who it claims to be. A certificate is tied to one or more domain names and has an expiry date. Expired certificates are a classic, entirely avoidable outage, which is why most teams automate renewal with tools such as Let’s Encrypt and certbot or their cloud provider’s certificate service.

Containers have networks too

Docker gives each container its own network namespace. By default a container on a bridge network can reach the internet, but nothing outside can reach it until you publish a port with -p 8080:80. Containers on the same user-defined network can reach each other by container name.

One trap catches nearly every beginner: an app that listens on 127.0.0.1 inside a container is unreachable from outside it, even with the port published. It must listen on 0.0.0.0. Kubernetes adds Services and Ingress on top of this; see Docker vs Kubernetes for how the two fit together.

The troubleshooting toolkit

When something cannot connect, work from the bottom up: is the name resolving, is the machine reachable, is the port open, is the service answering? These commands cover each step.

# Does the name resolve, and to what?
dig +short api.example.com

# Is the host reachable at all? (some hosts block ping)
ping -c 3 10.0.1.25

# What is listening on this machine, and on which address?
ss -tulpn

# Can I reach the port, and what does the service return?
curl -v https://api.example.com/health

# Where does the traffic stop along the way?
traceroute api.example.com

The curl -v output alone tells you a lot: whether DNS resolved, whether the TCP connection opened, whether TLS succeeded and which HTTP status came back. If you are still building comfort with commands like these, start with Linux for DevOps.

A realistic way to practise

Build a small cloud network with one public and one private subnet. Put a web server in the public subnet and a database in the private one. Allow port 443 to the web server from anywhere, and allow the database port only from the web server’s security group. Then break things on purpose: remove a route, close a port, change a DNS record, and fix each one using the commands above.

Networking questions come up often in interviews, usually as scenarios such as “a user cannot reach the site; what do you check?” Our list of DevOps interview questions includes several you can practise answering out loud.

Frequently asked questions

Do I need CCNA for a DevOps job?

No. CCNA goes deep into routers and switches, which most DevOps roles never touch. The concepts in this guide, applied in cloud and container settings, are what day-to-day DevOps work needs.

How long does it take to learn networking for DevOps?

Two to three weeks of steady practice covers the essentials if you already know basic Linux. Confidence comes from troubleshooting real problems, so expect to keep learning on the job.

What is the difference between a security group and a firewall?

A security group is a cloud provider’s firewall attached to individual resources, such as a server or load balancer. A traditional firewall usually sits at the edge of a network. Both filter traffic by address, port and protocol.

Why does my container work locally but not from another machine?

Usually the app is listening on 127.0.0.1 instead of 0.0.0.0, the port is not published, or a firewall or security group is blocking it. Check them in that order with ss, docker ps and curl.

Facebook
Twitter
LinkedIn
Email
Picture of Wandex
Wandex

DevOps Expert

ENroll Now

Fill up the form and we will contact you 

Get Free Course Syllabus & Counseling

Takes only 10 seconds to fill out!