InterviewTreedInterviewTreed

InterviewTreed Question Bank

Linux & Networking Interview Questions and Answers

Prepare for Linux administration, operating system fundamentals, networking protocols, troubleshooting, server management, and production infrastructure.

Total Questions

120

Beginner

40

Intermediate

39

Advanced

41

Beginner Questions

Foundational concepts, terminology, and core ideas.

Q1Linux commands

What is the Linux shell?

The shell interprets commands, expands variables, connects pipelines, and launches programs. It is separate from the Linux kernel.

Answer

The shell interprets commands, expands variables, connects pipelines, and launches programs. It is separate from the Linux kernel. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

echo "$SHELL"; pwd; whoami

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q2Linux commands

How do `pwd`, `ls`, and `cd` work?

`pwd` prints the current directory, `ls` lists entries, and `cd` changes the shell's working directory.

Answer

`pwd` prints the current directory, `ls` lists entries, and `cd` changes the shell's working directory. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

pwd
ls -lah
cd /var/log

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q3Linux commands

How do you read large log files?

Use `less` for paging, `head` for the beginning, and `tail -f` to follow appended log output.

Answer

Use `less` for paging, `head` for the beginning, and `tail -f` to follow appended log output. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

less app.log
head -n 20 app.log
tail -f app.log

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q4Linux commands

How do `grep`, `find`, and `locate` differ?

`grep` searches file contents, `find` searches the live directory tree, and `locate` searches an index that may be stale.

Answer

`grep` searches file contents, `find` searches the live directory tree, and `locate` searches an index that may be stale. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

grep -Rni 'error' ./logs
find /var/log -type f -name '*.log'
locate nginx.conf

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q5Linux commands

How do pipes and redirection work?

A pipe sends one command's output to another command. Redirection sends output or errors to files or other streams.

Answer

A pipe sends one command's output to another command. Redirection sends output or errors to files or other streams. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

grep -i error app.log | wc -l
command >out.txt 2>err.txt
command >>out.txt

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q6Linux commands

What are exit codes in Linux?

Programs conventionally return zero for success and nonzero for failure. Bash stores the last command's status in `$?`.

Answer

Programs conventionally return zero for success and nonzero for failure. Bash stores the last command's status in `$?`. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

mkdir demo && echo success
some_command
printf 'status=%s\n' "$?"

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q7Linux filesystem

How do absolute and relative paths differ?

Absolute paths start at `/`; relative paths are resolved from the current working directory.

Answer

Absolute paths start at `/`; relative paths are resolved from the current working directory. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

cd /var/log
printf '%s\n' /etc/hosts ../logs/app.log

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q8Linux filesystem

How do you copy, move, and remove files safely?

Use `cp`, `mv`, and `rm`. Inspect paths before destructive operations, especially with recursive deletion.

Answer

Use `cp`, `mv`, and `rm`. Inspect paths before destructive operations, especially with recursive deletion. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

cp -a app.conf app.conf.bak
mv old.txt new.txt
rm -- unwanted.txt

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q9Linux permissions

How do Linux file permissions work?

Read, write, and execute bits apply to owner, group, and others. Directory execute permission allows traversal.

Answer

Read, write, and execute bits apply to owner, group, and others. Directory execute permission allows traversal. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ls -l script.sh
chmod u+x script.sh
chmod 640 secrets.txt

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q10Linux users

What are users, groups, and sudo?

Processes and files have user and group identities. `sudo` permits approved commands to run with elevated privileges.

Answer

Processes and files have user and group identities. `sudo` permits approved commands to run with elevated privileges. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

id
getent group developers
sudo systemctl status ssh

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q12Processes

How do you list running processes?

Use `ps` for a snapshot, `top` for a live view, and `pgrep` to search process names or command lines.

Answer

Use `ps` for a snapshot, `top` for a live view, and `pgrep` to search process names or command lines. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

ps aux | head
top
pgrep -af nginx

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q13Processes

What is the difference between a process and a thread?

A process has its own virtual address space; threads within one process share memory and many resources.

Answer

A process has its own virtual address space; threads within one process share memory and many resources. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

ps -eLf | head
ps -o pid,ppid,nlwp,cmd -p <PID>

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q14Processes

How do you stop a process gracefully?

Send SIGTERM first so the process can clean up. Use SIGKILL only if graceful termination fails.

Answer

Send SIGTERM first so the process can clean up. Use SIGKILL only if graceful termination fails. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

kill -TERM <PID>
ps -p <PID>
kill -KILL <PID> # only if necessary

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q15Processes

How do foreground and background jobs work?

A shell can run jobs in the foreground or background and manage them with `jobs`, `fg`, and `bg`.

Answer

A shell can run jobs in the foreground or background and manage them with `jobs`, `fg`, and `bg`. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

long_command &
jobs
fg %1

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q16Processes

How do you inspect CPU and memory usage?

Combine system-wide views with per-process information; load average, CPU utilization, and memory pressure are different measurements.

Answer

Combine system-wide views with per-process information; load average, CPU utilization, and memory pressure are different measurements. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

free -h
vmstat 1 5
ps -eo pid,comm,%cpu,%mem --sort=-%mem | head

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q17Services

What is a systemd service?

A systemd unit describes a managed service and its lifecycle. `systemctl` inspects, starts, stops, and enables units.

Answer

A systemd unit describes a managed service and its lifecycle. `systemctl` inspects, starts, stops, and enables units. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

systemctl status nginx
sudo systemctl restart nginx
sudo systemctl enable nginx

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q18Networking

How do you inspect IP addresses and interfaces?

Use `ip address` and `ip link` to inspect interface addresses and link state.

Answer

Use `ip address` and `ip link` to inspect interface addresses and link state. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip address show
ip link show
ip -br address

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q19Networking

How do you inspect the routing table?

The routing table selects the next hop or interface for a destination. `ip route get` shows a route decision.

Answer

The routing table selects the next hop or interface for a destination. `ip route get` shows a route decision. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip route show
ip route get 1.1.1.1

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q20Networking

What is the difference between private and public IP addresses?

Private IPv4 ranges are intended for internal networks and are not globally routed on the public internet without translation or routing arrangements.

Answer

Private IPv4 ranges are intended for internal networks and are not globally routed on the public internet without translation or routing arrangements. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip -4 address
ip route show

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q21DNS

What does DNS do?

DNS maps names to records such as IPv4/IPv6 addresses, mail servers, aliases, and verification text.

Answer

DNS maps names to records such as IPv4/IPv6 addresses, mail servers, aliases, and verification text. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

getent hosts example.com
nslookup example.com

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q22DNS

How do you query DNS records with dig?

`dig` shows DNS answers, status flags, resolver information, and timing. Query the record type you need.

Answer

`dig` shows DNS answers, status flags, resolver information, and timing. Query the record type you need. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

dig example.com A
dig example.com AAAA
dig example.com MX

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q23HTTP

How do you test an HTTP endpoint with curl?

`curl` can inspect response headers, status codes, redirects, TLS, and request timing.

Answer

`curl` can inspect response headers, status codes, redirects, TLS, and request timing. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

curl -I https://example.com
curl -v https://example.com
curl -sS -o /dev/null -w '%{http_code}\n' https://example.com

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q24TCP/IP

What is the difference between TCP and UDP?

TCP provides a reliable ordered byte stream; UDP sends datagrams without built-in delivery or ordering guarantees.

Answer

TCP provides a reliable ordered byte stream; UDP sends datagrams without built-in delivery or ordering guarantees. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ss -tulpen
man 7 tcp
man 7 udp

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q25Networking

How do you check listening ports?

Use `ss` to inspect listening sockets and active connections; process details may require elevated privileges.

Answer

Use `ss` to inspect listening sockets and active connections; process details may require elevated privileges. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ss -lntp
ss -lunp
sudo ss -lntp

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q26Troubleshooting

How do you check whether a host is reachable?

Use multiple tests: route lookup, ping when allowed, DNS resolution, and a direct port or application request.

Answer

Use multiple tests: route lookup, ping when allowed, DNS resolution, and a direct port or application request. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ping -c 4 1.1.1.1
ip route get 1.1.1.1
curl -I --connect-timeout 3 https://example.com

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q27Logs

How do you inspect systemd logs?

Use `journalctl` to filter logs by service, boot, priority, and time window.

Answer

Use `journalctl` to filter logs by service, boot, priority, and time window. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

journalctl -u nginx --since '30 minutes ago'
journalctl -p warning -b

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q28Shell scripting

How do you quote variables safely in Bash?

Double-quote expansions to preserve spaces and prevent word splitting and glob expansion. Use single quotes for literal text.

Answer

Double-quote expansions to preserve spaces and prevent word splitting and glob expansion. Use single quotes for literal text. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

name='app server'
printf '%s\n' "$name"
mkdir -- "$name"

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q29Shell scripting

How do environment variables work?

Exported variables are inherited by child processes, often providing application configuration.

Answer

Exported variables are inherited by child processes, often providing application configuration. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

export APP_ENV=production
printf '%s\n' "$APP_ENV"
env | grep '^APP_ENV='

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q30Storage

What is the difference between df and du?

`df` reports filesystem usage; `du` estimates usage by files and directories. Both views help locate storage problems.

Answer

`df` reports filesystem usage; `du` estimates usage by files and directories. Both views help locate storage problems. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Syntax

df -h
du -sh /var/log/* 2>/dev/null | sort -h

# Diagnostic flow
Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q31Memory

How do you inspect memory and swap?

Use `free`, `/proc/meminfo`, and `swapon`; Linux also uses RAM for reclaimable filesystem caches.

Answer

Use `free`, `/proc/meminfo`, and `swapon`; Linux also uses RAM for reclaimable filesystem caches. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Syntax

free -h
head /proc/meminfo
swapon --show

# Diagnostic flow
Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q32Permissions

What is the principle of least privilege?

Give each user and service only the access it needs; check all path components and policy layers when diagnosing access failures.

Answer

Give each user and service only the access it needs; check all path components and policy layers when diagnosing access failures. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

id
namei -l /var/www/app/config.yml
stat -c '%A %U:%G %n' /var/www/app/config.yml

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q33Permissions

What is umask?

Umask removes permission bits from requested default modes when creating files and directories.

Answer

Umask removes permission bits from requested default modes when creating files and directories. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

umask
umask 027
touch sample.txt
mkdir sample-dir
ls -ld sample.txt sample-dir

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q34HTTP

What are the main HTTP status-code classes?

2xx indicates success, 3xx redirection, 4xx client-side errors, and 5xx server-side errors. Proxies can also generate responses.

Answer

2xx indicates success, 3xx redirection, 4xx client-side errors, and 5xx server-side errors. Proxies can also generate responses. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

curl -sS -o /dev/null -w '%{http_code}\n' https://example.com

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q35Networking

What is a CIDR prefix?

CIDR specifies how many leading address bits identify the network; for example, `/24` means 24 network bits in IPv4.

Answer

CIDR specifies how many leading address bits identify the network; for example, `/24` means 24 network bits in IPv4. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip -4 address show
ip route show
ipcalc 192.168.1.10/24 # if installed

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q36DNS

What are A, AAAA, CNAME, MX, and TXT records?

A is IPv4, AAAA is IPv6, CNAME is an alias, MX identifies mail routing, and TXT stores text values.

Answer

A is IPv4, AAAA is IPv6, CNAME is an alias, MX identifies mail routing, and TXT stores text values. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

dig example.com A
dig example.com AAAA
dig example.com MX
dig example.com TXT

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q37Troubleshooting

What is a runbook?

A runbook records repeatable diagnostic and recovery steps, expected outputs, escalation paths, and rollback procedures.

Answer

A runbook records repeatable diagnostic and recovery steps, expected outputs, escalation paths, and rollback procedures. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

systemctl status app
journalctl -u app --since '-15 min'
curl -fsS http://127.0.0.1:8080/health

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q38Networking

What is a default gateway?

The default gateway is used when no more specific route matches the destination.

Answer

The default gateway is used when no more specific route matches the destination. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip route show default
ip route get 8.8.8.8

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q39HTTP

What is the difference between HTTP and HTTPS?

HTTPS protects HTTP with TLS, providing encryption and server authentication when certificate validation succeeds.

Answer

HTTPS protects HTTP with TLS, providing encryption and server authentication when certificate validation succeeds. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

curl -Iv https://example.com
openssl s_client -connect example.com:443 -servername example.com </dev/null

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q40Networking

How do you use netcat to test a port?

`nc` can test whether a TCP port accepts a connection, but it does not prove the application protocol works correctly.

Answer

`nc` can test whether a TCP port accepts a connection, but it does not prove the application protocol works correctly. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

nc -vz example.com 443
nc -vz 127.0.0.1 8080

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.

Intermediate Questions

Implementation details, practical patterns, and common workflows.

Q41Processes

What do process states R, S, D, and Z mean?

R is running/runnable, S is interruptible sleep, D is uninterruptible sleep, and Z is a zombie awaiting reaping.

Answer

R is running/runnable, S is interruptible sleep, D is uninterruptible sleep, and Z is a zombie awaiting reaping. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

ps -eo pid,stat,wchan:24,comm | head -30

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q42Processes

How do common Linux signals differ?

SIGTERM requests termination, SIGKILL forces it, and SIGHUP is often used by daemons to reload configuration when supported.

Answer

SIGTERM requests termination, SIGKILL forces it, and SIGHUP is often used by daemons to reload configuration when supported. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

kill -l
kill -HUP <PID>
kill -TERM <PID>

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q43Processes

How do you find which process owns a port or file?

Use `lsof`, `fuser`, or `ss` to identify processes holding a file or listening socket.

Answer

Use `lsof`, `fuser`, or `ss` to identify processes holding a file or listening socket. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

sudo lsof -iTCP:8080 -sTCP:LISTEN
sudo fuser -v /var/log/app.log
sudo ss -lntp

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q44Processes

What are file descriptors?

File descriptors are per-process handles for files, sockets, pipes, and other I/O objects. Descriptor exhaustion can prevent new connections.

Answer

File descriptors are per-process handles for files, sockets, pipes, and other I/O objects. Descriptor exhaustion can prevent new connections. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

ls -l /proc/<PID>/fd
cat /proc/<PID>/limits
ulimit -n

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q45Permissions

What are ACLs?

ACLs provide additional per-user or per-group permissions beyond owner/group/other mode bits.

Answer

ACLs provide additional per-user or per-group permissions beyond owner/group/other mode bits. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

getfacl shared/
setfacl -m u:deploy:rwx shared/

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q46Storage

How do you diagnose disk-space versus inode exhaustion?

A filesystem can run out of data blocks or inodes. Check both, then find large files or huge numbers of small files.

Answer

A filesystem can run out of data blocks or inodes. Check both, then find large files or huge numbers of small files. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Syntax

df -h
df -i
du -xhd1 /var 2>/dev/null | sort -h

# Diagnostic flow
Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q47Services

How do you inspect systemd unit dependencies and logs?

Use `systemctl status`, `cat`, and `list-dependencies`, then inspect the unit journal around the failure time.

Answer

Use `systemctl status`, `cat`, and `list-dependencies`, then inspect the unit journal around the failure time. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

systemctl status app.service
systemctl cat app.service
systemctl list-dependencies app.service
journalctl -u app.service -b

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q48Services

What is the difference between systemctl reload and restart?

Reload asks a service to re-read configuration if supported; restart stops and starts the service process.

Answer

Reload asks a service to re-read configuration if supported; restart stops and starts the service process. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

sudo systemctl reload nginx
sudo systemctl restart nginx

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q49Networking

How does ARP work?

ARP resolves IPv4 addresses to link-layer addresses on a local network segment; IPv6 uses Neighbor Discovery instead.

Answer

ARP resolves IPv4 addresses to link-layer addresses on a local network segment; IPv6 uses Neighbor Discovery instead. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip neigh show
ip neigh get 192.168.1.1 dev eth0

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q50Networking

How do you troubleshoot a default gateway?

Check that the route exists, the gateway is reachable on the link, and the selected route is the one expected.

Answer

Check that the route exists, the gateway is reachable on the link, and the selected route is the one expected. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip route show default
ip route get 8.8.8.8
ip neigh show

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q51DNS

How do you inspect resolver configuration?

Check resolver settings and use `resolvectl`, `getent`, or `dig` to understand how names are resolved on the host.

Answer

Check resolver settings and use `resolvectl`, `getent`, or `dig` to understand how names are resolved on the host. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

cat /etc/resolv.conf
resolvectl status
getent ahosts example.com

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q52DNS

What do NXDOMAIN, SERVFAIL, and timeout mean?

NXDOMAIN means the name does not exist; SERVFAIL means the resolver failed to complete resolution; timeout means no timely response arrived.

Answer

NXDOMAIN means the name does not exist; SERVFAIL means the resolver failed to complete resolution; timeout means no timely response arrived. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

dig missing-name.example
dig @1.1.1.1 example.com A +time=2 +tries=1

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q53DNS

How do TTL and caching affect DNS troubleshooting?

TTL guides how long answers may be cached; recursive and local caches can make record changes appear gradually.

Answer

TTL guides how long answers may be cached; recursive and local caches can make record changes appear gradually. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

dig example.com A
dig @1.1.1.1 example.com A
dig +trace example.com

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q54HTTP

How do you inspect HTTP request and response headers?

Use curl verbose output or save response headers separately to inspect redirects, content types, cache headers, and server behavior.

Answer

Use curl verbose output or save response headers separately to inspect redirects, content types, cache headers, and server behavior. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

curl -sS -D headers.txt -o body.txt https://example.com
cat headers.txt

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q55HTTP/TLS

How do you inspect a TLS certificate?

Inspect the certificate chain, expiry, hostname, SNI selection, trust store, and system time.

Answer

Inspect the certificate chain, expiry, hostname, SNI selection, trust store, and system time. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

openssl s_client -connect host.example:443 -servername host.example -showcerts </dev/null
curl -v https://host.example

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q56HTTP

How do keep-alive and connection reuse help?

Persistent connections reduce repeated TCP and TLS setup costs. Clients and servers still enforce pool and idle-time limits.

Answer

Persistent connections reduce repeated TCP and TLS setup costs. Clients and servers still enforce pool and idle-time limits. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

curl -v https://example.com 2>&1 | grep -Ei 'connection|reuse|keep-alive'

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q57TCP/IP

What is the TCP three-way handshake?

TCP usually establishes a connection with SYN, SYN-ACK, and ACK before application data is exchanged.

Answer

TCP usually establishes a connection with SYN, SYN-ACK, and ACK before application data is exchanged. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

sudo tcpdump -ni any 'tcp port 443'

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q58TCP/IP

What are TCP retransmissions?

TCP retransmits data when acknowledgements do not arrive as expected. Loss, congestion, and path problems can increase retransmissions.

Answer

TCP retransmits data when acknowledgements do not arrive as expected. Loss, congestion, and path problems can increase retransmissions. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ss -ti dst <REMOTE_IP>
sudo tcpdump -ni eth0 host <REMOTE_IP> and tcp

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q59TCP/IP

What are MTU and path MTU discovery?

MTU is the maximum packet size for a link; path MTU discovery helps avoid packets too large for an end-to-end path.

Answer

MTU is the maximum packet size for a link; path MTU discovery helps avoid packets too large for an end-to-end path. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip link show
tracepath example.com
ping -M do -s 1400 -c 2 <DESTINATION>

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q60TCP/IP

What is NAT?

NAT rewrites addresses or ports as traffic passes through a gateway; it affects inbound reachability, connection tracking, and source identity.

Answer

NAT rewrites addresses or ports as traffic passes through a gateway; it affects inbound reachability, connection tracking, and source identity. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip route
sudo conntrack -L 2>/dev/null | head

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q61TCP/IP

What are ephemeral ports?

Ephemeral ports are temporary source ports for outgoing connections. High connection churn can exhaust local port or tracking capacity.

Answer

Ephemeral ports are temporary source ports for outgoing connections. High connection churn can exhaust local port or tracking capacity. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

cat /proc/sys/net/ipv4/ip_local_port_range
ss -s

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q62Troubleshooting

A service works locally but not remotely. What do you check?

Check the bind address, route, host/cloud firewall, container port publishing, and network path. Test loopback and host IP separately.

Answer

Check the bind address, route, host/cloud firewall, container port publishing, and network path. Test loopback and host IP separately. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ss -lntp
curl -v http://127.0.0.1:8080/
curl -v http://<HOST_IP>:8080/
sudo nft list ruleset

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q63Troubleshooting

DNS resolves but the application cannot connect. What next?

Test the resolved IP and port, then inspect routing, firewall rules, TCP, TLS, and HTTP behavior.

Answer

Test the resolved IP and port, then inspect routing, firewall rules, TCP, TLS, and HTTP behavior. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

dig service.example.com
nc -vz service.example.com 443
curl -v --connect-timeout 3 https://service.example.com

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q64Troubleshooting

How do you investigate connection refused?

A refusal often means no listener exists on that address/port or an intermediary actively rejected the connection.

Answer

A refusal often means no listener exists on that address/port or an intermediary actively rejected the connection. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ss -lntp
systemctl status app
nc -vz 127.0.0.1 8080

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q65Troubleshooting

How do you investigate a connection timeout?

A timeout may result from dropped packets, route failure, an overloaded endpoint, or an overly short deadline. Gather evidence at both ends.

Answer

A timeout may result from dropped packets, route failure, an overloaded endpoint, or an overly short deadline. Gather evidence at both ends. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ip route get <DEST_IP>
ss -tn state syn-sent
sudo tcpdump -ni any host <DEST_IP>

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q66Troubleshooting

How do you use tcpdump effectively?

Capture a narrow interface, host, port, and time window. Protect capture files because traffic may contain sensitive information.

Answer

Capture a narrow interface, host, port, and time window. Protect capture files because traffic may contain sensitive information. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

sudo tcpdump -ni eth0 -c 100 'host 192.0.2.10 and tcp port 443'
sudo tcpdump -ni any 'udp port 53'

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q67Troubleshooting

How do traceroute and tracepath help?

They reveal responding hops along a path, but routers may filter or rate-limit probes. Missing hops are not conclusive evidence of failure.

Answer

They reveal responding hops along a path, but routers may filter or rate-limit probes. Missing hops are not conclusive evidence of failure. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

traceroute example.com
tracepath example.com

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q68Troubleshooting

How do you diagnose packet loss and latency?

Measure repeated latency, inspect interface counters, and correlate network measurements with application metrics.

Answer

Measure repeated latency, inspect interface counters, and correlate network measurements with application metrics. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ping -c 20 <DESTINATION>
mtr -rwzc 50 <DESTINATION>
ip -s link show

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q69Networking

What are network namespaces?

A network namespace isolates interfaces, routes, firewall rules, and sockets for a group of processes; containers commonly use them.

Answer

A network namespace isolates interfaces, routes, firewall rules, and sockets for a group of processes; containers commonly use them. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip netns list
sudo ip netns exec <NS> ip address
sudo nsenter -t <PID> -n ip route

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q70Networking

What are bridges and veth pairs?

A bridge connects layer-2 interfaces. A veth pair behaves like a virtual Ethernet cable, often connecting a container namespace to a host bridge.

Answer

A bridge connects layer-2 interfaces. A veth pair behaves like a virtual Ethernet cable, often connecting a container namespace to a host bridge. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip -br link
bridge link
ip link show type veth

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q71Security

How do you inspect nftables firewall rules?

List active rules and review input, output, and forwarding chains, policies, and counters before changing anything.

Answer

List active rules and review input, output, and forwarding chains, policies, and counters before changing anything. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

sudo nft list ruleset
sudo nft list ruleset -a

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q72Security

How do you troubleshoot SSH securely?

Use verbose client output, verify host keys, inspect server configuration, and retain least-privilege access.

Answer

Use verbose client output, verify host keys, inspect server configuration, and retain least-privilege access. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

ssh -v user@host
ssh-keygen -t ed25519
sshd -T | grep -E 'passwordauthentication|permitrootlogin'

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q73Scripting

How do you write a safer Bash script?

Quote variables, validate inputs, make failure behavior explicit, and consider strict-mode options and ShellCheck.

Answer

Quote variables, validate inputs, make failure behavior explicit, and consider strict-mode options and ShellCheck. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

#!/usr/bin/env bash
set -Eeuo pipefail
file=${1:?usage: script FILE}
[[ -f "$file" ]] || { echo 'not a file' >&2; exit 1; }

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q74Performance

What does Linux load average mean?

Load average estimates tasks running or waiting for CPU or uninterruptible I/O. It is not a direct CPU percentage.

Answer

Load average estimates tasks running or waiting for CPU or uninterruptible I/O. It is not a direct CPU percentage. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

uptime
nproc
top

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q75Performance

How do you investigate high disk I/O wait?

Inspect device latency and utilization, blocked tasks, application I/O patterns, and storage-provider metrics.

Answer

Inspect device latency and utilization, blocked tasks, application I/O patterns, and storage-provider metrics. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

iostat -xz 1 5
iotop -o  # if installed
ps -eo pid,stat,wchan:24,comm | grep ' D '

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q76Services

Why might shell environment variables be missing from a systemd service?

Systemd constructs a service environment from unit settings and configured files, not necessarily the interactive shell's exports.

Answer

Systemd constructs a service environment from unit settings and configured files, not necessarily the interactive shell's exports. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

systemctl show app.service -p Environment
systemctl cat app.service

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q77Networking

How do you troubleshoot IPv4 versus IPv6 differences?

Compare A/AAAA records, addresses, routes, firewall rules, listener bindings, and family-specific requests.

Answer

Compare A/AAAA records, addresses, routes, firewall rules, listener bindings, and family-specific requests. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

getent ahosts example.com
ip -6 address
ip -6 route
curl -4 -I https://example.com
curl -6 -I https://example.com

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q78HTTP

What is a reverse proxy?

A reverse proxy accepts client traffic and forwards requests to upstream applications, often terminating TLS and routing requests.

Answer

A reverse proxy accepts client traffic and forwards requests to upstream applications, often terminating TLS and routing requests. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

curl -v https://public.example.com
curl -v http://127.0.0.1:8080/health
journalctl -u nginx --since '-10 min'

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q79Logs

How do you correlate logs across services?

Use consistent timestamps, request IDs, trace IDs, and structured fields to follow one request across components.

Answer

Use consistent timestamps, request IDs, trace IDs, and structured fields to follow one request across components. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

journalctl -u api --since '-10 min' | grep 'request_id=abc123'
grep 'abc123' /var/log/nginx/access.log

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.

Advanced Questions

Architecture, optimization, and design trade-offs.

Q80Architecture

How would you troubleshoot an end-to-end request path?

Trace DNS, routing, TCP, TLS, HTTP, proxy routing, application work, and downstream dependencies. Compare evidence from each layer.

Answer

Trace DNS, routing, TCP, TLS, HTTP, proxy routing, application work, and downstream dependencies. Compare evidence from each layer. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

Client -> DNS -> Route/NAT -> Firewall -> TCP -> TLS -> Proxy -> App -> Database
Collect timestamps, status codes, and request IDs at each hop.

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q81TCP/IP

What is TCP TIME_WAIT and should it be removed?

TIME_WAIT helps prevent delayed packets from corrupting later connections. It is usually normal; inspect connection churn before changing kernel setti

Answer

TIME_WAIT helps prevent delayed packets from corrupting later connections. It is usually normal; inspect connection churn before changing kernel settings. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ss -tan state time-wait | wc -l
ss -s

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q82TCP/IP

What are SYN backlog and accept queue issues?

The SYN backlog tracks incomplete handshakes; the accept queue holds established connections waiting for the application to accept them.

Answer

The SYN backlog tracks incomplete handshakes; the accept queue holds established connections waiting for the application to accept them. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ss -lnt
nstat -az | grep -Ei 'ListenOverflows|ListenDrops|Syncookies'

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q83TCP/IP

How does TCP congestion control affect throughput?

Congestion control adjusts sending rate based on path feedback. RTT, loss, and bandwidth-delay product influence throughput.

Answer

Congestion control adjusts sending rate based on path feedback. RTT, loss, and bandwidth-delay product influence throughput. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

sysctl net.ipv4.tcp_congestion_control
ss -ti dst <REMOTE_IP>

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q84TCP/IP

How do you diagnose an MTU black hole?

Look for connections that establish but stall on larger packets; test packet sizes and inspect ICMP Packet Too Big or fragmentation-needed messages.

Answer

Look for connections that establish but stall on larger packets; test packet sizes and inspect ICMP Packet Too Big or fragmentation-needed messages. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

tracepath <DESTINATION>
ping -M do -s 1400 -c 3 <DESTINATION>
sudo tcpdump -ni any 'icmp or icmp6'

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q85TCP/IP

What is connection-tracking exhaustion?

Conntrack stores flow state for firewall/NAT decisions. If its table fills, new connections can fail even when the application is healthy.

Answer

Conntrack stores flow state for firewall/NAT decisions. If its table fills, new connections can fail even when the application is healthy. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

sysctl net.netfilter.nf_conntrack_count 2>/dev/null
sysctl net.netfilter.nf_conntrack_max 2>/dev/null
sudo conntrack -S 2>/dev/null

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q86DNS

How would you troubleshoot intermittent DNS failures?

Compare resolver latency, error rates, TTLs, upstream health, client caches, and UDP/TCP behavior. Query the configured and authoritative paths.

Answer

Compare resolver latency, error rates, TTLs, upstream health, client caches, and UDP/TCP behavior. Query the configured and authoritative paths. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

for i in {1..5}; do dig +time=2 +tries=1 api.example.com; done
dig +trace api.example.com

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q87DNS

Why might dig work while an application name lookup fails?

Applications may use NSS, search domains, caches, proxy-specific resolution, or container resolver configuration that differs from direct DNS queries.

Answer

Applications may use NSS, search domains, caches, proxy-specific resolution, or container resolver configuration that differs from direct DNS queries. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

getent hosts api.internal
cat /etc/nsswitch.conf
cat /etc/resolv.conf

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q88TLS

How do you diagnose TLS hostname or certificate errors?

Inspect certificate chain, expiry, SAN hostnames, SNI selection, trust store, and system time.

Answer

Inspect certificate chain, expiry, SAN hostnames, SNI selection, trust store, and system time. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

openssl s_client -connect host.example:443 -servername host.example -showcerts </dev/null
curl -v https://host.example

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q89TLS

What are SNI and ALPN?

SNI tells the server which hostname the client wants; ALPN negotiates the application protocol such as HTTP/1.1 or HTTP/2.

Answer

SNI tells the server which hostname the client wants; ALPN negotiates the application protocol such as HTTP/1.1 or HTTP/2. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

openssl s_client -connect example.com:443 -servername example.com -alpn 'h2,http/1.1' </dev/null

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q90HTTP

How do you diagnose a 502 or 504 from a reverse proxy?

Check proxy logs, upstream address and port, DNS, TLS, connection refusals, timeout settings, and upstream health.

Answer

Check proxy logs, upstream address and port, DNS, TLS, connection refusals, timeout settings, and upstream health. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Syntax

journalctl -u nginx --since '-10 min'
curl -v --connect-timeout 2 http://<UPSTREAM_IP>:<PORT>/health
ss -tnp

# Diagnostic flow
Client -> DNS -> TCP -> TLS (HTTPS) -> HTTP request -> Proxy/server -> Response

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q91Containers

How do cgroups affect resource diagnosis?

Cgroups constrain and account for CPU, memory, and I/O. A container can be throttled or OOM-killed while the host appears healthy.

Answer

Cgroups constrain and account for CPU, memory, and I/O. A container can be throttled or OOM-killed while the host appears healthy. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

cat /sys/fs/cgroup/cpu.max 2>/dev/null
cat /sys/fs/cgroup/memory.max 2>/dev/null
cat /sys/fs/cgroup/memory.events 2>/dev/null

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q92Containers

How do you investigate CPU throttling in a container?

Inspect CPU quota and throttling counters and correlate them with request latency and workload patterns.

Answer

Inspect CPU quota and throttling counters and correlate them with request latency and workload patterns. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

cat /sys/fs/cgroup/cpu.max 2>/dev/null
cat /sys/fs/cgroup/cpu.stat 2>/dev/null

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q93Memory

How do you investigate an OOM kill?

Inspect kernel logs, cgroup memory events, process memory, and application allocation patterns; identify whether host or container limits were reached

Answer

Inspect kernel logs, cgroup memory events, process memory, and application allocation patterns; identify whether host or container limits were reached. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Syntax

journalctl -k --since '-1 hour' | grep -i -E 'oom|killed process'
cat /sys/fs/cgroup/memory.events 2>/dev/null
free -h

# Diagnostic flow
Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q94Security

How do Linux capabilities differ from root?

Capabilities split some privileged operations into smaller permissions. Grant only those required and understand their security implications.

Answer

Capabilities split some privileged operations into smaller permissions. Grant only those required and understand their security implications. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

getcap -r /usr/bin 2>/dev/null | head
capsh --print 2>/dev/null

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q95Security

How can SELinux or AppArmor cause access failures?

Mandatory access controls can deny operations even when Unix mode bits allow them. Inspect denial logs and policy state before weakening enforcement.

Answer

Mandatory access controls can deny operations even when Unix mode bits allow them. Inspect denial logs and policy state before weakening enforcement. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

getenforce 2>/dev/null
sudo ausearch -m AVC -ts recent 2>/dev/null
sudo aa-status 2>/dev/null

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q96Security

How do you safely change firewall rules on a remote host?

Record current rules, make a narrow change, maintain a recovery path, test from a separate session, and verify persistence.

Answer

Record current rules, make a narrow change, maintain a recovery path, test from a separate session, and verify persistence. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

sudo nft list ruleset
# Apply a scoped rule; keep console access or timed rollback available.

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q97Routing

What is policy-based routing?

Policy routing chooses tables using rules such as source address, packet mark, or interface, not only destination prefixes.

Answer

Policy routing chooses tables using rules such as source address, packet mark, or interface, not only destination prefixes. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip rule show
ip route show table all
ip route get <DEST_IP> from <SOURCE_IP>

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q98Routing

What is reverse-path filtering?

Reverse-path filtering checks whether a packet's source would be routed back through an expected interface; strict mode can conflict with asymmetric r

Answer

Reverse-path filtering checks whether a packet's source would be routed back through an expected interface; strict mode can conflict with asymmetric routing. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

sysctl net.ipv4.conf.all.rp_filter
sysctl net.ipv4.conf.default.rp_filter

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q99Routing

How do you troubleshoot asymmetric routing?

Compare forward and return routes, policy rules, firewall state, and packet captures on both ends.

Answer

Compare forward and return routes, policy rules, firewall state, and packet captures on both ends. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip route get <CLIENT_IP>
ip rule show
sudo tcpdump -ni any host <CLIENT_IP>

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q101Networking

How does a Linux bridge learn MAC addresses?

A bridge learns source MAC addresses on incoming ports and uses its forwarding database to direct frames.

Answer

A bridge learns source MAC addresses on incoming ports and uses its forwarding database to direct frames. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

bridge link show
bridge fdb show br br0

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q102Networking

How do VLANs affect troubleshooting?

VLAN tags and port membership determine layer-2 broadcast domains. A tag mismatch can isolate a host despite link being up.

Answer

VLAN tags and port membership determine layer-2 broadcast domains. A tag mismatch can isolate a host despite link being up. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip -d link show
bridge vlan show

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q103Containers

How do you debug a container network namespace?

Inspect routes, listeners, DNS, MTU, and the host-side veth/bridge from both the container and host namespaces.

Answer

Inspect routes, listeners, DNS, MTU, and the host-side veth/bridge from both the container and host namespaces. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ip netns exec <NS> ip route
nsenter -t <PID> -n ss -lntp
bridge link

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q104Observability

What is eBPF used for in network troubleshooting?

eBPF-based tools can observe kernel events, packet drops, latency, and flow behavior when supported by the kernel and permissions.

Answer

eBPF-based tools can observe kernel events, packet drops, latency, and flow behavior when supported by the kernel and permissions. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

sudo bpftool prog show 2>/dev/null
# Use a supported eBPF observability tool for the environment.

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q105Observability

How can strace diagnose a failing process?

`strace` records system calls and signals, revealing missing files, permission errors, blocked calls, and connection failures.

Answer

`strace` records system calls and signals, revealing missing files, permission errors, blocked calls, and connection failures. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

strace -f -tt -T -p <PID>
strace -f -o trace.log ./app

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q106Observability

How do you inspect socket queues and TCP details?

`ss` displays socket state, queue sizes, timers, and TCP metrics; sample repeatedly and correlate with application latency.

Answer

`ss` displays socket state, queue sizes, timers, and TCP metrics; sample repeatedly and correlate with application latency. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ss -s
ss -lnt
ss -ti

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q107Observability

How do you inspect kernel networking messages?

Read kernel logs for link changes, driver errors, dropped traffic reports, and other subsystem messages.

Answer

Read kernel logs for link changes, driver errors, dropped traffic reports, and other subsystem messages. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

journalctl -k --since '-30 min'
dmesg -T | tail -100

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q108Reliability

How would you design an on-call network troubleshooting checklist?

Start with impact and scope, then test DNS, route, socket, TLS/HTTP, logs, metrics, and dependencies. Preserve evidence before remediation.

Answer

Start with impact and scope, then test DNS, route, socket, TLS/HTTP, logs, metrics, and dependencies. Preserve evidence before remediation. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

1. Scope and timestamp
2. DNS: getent/dig
3. Route: ip route get
4. Socket: ss/nc
5. TLS/HTTP: curl/openssl
6. Logs/metrics/capture
7. Mitigate and verify

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q109Reliability

How do you distinguish network latency from application latency?

Measure DNS, TCP connect, TLS, time to first byte, total response time, server traces, and downstream timing.

Answer

Measure DNS, TCP connect, TLS, time to first byte, total response time, server traces, and downstream timing. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

curl -sS -o /dev/null -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer} total=%{time_total}\n' https://example.com

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q110Reliability

What is a safe mitigation strategy during a network incident?

Prefer reversible, scoped actions with success criteria; communicate impact, preserve evidence, and validate recovery and side effects.

Answer

Prefer reversible, scoped actions with success criteria; communicate impact, preserve evidence, and validate recovery and side effects. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ip route get <DEST_IP>
curl -fsS --max-time 3 https://service.example/health
journalctl -u service --since '-5 min'

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q111Networking

How can NIC offloading affect packet captures?

GRO, GSO, and checksum offload can make host captures differ from wire-level packet boundaries or checksum appearance.

Answer

GRO, GSO, and checksum offload can make host captures differ from wire-level packet boundaries or checksum appearance. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ethtool -k eth0
sudo tcpdump -ni eth0 -s 0 -w capture.pcap

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q112Networking

How do you troubleshoot interface errors?

Compare link state, driver logs, interface counters, speed/duplex, and peer-side counters before changing configuration.

Answer

Compare link state, driver logs, interface counters, speed/duplex, and peer-side counters before changing configuration. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip -s link show dev eth0
ethtool eth0 2>/dev/null
journalctl -k --since '-1 hour' | grep -i eth0

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q113Processes

How do file descriptor limits cause service failures?

Per-process or system-wide descriptor exhaustion can prevent opening files or sockets; logs may show EMFILE or ENFILE.

Answer

Per-process or system-wide descriptor exhaustion can prevent opening files or sockets; logs may show EMFILE or ENFILE. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Syntax

cat /proc/<PID>/limits
ls /proc/<PID>/fd | wc -l
ulimit -n

# Diagnostic flow
User/service manager -> Process -> System calls -> Kernel -> Resource or exit status

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q114Performance

A service has high latency but low CPU. What do you investigate?

Investigate blocking I/O, lock contention, downstream latency, queueing, DNS, connection pools, throttling, and packet loss.

Answer

Investigate blocking I/O, lock contention, downstream latency, queueing, DNS, connection pools, throttling, and packet loss. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Syntax

ss -s
iostat -xz 1 3
vmstat 1 5
journalctl -u app --since '-10 min'

# Diagnostic flow
User/Client -> Command or tool -> Linux subsystem -> Observed result -> Next diagnostic step

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q115Routing

What is a route metric?

A route metric helps choose among comparable routes; prefix specificity and policy rules also affect route selection.

Answer

A route metric helps choose among comparable routes; prefix specificity and policy rules also affect route selection. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

ip route show
ip route get <DEST_IP>

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q116Security

How do you verify services are not unintentionally exposed?

Inventory listening sockets, identify bind addresses and processes, and compare them with intended exposure and firewall policy.

Answer

Inventory listening sockets, identify bind addresses and processes, and compare them with intended exposure and firewall policy. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Syntax

sudo ss -lntup
sudo nft list ruleset

# Diagnostic flow
User/process identity -> Mode bits/ACL/policy -> Kernel access check -> Allow or deny

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q117DNS

How do you investigate split-horizon DNS?

Split-horizon DNS intentionally returns different answers based on resolver or client network; query each intended resolver explicitly.

Answer

Split-horizon DNS intentionally returns different answers based on resolver or client network; query each intended resolver explicitly. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

dig internal.example.com
dig @<INTERNAL_DNS> internal.example.com A
dig @<EXTERNAL_DNS> internal.example.com A

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q118Storage

A disk is full but du cannot account for the space. What do you check?

Check deleted-but-open files, mount points, snapshots, reserved blocks, and filesystem-specific usage.

Answer

Check deleted-but-open files, mount points, snapshots, reserved blocks, and filesystem-specific usage. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Syntax

df -h
sudo lsof +L1 2>/dev/null | head
findmnt

# Diagnostic flow
Process -> Filesystem/memory subsystem -> Kernel accounting -> Metrics/logs

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q119DNS

A hostname resolves to the wrong server after deployment. What do you check?

Check authoritative records, TTL, recursive caches, local overrides, split DNS, proxy caches, and A/AAAA records.

Answer

Check authoritative records, TTL, recursive caches, local overrides, split DNS, proxy caches, and A/AAAA records. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Syntax

dig +trace app.example.com
dig app.example.com A
getent hosts app.example.com
cat /etc/hosts

# Diagnostic flow
Application -> NSS/resolver -> Recursive DNS -> Authoritative DNS -> Record answer

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.
Q120IPv6

How do you troubleshoot a service that fails only over IPv6?

Compare AAAA records, IPv6 addresses/routes, firewall policy, MTU, listener bindings, and IPv6-specific requests.

Answer

Compare AAAA records, IPv6 addresses/routes, firewall policy, MTU, listener bindings, and IPv6-specific requests. Example workflow: run the command against the affected host, compare the observed output with a known-good host or expected state, and narrow the fault to one layer before changing configuration. Diagram: Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Syntax

curl -4 -v https://service.example
curl -6 -v https://service.example
ip -6 route show
ss -lntp

# Diagnostic flow
Process -> Socket -> Route lookup -> Interface/gateway -> Network -> Destination

Key Points

  • Run commands with the least privilege needed and protect sensitive output.
  • Compare evidence before and after a change; avoid destructive fixes without a rollback.
  • Separate DNS, routing, transport, TLS/HTTP, process, and resource symptoms.

Share this question bank

Send this page to someone preparing for an interview.