How to check network connectivity?

You can check network connectivity using several methods. Here are some common commands:

  1. Ping Command:
    The ping command is used to test the reachability of a host on a network. For example, to check connectivity to a specific IP address or hostname:

    ping <hostname_or_IP>

    Example:

    ping 8.8.8.8
  2. Traceroute Command:
    The traceroute command shows the path packets take to reach a destination. It can help identify where connectivity issues occur:

    traceroute <hostname_or_IP>

    Example:

    traceroute google.com
  3. Netstat Command:
    The netstat command displays network connections, routing tables, and interface statistics. You can use it to check active connections:

    netstat -tuln
  4. Curl Command:
    The curl command can be used to check if a specific service is reachable. For example, to check if a web server is responding:

    curl -I http://<hostname_or_IP>

    Example:

    curl -I http://example.com
  5. Ifconfig or Ip Command:
    Use ifconfig or ip to check your local network interfaces and their statuses:

    ifconfig

    or

    ip addr
  6. Network Diagnostic Tools:
    Tools like nmap can be used to scan for open ports and services on a network:

    nmap <hostname_or_IP>

By using these commands, you can effectively diagnose and troubleshoot network connectivity issues.

0 Comments

no data
Be the first to share your comment!