Linux: Check Network Connection Command

There are several commands that can be used to check the network connection in Linux, some of the most commonly used ones are:

  1. ping: This is a basic command that sends an echo request to a specified domain or IP address. It is used to check if the host is reachable and to measure the round-trip time for packets to travel from the source to destination and back. For example:
ping google.com
  1. traceroute: This command is used to determine the route taken by packets from the source to the destination. It helps to identify intermediate routers or hops along the way and any potential bottlenecks or connectivity issues. For example:
traceroute google.com
  1. nslookup: This command is used to query DNS servers for information about a domain name or IP address. It is used to verify the DNS resolution and to obtain the IP address associated with a domain name. For example:
nslookup google.com
  1. ifconfig: This command is used to display the status of network interfaces and to configure network parameters. For example:
ifconfig

This will display the status of all network interfaces on the machine, including IP addresses, netmasks, and broadcast addresses.

  1. ip addr: This is a newer version of the ifconfig command that is used to display the status of network interfaces. For example:
ip addr

This will display the status of all network interfaces on the machine, including IP addresses, netmasks, and broadcast addresses.

Leave a Comment