CompTIA Linux+ Practice Questions: Networking

26 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering Networking, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock Linux+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

Networking practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

Q1. What command lists open network ports?

  • A.netstat -tuln✓ Correct
  • B.ip addr show
  • C.route -n
  • D.ss -s
Explanation: netstat -tuln shows listening TCP/UDP ports. Learn more.

Q2. Which network bonding mode provides active-backup?

  • A.mode=0
  • B.mode=1✓ Correct
  • C.mode=4
  • D.mode=6
Explanation: Mode 1 (active-backup) uses one interface with failover. Learn more.

Q3. Which file defines network interface configurations in RHEL?

  • A./etc/network/interfaces
  • B./etc/sysconfig/network-scripts/ifcfg-*✓ Correct
  • C./etc/netplan/*.yaml
  • D./etc/systemd/network/*.network
Explanation: RHEL uses ifcfg files in /etc/sysconfig/network-scripts/. Learn more.

Q4. Which command tests connectivity to a port?

  • A.ping
  • B.telnet✓ Correct
  • C.traceroute
  • D.netstat
Explanation: telnet <host> <port> checks if a port is reachable. Learn more.

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

  • A.no_root_squash
  • B.root_squash✓ Correct
  • C.all_squash
  • D.anonuid
Explanation: root_squash maps remote root to nobody (default). Learn more.

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

  • A.All TCP sockets
  • B.Established TCP connections✓ Correct
  • C.Listening UDP ports
  • D.Closed connections
Explanation: ss replaces netstat; -t filters TCP, 'state established' shows active connections. Learn more.

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

  • A.Configure DNS servers✓ Correct
  • B.Set hostname
  • C.Define network routes
  • D.List NTP servers
Explanation: Specifies DNS resolver configuration. Learn more.

Q8. What does 'netstat -rn' display?

  • A.Routing table✓ Correct
  • B.Open ports
  • C.ARP cache
  • D.Interface statistics
Explanation: -r shows routing table, -n prevents DNS resolution. Learn more.

Q9. What is the purpose of 'nmcli'?

  • A.Manage NetworkManager✓ Correct
  • B.Monitor network traffic
  • C.Configure iptables
  • D.Analyze packets
Explanation: nmcli controls NetworkManager via command-line. Learn more.

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

  • A.Capture eth0 traffic✓ Correct
  • B.Install eth0 driver
  • C.Configure IP address
  • D.Test eth0 speed
Explanation: -i specifies interface for packet capture. Learn more.

Q11. Which file defines NFS exports?

  • A./etc/exports✓ Correct
  • B./etc/nfs.conf
  • C./etc/samba/smb.conf
  • D./etc/fstab
Explanation: /etc/exports lists directories shared via NFS. Learn more.

Q12. What does 'ip route show' display?

  • A.ARP cache
  • B.Routing table✓ Correct
  • C.Interface addresses
  • D.Network namespaces
Explanation: Shows kernel IP routing table. Learn more.

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

  • A.Define system hostname✓ Correct
  • B.Map IP to hostnames
  • C.Store remote hosts
  • D.Configure DNS
Explanation: Contains static hostname for the system. Learn more.

Q14. What does 'netstat -tuln' show?

  • A.Listening TCP/UDP ports✓ Correct
  • B.Established connections
  • C.Routing table
  • D.Interface statistics
Explanation: -t=TCP, -u=UDP, -l=listening, -n=numeric. Learn more.

Q15. Which command configures persistent static routes?

  • A.ip route add
  • B.route -n
  • C.nmcli connection modify✓ Correct
  • D.netplan apply
Explanation: nmcli stores routes in NetworkManager connections. Learn more.

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

  • A.DNS resolution management✓ Correct
  • B.Service dependency resolution
  • C.Network interface bonding
  • D.Package conflict resolution
Explanation: Manages DNS configurations and caching. Learn more.

Q17. What does 'netstat -s' display?

  • A.Summary statistics per protocol✓ Correct
  • B.Listening sockets
  • C.Routing tables
  • D.Interface errors
Explanation: Shows statistics for TCP, UDP, ICMP, etc. Learn more.

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

  • A.Active TCP connections✓ Correct
  • B.Listening ports
  • C.Closed sockets
  • D.UDP statistics
Explanation: Filters established TCP connections. Learn more.

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

  • A.ss -tuln✓ Correct
  • B.tar -czf
  • C.findmnt -r
  • D.crontab -e
Explanation: ss -tuln lists listening TCP and UDP sockets numerically. Learn more.

Q20. Which file commonly stores DNS resolver configuration?

  • A./etc/resolv.conf✓ Correct
  • B./etc/passwd
  • C./etc/shadow
  • D./etc/sudoers
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?

  • A.ip route✓ Correct
  • B.route print
  • C.net use
  • D.arp -d only
Explanation: ip route displays and manages routes on modern Linux systems. Learn more.

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

  • A./etc/hosts✓ Correct
  • B./etc/shadow
  • C./etc/fstab
  • D./etc/group-
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?

  • A.ip addr show✓ Correct
  • B.ifconfig /all
  • C.route print
  • D.net use
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?

  • A.dig INTERFACE
  • B.route INTERFACE
  • C.lsblk INTERFACE
  • D.ethtool INTERFACE✓ Correct
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?

  • A.ip route get 203.0.113.20✓ Correct
  • B.route add 203.0.113.20
  • C.traceroute -r only
  • D.nmcli route test
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?

  • A.hostnamectl dns
  • B.resolvectl status✓ Correct
  • C.systemctl dns-report
  • D.dig /etc/resolv.conf
Explanation: resolvectl status reports global and per-interface DNS configuration managed by systemd-resolved. Learn more.

More CompTIA Linux+ practice topics

Keep studying CompTIA Linux+

Full CompTIA Linux+ practice exam · CompTIA Linux+ study guide · All CompTIA practice questions

Last updated