Networking Basics for DevOps Engineers: Complete Guide

Networking Basics for DevOps Engineers

Introduction

Networking is the DevOps skill that hides in plain sight. Every deployment is a network operation: code travels over a network to a server, the server talks to a database over a network, the load balancer sends traffic over a network, and the user reaches all of it over a network. When something breaks, the break is usually in the network — a DNS name that does not resolve, a port that is closed, a firewall rule that blocks the one connection that matters — and the engineer who can diagnose it is the engineer who fixes the outage.

This guide covers the networking a DevOps engineer actually uses: the mental model of how data moves, IP addressing and subnets, DNS, ports and protocols, firewalls, load balancing, how containers and Kubernetes change the picture, and a troubleshooting workflow for the day something stops working. It assumes no networking background, but it moves fast — every concept is tied to a command you can run and a failure you will recognise. The Linux commands in this guide are covered in more depth in our Linux for DevOps Engineers guide, which is the companion to read first if the command line is still new to you.

One warning before the model: networking has more acronyms per square inch than any other part of this field, and most of them are not worth memorising in isolation. What matters is the small set of ideas that explain the rest — addresses, names, ports, routes and rules — and this guide is organised around those five ideas. Learn them, and the acronyms become labels for things you already understand.

The Mental Model — Layers, Packets and Addresses

The internet’s networking model is a stack of layers, and the point of the layers is that each one only has to solve one problem. The OSI model names seven layers, but in practice engineers use the simpler TCP/IP model with four: the link layer (the physical network — Ethernet, Wi-Fi), the internet layer (IP — getting packets from one machine to another), the transport layer (TCP and UDP — getting data reliably, or quickly, between applications), and the application layer (HTTP, DNS, SSH — what the applications actually say to each other).

A packet is the unit that travels through those layers. When your browser requests a web page, the application layer builds an HTTP request, the transport layer wraps it in a TCP segment with source and destination ports, the internet layer wraps that in an IP packet with source and destination addresses, and the link layer wraps that in a frame with hardware addresses and sends it onto the wire. Each router along the way unwraps the packet to the internet layer, reads the destination address, and forwards it towards its destination. The layers are why networking works at all: the application does not need to know about the wire, and the wire does not need to know about the application.

IPv4 and IPv6 are the two versions of the internet layer in use today. IPv4 addresses look like 203.0.113.10 — four numbers, each 0 to 255, separated by dots — and there are about 4.3 billion of them, which ran out years ago. That shortage is why Network Address Translation (NAT) exists: a router lets many private addresses share one public address, rewriting the source address as packets leave and restoring it as replies return. IPv6 addresses look like 2001:db8::1 — eight groups of hexadecimal numbers — and there are enough of them that NAT is unnecessary: every device can have its own public address. In practice, most DevOps work still happens on IPv4, with IPv6 running alongside it (dual-stack) on modern clouds. Know both formats, know that ::1 is the IPv6 loopback address (the equivalent of IPv4’s 127.0.0.1), and know that a service that binds only to IPv4 will not answer IPv6 connections — a common cause of “it works from here but not from there”.

IP Addressing, Subnets and CIDR

An IP address on its own is not enough: a device also needs to know which addresses are on its local network and which are elsewhere. That division is made by the subnet mask, written in CIDR notation — the slash number after the address, like /24 in 203.0.113.0/24. The number says how many bits of the address identify the network, and the rest identify the host inside it. A /24 network has 8 host bits, which gives 256 addresses (254 usable, after the network address and the broadcast address are set aside). A /16 has 65,536 addresses. A /32 is a single address — one host, no network — and it is how a firewall rule names a specific machine.

The CIDR sizes a DevOps engineer uses most often are a small set, and they are worth memorising:

CIDR Addresses Typical use
/32 1 A single host (firewall rule, route)
/28 16 (14 usable) A small subnet, e.g. a NAT gateway subnet
/24 256 (254 usable) A standard subnet in a VPC or VNet
/16 65,536 A whole VPC or VNet address space
/8 16,777,216 A large private range (10.0.0.0/8)

Private address ranges are the addresses reserved for internal networks, never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Your home network is almost certainly 192.168.x.x; a cloud VPC is usually 10.x.x.x. A public address is routable on the internet and must be unique globally; a private address only needs to be unique inside its own network. When two VPCs with overlapping private ranges need to connect — through peering, for example — the overlap is a problem that has to be solved before the connection works, which is why choosing a VPC address range is a decision to make carefully at the start, not to fix later.

DNS — How Names Become Addresses

DNS, the Domain Name System, is the phone book of the internet: it translates names like devopsjobupdates.com/ into IP addresses like 203.0.113.10. Almost every connection a DevOps engineer makes starts with a DNS lookup, and a surprising number of outages are DNS outages in disguise — the service is fine, but nobody can find it.

A DNS lookup is a chain. Your machine asks its configured resolver (usually your ISP’s, your company’s, or a public one like 1.1.1.1 or 8.8.8.8 — the address is in /etc/resolv.conf on Linux). The resolver asks the root servers, which point to the servers for the top-level domain (.com), which point to the authoritative name servers for the domain, which return the answer. The answer is cached at each step for the duration of its TTL (time to live), so a change to a DNS record does not take effect everywhere at once — it takes effect as caches expire, which is why a DNS change made five minutes ago may not be visible yet, and why a low TTL is set before a planned migration.

The record types a DevOps engineer meets most often are:

Record Purpose Example
A A name to an IPv4 address example.com → 203.0.113.10
AAAA A name to an IPv6 address example.com → 2001:db8::1
CNAME A name to another name (alias) www → example.com
MX Where mail for the domain goes example.com → mail server
TXT Arbitrary text (verification, SPF, DKIM) v=spf1 …
NS Which servers are authoritative example.com → ns1.provider.net
SOA The zone’s authority record Start of Authority
SRV A service at a host and port Service discovery
PTR An address back to a name (reverse DNS) 203.0.113.10 → example.com

Ports, Protocols and Firewalls

A port is a number from 0 to 65,535 that identifies an application on a machine. Ports below 1024 are the well-known ports, assigned to standard services and requiring administrative privileges to bind; ports above that are available to any application. The ports a DevOps engineer meets daily are a short list, and they are worth knowing by heart:

Port Protocol Service
22 TCP SSH
53 TCP/UDP DNS
80 TCP HTTP
443 TCP HTTPS
3306 TCP MySQL
5432 TCP PostgreSQL
6379 TCP Redis
8080 TCP HTTP alternate (proxies, applications)
8443 TCP HTTPS alternate
9090 TCP Prometheus
3000 TCP Grafana (default)

TCP and UDP are the two transport protocols, and the difference is reliability against speed. TCP establishes a connection, guarantees that data arrives in order, and retransmits what is lost — which is what HTTP, SSH and database connections need. UDP sends packets without a connection and without guarantees — faster, and the right choice for DNS queries, video streaming and some monitoring traffic, where a lost packet is cheaper than a retransmission. When a service does not answer, the first question is which protocol it uses: a TCP service that is down refuses the connection, while a UDP service that is down simply never replies, which makes UDP failures harder to diagnose.

A firewall is a set of rules that allow or deny traffic based on address, port and protocol. There are three layers of firewall in a typical cloud setup, and they all have to agree before a connection works: the cloud security group (AWS) or network security group (Azure) attached to the resource, the operating system firewall (ufw on Ubuntu, firewalld on Red Hat systems), and the application’s own binding — a service bound only to localhost cannot be reached from outside no matter what the firewall allows. The classic incident pattern is: the application is running, ss -tlnp shows it listening, curl localhost works on the server, but nothing can reach it from outside. That is almost always one of the three firewall layers, and checking them in order — security group, OS firewall, binding — finds it in minutes. The rule for all three is the same: open exactly the ports you need, and no more. Port 22 for SSH, 80 and 443 for a web server, the application’s own port only if something outside the server genuinely needs it — and never open a database port to the internet.

Load Balancing, Proxies and Ingress

A single server is a single point of failure. Load balancing is the answer: distribute traffic across several servers, so no one server carries the whole load, and a failed server is removed from rotation automatically. A load balancer is itself a network device — a virtual one, in the cloud — that accepts connections on a public address and forwards them to a pool of backend servers, checking their health and sending traffic only to the healthy ones.

There are two kinds, and the difference matters. A Layer 4 load balancer works at the transport layer: it forwards TCP connections based on address and port, without looking inside the traffic. It is fast, simple, and the right choice when the traffic is not HTTP — a database, a TCP service, or any protocol the load balancer does not need to understand. A Layer 7 load balancer works at the application layer: it understands HTTP, so it can route by URL path or hostname, terminate TLS, inject headers, and make routing decisions based on the request itself. An Application Load Balancer, an Application Gateway, or an ingress controller is Layer 7; a Network Load Balancer is Layer 4. The exam-style question is always the same: the requirement says path-based routing, so the answer is Layer 7; the requirement says raw TCP at high throughput, so the answer is Layer 4.

A reverse proxy sits in front of one or more servers and forwards requests to them, like a load balancer with one backend — nginx is the classic example, and it is also a load balancer, a TLS terminator and a static file server in one process. A forward proxy sits in front of clients and forwards their requests outward, usually for control or caching — a corporate proxy that all employee traffic passes through. The two are mirror images, and confusing them is the most common proxy mistake: the reverse proxy protects and distributes the servers, the forward proxy controls the clients.

Health checks are what make a load balancer useful rather than dangerous. The load balancer polls each backend — an HTTP request to a health endpoint, or a TCP connection to the port — and stops sending traffic to any backend that fails. Without health checks, a load balancer happily sends users to a dead server. The health endpoint should test what matters: not just that the process is running, but that it can reach its database and serve a request. A health check that returns 200 while the database is down is a health check that lies, and it is worse than no health check, because the load balancer believes the server is fine.

Networking in Containers and Kubernetes

Containers change networking by adding a layer of virtual networks on top of the host’s network, and Kubernetes adds another layer on top of that. The ideas are the same — addresses, ports, routes and rules — but there are more of them, and they are created and destroyed automatically.

In Docker, each container gets its own network namespace: its own interfaces, its own addresses, its own routing table. By default, containers on the same host join a bridge network with private addresses, and they can reach each other by container name — Docker provides DNS resolution inside the network, so http://api:8080 works from another container on the same network. A container’s port is not reachable from outside the host unless it is published (-p 8080:80 maps host port 8080 to container port 80), which is the Docker equivalent of a firewall rule: unpublished ports are invisible from outside. Our Docker Tutorial for Beginners covers bridge networks, port publishing and the host network mode, where a container shares the host’s network namespace directly.

In Kubernetes, the model is defined by three rules. First, every pod gets its own IP address, and pods can reach each other directly, without NAT. Second, a Service gives a set of pods a stable virtual IP and DNS name, and load-balances traffic between them — the Service’s address never changes even as pods are created and destroyed, which is why applications talk to Services, never to pod IPs. Third, a CNI plugin (Container Network Interface) implements the pod network — the choice of CNI decides how pod traffic is routed, whether network policies are enforced, and how the cluster connects to the outside world. NetworkPolicy resources are the firewall of Kubernetes: by default, all pods can talk to all pods, and a NetworkPolicy restricts that — allowing traffic only from specific pods, namespaces or ports. A cluster with no NetworkPolicies has no internal firewall at all, which is a finding worth reporting in any security review.

Ingress is the front door. An Ingress resource declares routing rules — hostname app.example.com and path /api go to the api Service — and an ingress controller (an nginx or similar process running in the cluster) implements them, terminating TLS with a certificate from a source like cert-manager. DNS inside the cluster is provided by CoreDNS, which resolves Service names (api.default.svc.cluster.local) for every pod, so a pod can reach a Service by name without knowing its address. When a pod cannot reach a Service, the diagnostic order is: can it resolve the name (CoreDNS), can it reach the Service’s address (kube-proxy and the CNI), and is a NetworkPolicy blocking it — in that order, because each step rules out a whole layer.

Troubleshooting Network Problems — a Workflow

Networking problems are diagnosed in order, from the top of the stack down, because each step rules out a whole class of causes. The workflow below is the one to follow when a service is unreachable, and it works on a server, in a container, or in a cluster.

1. Is it a name problem?

dig example.com +short
getent hosts example.com
cat /etc/resolv.conf

If dig fails, DNS is the problem — check the resolver in /etc/resolv.conf, check whether the name exists at all, and check the TTL if the record was recently changed. If dig works but getent fails, the problem is local resolution — check /etc/hosts for a stale override. If both work, the name is fine and the problem is lower down.

2. Is it a route problem?

ip addr show
ip route show
ping -c 4 203.0.113.10

ip addr show confirms the machine has an address; ip route show confirms it has a route to the destination, including a default gateway. ping tests basic IP reachability — but note that many servers block ICMP, so a failed ping does not prove the service is down, only that ICMP is blocked or the route is broken. A successful ping proves the route works; a failed ping is a clue, not a verdict.

3. Is it a port problem?

ss -tlnp
curl -v --max-time 5 https://example.com/health

On the server, ss -tlnp shows whether anything is listening on the expected port, and which process owns it. If nothing is listening, the service is not running or not bound to that port — check systemctl status and the service log before blaming the network. From the client, curl -v shows the connection attempt, the TLS handshake and the headers: a connection refused means nothing is listening or a firewall is rejecting it; a timeout means the packets are being dropped silently, which usually points to a firewall; a TLS error means the certificate is wrong or expired.

4. Is it a firewall problem?

sudo ufw status verbose
sudo firewall-cmd --list-all

Check the security group, the OS firewall, and the application’s binding, in that order. The classic pattern — curl localhost works on the server, nothing reaches it from outside — is almost always one of these three. Open exactly the ports you need, and test from outside after each change, because a rule that looks correct in the console and is not applied is the same as no rule at all.

5. Is it a path problem?

traceroute example.com
mtr --report example.com

traceroute and mtr show each hop between you and the destination, and where packets stop. A trace that dies at the first hop is a local gateway problem; one that dies halfway is a transit problem; one that reaches the destination but the service does not answer is an application problem, not a network problem. tcpdump captures the actual packets — the last resort, and the definitive one, because it shows what is really on the wire rather than what any tool claims is happening.

FAQ

What is the difference between a public and a private IP address?

A public address is routable on the internet and must be unique globally. A private address (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) is only unique inside its own network and is never routed on the public internet. Devices with private addresses reach the internet through NAT, which rewrites their address at the gateway.

What does CIDR notation mean?

The number after the slash says how many bits of the address identify the network. A /24 network has 256 addresses; a /16 has 65,536; a /32 is a single host. The smaller the number, the larger the network.

Why does DNS take time to update after I change a record?

Because resolvers cache answers for the duration of the TTL (time to live). A change is visible everywhere only after the old cached answers expire. Set a low TTL before a planned migration so the change propagates quickly.

What is the difference between a Layer 4 and a Layer 7 load balancer?

A Layer 4 load balancer forwards TCP connections based on address and port, without looking inside the traffic. A Layer 7 load balancer understands HTTP, so it can route by URL path or hostname, terminate TLS and inject headers. Path-based routing needs Layer 7; raw TCP at high throughput needs Layer 4.

How do I know if a port is open on a server?

On the server, ss -tlnp shows what is listening and on which port. From outside, curl -v to the service shows whether the connection succeeds, is refused (nothing listening or a firewall rejecting it) or times out (packets dropped, usually a firewall). Check the security group, the OS firewall and the application’s binding, in that order.

Conclusion

Networking is five ideas — addresses, names, ports, routes and rules — applied at every scale from a single container to a global cloud. An IP address says which machine, a DNS name says how to find it, a port says which application, a route says how packets get there, and a firewall rule says whether they are allowed. Everything else in this guide is those five ideas wearing different clothes: a Kubernetes Service is an address with a name, an Ingress is a Layer 7 load balancer, a NetworkPolicy is a firewall, and a VPC subnet is a network with a route table.

The skill that matters is not memorising the acronyms — it is the troubleshooting workflow: name, route, port, firewall, path, in that order, with the command that tests each step. Practise it on a real system: build the small VPC described in this guide, put a web server behind a load balancer, break the DNS record, close the port, add a firewall rule, and diagnose each failure with the commands above until the workflow is automatic. Then go deeper with our Linux for DevOps Engineers guide for the commands, our Docker Tutorial for Beginners for container networking, and our Kubernetes Tutorial for Beginners for the cluster networking that sits on top of it all.

Sources checked 29 Nov 2026: Kubernetes networking documentation at kubernetes.io (Services, Ingress, NetworkPolicy, CNI, CoreDNS, pod networking model — every pod gets its own IP, Services provide a stable virtual IP and DNS name); Docker networking documentation at docs.docker.com (bridge networks, container DNS by name, port publishing with -p, host network mode); Linux man-pages project (man7.org — ip, ss, dig, curl, ping, traceroute, tcpdump command syntax and flags, as cited in Batch 7); private address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and well-known port assignments per IANA conventions. NOT VERIFIED on an official page and therefore not stated as fact above: any claim about the performance of a specific load balancer product (not stated above); the exact default TTL values of any specific DNS provider (not stated above). External references: Kubernetes networking documentation · Docker networking documentation.

—

Scroll to Top