To check the network connection on a Linux system, you can use the ping
command. The ping
command is a utility that allows you to send an echo request to a remote host and receive an echo reply, which can be used to test the connectivity between two systems.
To use the ping
command, open a terminal and enter the following command:
ping google.com
Replace google.com
with the domain name or IP address of the host that you want to test. The ping
command will send a series of echo requests to the host and display the echo replies as they are received. For example, the output might look something like this:
PING google.com (172.217.3.206) 56(84) bytes of data. 64 bytes from muc11s16-in-f14.1e100.net (172.217.3.206): icmp_seq=1 ttl=53 time=27.5 ms 64 bytes from muc11s16-in-f14.1e100.net (172.217.3.206): icmp_seq=2 ttl=53 time=27.1 ms 64 bytes from muc11s16-in-f14.1e100.net (172.217.3.206): icmp_seq=3 ttl=53 time=27.1 ms --- google.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 27.186/27.342/27.534/0.156 ms
If the ping
command is able to send and receive echo requests and replies, it means that the network connection is working and that the host is reachable. If the ping
command is unable to send and receive echo requests and replies, it could indicate a problem with the network connection or with the host itself.
Keep in mind that the ping
command is just one way to test the network connection on a Linux system. You can also use other tools, such as traceroute
or tcpdump
, to test the network connection or diagnose networking issues.