Network

1.9 Identify common features and tools of the Linux client/desktop operating system.

📘CompTIA A+ Core 2 (220-1202)


Linux Network Tools

Linux has several built-in commands to check, manage, and troubleshoot network connectivity. These are essential for system administrators and are part of the exam objectives.


1. ip Command

The ip command is used to view and manage network interfaces, IP addresses, and routes. It’s the modern replacement for the older ifconfig.

Basic usage:

  • Show all network interfaces and their IP addresses:
ip addr
  • Bring an interface up (enable it):
sudo ip link set eth0 up
  • Bring an interface down (disable it):
sudo ip link set eth0 down
  • Show routing table (how traffic is sent):
ip route

IT environment use case:

  • Checking whether a server’s interface has a correct IP address before connecting to the network.
  • Adding a static IP address to a Linux server.

2. ping Command

The ping command is used to check if a device is reachable over the network and to measure response time.

Basic usage:

ping 192.168.1.1

or using a hostname:

ping google.com
  • Sends packets to the target and shows whether the target responds and how fast.

Common options:

  • -c 4 → send only 4 packets:
ping -c 4 google.com

IT environment use case:

  • Checking if a website or server is online.
  • Testing connectivity between two machines in a network.

3. curl Command

The curl command is used to transfer data to or from a server using protocols like HTTP, HTTPS, FTP, and more. It’s often used to test web services or APIs.

Basic usage:

  • Fetch a web page:
curl https://example.com
  • Show only headers (meta-information about the page):
curl -I https://example.com

IT environment use case:

  • Checking if a web server is responding correctly.
  • Testing APIs for web applications.
  • Downloading files from a server directly to a Linux system.

4. dig Command

The dig (Domain Information Groper) command is used for DNS lookups. It shows how domain names are resolved to IP addresses.

Basic usage:

dig example.com
  • Returns the IP address for the domain, name servers, and other DNS information.

Common options:

  • +short → only show the IP address:
dig example.com +short
  • Specify a particular DNS server:
dig @8.8.8.8 example.com

IT environment use case:

  • Checking if a domain resolves correctly.
  • Troubleshooting DNS issues when users cannot reach websites.

5. traceroute Command

The traceroute command shows the path packets take from your machine to a destination and measures delays at each hop.

Basic usage:

traceroute google.com

IT environment use case:

  • Diagnosing where network delays or failures occur between servers.
  • Understanding the route traffic takes through multiple network devices.

Summary Table for Exam

CommandPurposeExampleIT Use Case
ipManage interfaces, IPs, routesip addr, ip routeCheck IP addresses, configure network interfaces
pingTest connectivity and latencyping -c 4 google.comVerify server or device is online
curlTransfer data or test web serverscurl -I https://example.comCheck web server/API response
digDNS lookupsdig example.com +shortVerify domain resolves correctly
tracerouteTrace network pathtraceroute google.comFind network hops and delays

Exam Tips:

  1. Know what each command does, not just the syntax.
  2. Remember ping is for connectivity, dig is for DNS, traceroute is for path tracing.
  3. Commands like ip and curl are often used for configuration or testing in real IT tasks.
  4. Options like -c for ping or +short for dig are commonly tested.
Buy Me a Coffee