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:
- Check network interface status:
ip link show
This command displays the status of all network interfaces, including their names, MAC addresses, and operational state.
- Display IP address information:
ip addr show
This command provides detailed information about the IP addresses assigned to network interfaces.
- Check routing table:
ip route show
This command shows the routing table, which determines the paths for network traffic based on destination IP addresses.
- Perform network connectivity tests:
This command sends ICMP echo requests to a specified destination to check network connectivity.
- 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.
- Analyze network traffic:
This command launches the Wireshark graphical tool to analyze captured network packets from a file.
- Check listening ports and network connections:
This command displays the listening ports (-l) and active network connections (-a) on the system.
- View network statistics and interface details:
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 is still commonly used.)
- Troubleshoot DNS:
This command performs DNS (Domain Name System) lookups to resolve domain names to IP addresses and vice versa.
- 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.