Networking security

Beginner Level

Basic networking and security questions and answers for beginners.

Beginner Level

This section covers fundamental networking and security concepts commonly asked in entry-level interviews.

What is an IP address, and what are IPv4 and IPv6?

An IP address is the unique identifier that lets devices find and talk to each other on a network.

  • IPv4 — 32-bit addresses (192.168.1.10), ~4.3 billion possible addresses — exhausted globally, which is why private ranges + NAT exist
  • IPv6 — 128-bit addresses (2001:db8::1), an effectively infinite pool, built-in IPsec support, no more NAT gymnastics

DevOps relevance: VPC CIDR planning is IPv4-first in most shops (with IPv4 exhaustion driving subnet design), and dual-stack support is increasingly a deployment requirement.

What is the difference between private and public IP addresses?

  • Private IPs — reserved ranges that only work inside a local network: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Your VPC subnets use these
  • Public IPs — internet-routable, assigned by providers

The DevOps pattern this enables: everything internal (databases, app servers) gets private IPs; only load balancers/bastions get public ones. The follow-up to expect: "how do private-subnet servers reach the internet?" — via NAT gateway for outbound-only access.

What is a subnet, and what does a subnet mask do?

A subnet splits an IP range into smaller networks, so you can group and isolate devices. The subnet mask (or CIDR notation) defines where the "network part" ends and the "host part" begins:

  • 192.168.1.0/24 — mask says the first 24 bits are network → 256 addresses (254 usable hosts)
  • /16 → 65,536 addresses; /28 → 16 addresses

DevOps relevance: VPC/subnet sizing is a real planning task — e.g., a /16 VPC with /20 subnets per AZ leaves headroom, and each AZ needs its own subnet. The follow-up: "why can't two subnets overlap?" — routing becomes ambiguous.

What is DHCP, and how does it work?

DHCP automatically assigns IP configuration (address, gateway, DNS servers) to devices when they join a network — the four-step DORA exchange: Discover → Offer → Request → Acknowledge.

In cloud contexts, DHCP is implicit (AWS VPC assigns IPs from your subnet's CIDR), but the concept surfaces in interviews around static/elastic IPs (when do you need a fixed address?), lease times, and why containers get ephemeral IPs — which is exactly why service discovery/DNS exists.

What is DNS, and how does a lookup actually work?

DNS translates names (api.example.com) into IP addresses. A recursive lookup walks the hierarchy:

browser cache → OS cache → resolver (ISP/8.8.8.8)
  → root servers → .com TLD → authoritative nameserver → answer (cached with TTL)

Records worth knowing: A/AAAA (name→IP), CNAME (name→name), MX (mail), TXT (verification/SPF), SRV (service discovery).

DevOps relevance: DNS TTLs control rollout/failover speed (lower TTL before a DNS-based cutover), health-checked DNS records drive multi-region failover (Route 53), and "it works for me" DNS issues are usually caching — hence dig/nslookup debugging.

What is NAT?

Network Address Translation lets many private-IP devices share public IP(s) — the router rewrites source addresses and ports, keeping a state table to route replies back:

  • Why it exists — IPv4 scarcity; thousands of hosts behind one public IP
  • DevOps appearances — NAT gateway (private subnets → internet outbound, no inbound), SNAT/DNAT in Kubernetes port mappings, Docker's -p 8080:80 is a NAT rule

The follow-up to expect: "what's the difference between a NAT gateway and an internet gateway?" — IGW is the VPC's door to the internet; NAT gateway lets private subnets go out without letting anything in.

What is a firewall, and what types exist?

A firewall filters network traffic by rules — allow/deny based on source, destination, port, protocol, and sometimes content:

  • Packet filtering (L3/L4, stateless) — checks each packet independently (classic ACLs)
  • Stateful — tracks connections; replies to an allowed outbound flow are automatically allowed back
  • Proxy/application (L7) — understands protocols, filters by content
  • NGFW — stateful + application awareness + IDS/IPS integration

DevOps framing: cloud firewalls are everywhere and layered — AWS Security Groups (stateful, instance-level) + NACLs (stateless, subnet-level) + WAF (L7 on the edge). Know the stateful-vs-stateless distinction cold: it's the most common beginner firewall follow-up.

What is a VPN, and what types matter for DevOps?

A VPN creates an encrypted tunnel across untrusted networks so remote devices or networks behave as if they were local:

  • Remote-access VPN — individual users connecting into the corporate network
  • Site-to-site VPN — two networks joined permanently (your data center ↔ your VPC)

DevOps relevance: site-to-site VPN (or dedicated interconnect for scale) is how hybrid environments talk — on-prem services reachable from cloud workloads over private IPs. Alternatives to name: dedicated interconnects (Direct Connect/ExpressRoute) for high throughput, and identity-aware access (SSM Session Manager, BeyondCorp-style) replacing legacy VPN use cases.

What is SSH, and what makes it secure?

SSH is the encrypted protocol for remote server access — the terminal into every Linux server you'll operate.

Security mechanics worth knowing: asymmetric key exchange establishes the session, host keys prove the server is who it claims (that's what "host key changed" warnings mean), and authentication is by key pair (preferred) or password. DevOps practices: key-based auth only (disable passwords), passphrases on keys, known_hosts pinning in CI, and the modern shift toward short-lived certificates and brokered access (SSM Session Manager, Teleport) — no standing keys on servers at all.

What is the difference between HTTP and HTTPS?

  • HTTP — plaintext web traffic; anyone on the path can read or tamper with it
  • HTTPS — HTTP wrapped in TLS: encryption (nobody on the path reads it), integrity (tampering is detected), and authentication (the certificate proves the server's identity)

How HTTPS establishes trust: the server presents a certificate signed by a trusted CA, the client verifies the chain, then both derive session keys via asymmetric crypto and switch to fast symmetric encryption. DevOps angle: TLS everywhere is the default posture — certificates at load balancers, in ingress, between services (mTLS) — plus automation (Let's Encrypt/cert-manager) because manually renewed certs are a classic outage.

What is an SSL/TLS certificate, and what does it contain?

A TLS certificate is a signed document binding a domain name to a public key, vouched for by a Certificate Authority:

  • Contains: subject (domain), public key, issuer (CA), validity dates, SANs (additional domains)
  • Trust chain: your cert ← intermediate CA ← root CA (in the client's trust store)

Interview follow-ups to expect: "what happens when a certificate expires?" (browsers/API clients reject connections — a surprisingly common outage), "how do you automate renewal?" (ACME/Let's Encrypt + cert-manager in Kubernetes), and "where do certs live in your stack?" (LB, ingress, service mesh).

What is a load balancer, and what's the difference between Layer 4 and Layer 7?

A load balancer distributes traffic across multiple healthy servers — the component that makes horizontal scaling and zero-downtime deployments possible:

  • Layer 4 (transport) — routes by IP/port; protocol-agnostic, extremely fast; can't make content decisions (AWS NLB)
  • Layer 7 (application) — understands HTTP: routes by path/host/header, terminates TLS, adds cookies for session persistence (AWS ALB, NGINX)

The must-know feature: health checks — the balancer stops sending traffic to unhealthy targets, which is what turns "rolling deployment" and "auto-healing" from ideas into working mechanisms. Tie-in: X-Forwarded-For headers (preserving client IPs through a proxy) is a common L7 follow-up.

What is a reverse proxy, and why is Nginx everywhere?

A reverse proxy sits in front of your servers: clients talk to the proxy, which forwards requests to backends and returns responses:

  • What it provides — TLS termination, load distribution, caching, compression, request filtering, and hiding backend topology
  • Nginx ubiquity — one tool does reverse proxy + static file serving + rate limiting + (with Plus/OpenResty) more; it's the default ingress controller under the hood for Kubernetes NGINX ingress

The distinction interviewers check: forward proxy (sits in front of clients, e.g., corporate egress proxy) vs reverse proxy (in front of servers). Follow-up: "how does a reverse proxy differ from an API gateway?" — a gateway adds API-specific concerns (authN/authZ, quotas, developer portals).

What is a DMZ, and what's the cloud equivalent?

A DMZ is a buffer network segment hosting public-facing services, isolated from the internal network — if the web server is compromised, the attacker is still fenced off from internal systems:

internet → firewall → DMZ (web servers) → inner firewall → internal network

Cloud translation: public subnets (load balancers, bastions) vs private subnets (application, data tiers), with security groups as the inner firewall. The layered principle survives even though the topology term is legacy: public-facing components stay isolated from data-tier components, and traffic between zones is explicitly filtered.

What is a port, and what is port forwarding?

Ports (0–65535) let one IP host many services — each a numbered door: 22 SSH, 80/443 HTTP/S, 5432 Postgres, 6379 Redis. Port forwarding maps an external port to an internal host:port.

DevOps appearances: Docker -p 8080:80 (host 8080 → container 80), Kubernetes NodePort (30000–32767 range), cloud port mappings. Security note worth adding: expose only what must be public (443), bind admin interfaces to private networks, and know the ephemeral/client-port range (49152–65535) for firewall rules.

What is the difference between IDS and IPS?

  • IDS (Intrusion Detection System) — detects and alerts on malicious traffic; passive, out-of-band
  • IPS (Intrusion Prevention System) — sits inline and blocks the malicious traffic in real time

The trade-off to articulate: an IPS misfire breaks legitimate traffic (inline risk); an IDS never breaks anything but requires humans to act. Detection methods to name: signature-based (known patterns) vs anomaly-based (behavioral deviations). Modern placement: cloud-native equivalents (GuardDuty detection, WAF/Shield prevention) and Falco-style runtime detection inside Kubernetes.

What is a MAC address, and how does ARP work?

  • MAC address — the hardware identifier of a network interface (e.g., 00:1A:2B:3C:4D:5E), unique per NIC, used for delivery within a local network segment
  • ARP — maps IP → MAC: "who has 192.168.1.10? tell 192.168.1.5" — the answered mapping is cached

The layering story interviewers want: MAC addresses work at Layer 2 (local delivery between hops), IP addresses at Layer 3 (end-to-end routing); each router hop rewrites the Layer-2 frame but preserves the IP addresses. Security note: MAC filtering/spoofing is trivially bypassable (MACs are software-settable) — it's hygiene, not security.

What is port scanning, and why does a DevOps engineer care?

Port scanning probes a host to discover open ports/services — the first step of almost every external attack (and of every legitimate security audit):

  • Tools — nmap is the standard (nmap -sV target detects service versions)
  • Defender's perspective — scan your own estate regularly; every unexpected open port is either forgotten infrastructure or an intrusion; close what isn't needed (least-privilege networking applies to ports too)
  • The cloud framing — security groups are your first line; combine external scans with config auditing (what should be open vs what is open)

Permission note worth stating: only scan systems you own or have written authorization to test — scanning others' systems is illegal.

📢 Contribute & Stay Updated

💡 Want to contribute? We welcome contributions! If you have insights, new tools, or improvements, feel free to submit a pull request.

📌 How to Contribute?

  • Read the CONTRIBUTING.md guide.
  • Fix errors, add missing topics, or suggest improvements.
  • Submit a pull request with your updates.

🌍 Community & Support

🔗 GitHub: @NotHarshhaa 📝 Blog: ProDevOpsGuy 💬 Telegram Community: Join Here