Monitor and troubleshoot networking

Context: LFCS certification command examples.

Monitor and troubleshoot networking

Monitoring and troubleshooting networking is an important skill for the Linux Foundation Certified System Administrator (LFCS) certification. Here are some command examples that can help you monitor and troubleshoot networking in a Linux environment:

  1. Check network interface status:
ip link show

This command displays the status of all network interfaces, including their names, MAC addresses, and operational state.

  1. Display IP address information:
ip addr show

This command provides detailed information about the IP addresses assigned to network interfaces.

  1. Check routing table:
ip route show

This command shows the routing table, which determines the paths for network traffic based on destination IP addresses.

  1. Perform network connectivity tests:
ping <destination>

This command sends ICMP echo requests to a specified destination to check network connectivity.

  1. Capture network packets:
tcpdump -i <interface> -w <output_file.pcap>

This command captures network packets on a specific network interface and saves them to a file for analysis.

  1. Analyze network traffic:
wireshark <input_file.pcap>

This command launches the Wireshark graphical tool to analyze captured network packets from a file.

  1. Check listening ports and network connections:
netstat -tuln

This command displays the listening ports (-l) and active network connections (-a) on the system.

  1. View network statistics and interface details:
ifconfig

This command provides detailed information about network interfaces, including IP addresses, MAC addresses, and network statistics. (Note: The ip command is now recommended over ifconfig, but ifconfig is still commonly used.)

  1. Troubleshoot DNS:
nslookup <domain>

This command performs DNS (Domain Name System) lookups to resolve domain names to IP addresses and vice versa.

  1. Check network services and their status:
systemctl status <service_name>

This command displays the status of a specific network service using systemd.

These command examples can assist you in monitoring and troubleshooting networking issues in a Linux environment. Remember to adjust the commands based on your specific distribution and version. Additionally, consider exploring additional tools and utilities available for networking analysis and troubleshooting, such as iperf, nmap, ss, traceroute, and mtr.

You should also read: