CompTIA Linux+ Practice Questions: Networking

26 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering Networking. Each question shows the correct answer and a clear explanation. Ready for the real thing? Take the full timed quiz below.

🚀 Take the full CompTIA Linux+ quiz 📘 CompTIA Linux+ study guide

Q1. What command lists open network ports?

Explanation: netstat -tuln shows listening TCP/UDP ports. Learn more.

Q2. Which network bonding mode provides active-backup?

Explanation: Mode 1 (active-backup) uses one interface with failover. Learn more.

Q3. Which file defines network interface configurations in RHEL?

Explanation: RHEL uses ifcfg files in /etc/sysconfig/network-scripts/. Learn more.

Q4. Which command tests connectivity to a port?

Explanation: telnet <host> <port> checks if a port is reachable. Learn more.

Q5. Which option in /etc/exports enables root squash?

Explanation: root_squash maps remote root to nobody (default). Learn more.

Q6. What does 'ss -t state established' show?

Explanation: ss replaces netstat; -t filters TCP, 'state established' shows active connections. Learn more.

Q7. What is the purpose of /etc/resolv.conf?

Explanation: Specifies DNS resolver configuration. Learn more.

Q8. What does 'netstat -rn' display?

Explanation: -r shows routing table, -n prevents DNS resolution. Learn more.

Q9. What is the purpose of 'nmcli'?

Explanation: nmcli controls NetworkManager via command-line. Learn more.

Q10. What is the purpose of 'tcpdump -i eth0'?

Explanation: -i specifies interface for packet capture. Learn more.

Q11. Which file defines NFS exports?

Explanation: /etc/exports lists directories shared via NFS. Learn more.

Q12. What does 'ip route show' display?

Explanation: Shows kernel IP routing table. Learn more.

Q13. What is the purpose of '/etc/hostname'?

Explanation: Contains static hostname for the system. Learn more.

Q14. What does 'netstat -tuln' show?

Explanation: -t=TCP, -u=UDP, -l=listening, -n=numeric. Learn more.

Q15. Which command configures persistent static routes?

Explanation: nmcli stores routes in NetworkManager connections. Learn more.

Q16. What is the purpose of 'systemd-resolved'?

Explanation: Manages DNS configurations and caching. Learn more.

Q17. What does 'netstat -s' display?

Explanation: Shows statistics for TCP, UDP, ICMP, etc. Learn more.

Q18. What does 'ss -o state established' show?

Explanation: Filters established TCP connections. Learn more.

Q19. Which command shows listening TCP and UDP sockets on modern Linux systems?

Explanation: ss -tuln lists listening TCP and UDP sockets numerically. Learn more.

Q20. Which file commonly stores DNS resolver configuration?

Explanation: /etc/resolv.conf contains resolver settings such as nameserver entries on many Linux systems. Learn more.

Q21. Which command displays routing table information using the iproute2 toolset?

Explanation: ip route displays and manages routes on modern Linux systems. Learn more.

Q22. Which file contains local hostname-to-IP mappings?

Explanation: /etc/hosts provides local name resolution mappings before or alongside DNS. Learn more.

Q23. Which command displays network interfaces and IP addresses using iproute2?

Explanation: ip addr show displays Linux network interface addresses. Learn more.

Q24. Which command displays the negotiated speed, duplex mode, and link state of an Ethernet interface?

Explanation: ethtool queries and configures Ethernet interface properties, including link detection, negotiated speed, and duplex mode. Learn more.

Q25. Which command shows the exact route the kernel would use to reach 203.0.113.20?

Explanation: ip route get performs a route lookup and reports the selected next hop, interface, and source address without sending traffic. Learn more.

Q26. On a system using systemd-resolved, which command displays active DNS servers and per-link resolver settings?

Explanation: resolvectl status reports global and per-interface DNS configuration managed by systemd-resolved. Learn more.

More CompTIA Linux+ practice topics