Đang Tải...

Trang chủ
Tot Blog

Tutorials

Guide on How to Ping and Traceroute to check Network Connections

19/07/2024

icon

This article provides step-by-step instructions on using the command-line tools Ping and Traceroute, which are simple and easy ways to check network connectivity.

Mục lục

Mục lục

1. Introduction to Ping and Tracert

Ping and tracert are commands used to check network connectivity.

1.1. What is Ping?

Ping is a command-line tool used to check network connectivity between your computer and another server or IP address. Your computer sends ICMP (Internet Control Message Protocol) packets to the destination address and waits for a response.

Basic syntax: ping [IP address or domain name]

1.2. What is Tracert?

Tracert (also known as traceroute or tracepath) is used to trace and display the route taken by packets from your computer to another server or IP address. This command helps identify intermediate routers through which packets pass before reaching the destination.

Basic syntax: tracert [IP address or domain name]

2. Detailed Guide on Using Ping and Tracert

2.1. Using Ping and Tracert on Windows

Access Start -> Run or use the Windows + R key combination, type cmd and press Ok.

To ping a website, use the syntax "ping + website". For example: ping google.com

Ping command on Windows
Ping command on Windows

Similarly, to trace the route to a website, use "tracert + website". For example: tracert google.com

Tracert command on Windows
Tracert command on Windows

2.2. Using Ping and Tracert on MacOS

On MacOS, access Terminal using the Command (⌘) + Space key combination, then type "Terminal". Alternatively, you can use Siri to search for and open Terminal. Use the ping and traceroute syntax as in Windows.

2.3. Using Ping and Tracepath on Linux

For Linux, log in via SSH or Putty, then use the ping command to check the website you want. If you are unsure how to log in to a Linux server, refer to the article "Guide to: remote & login VPS on Computer".

The ping command will run continuously; to stop it, use the Ctrl + C key combination.

Note: If traceroute is not installed on your OS, install it first using the following command:

Ubuntu/Debian: apt-get install traceroute

CentOS/RHEL: yum install traceroute

Ping command on Linux
Ping command on Linux

The tracert command on Linux is replaced with traceroute or tracepath: "traceroute google.com"

Traceroute command on Linux
Traceroute command on Linux

3. Analyzing Results

3.1. Ping Results

  • Successful ping will show a message like: "Reply from 103.197.185.252: bytes=32 time=23ms TTL=118". Where:

IP address after "Reply from:" indicates the responding machine. bytes=32: size of the packet sent. time=23ms: round-trip time. TTL=118: Time to Live value of the packet; if it expires, the packet is discarded (maximum TTL is 225).

  • Unsuccessful ping will show: "Request timed out": No response received. "Destination host unreachable": Unable to connect to the destination machine.

3.2. Traceroute Results

  • Line 1: Connection between modem and computer, with the best latency typically around 1ms.
  • Line 2: If it's a private IP, it's similar to line 1. If it's a public IP, it's the connection between the modem and the ISP's network, with latency typically between 10-40ms.
  • Lines 3 to trace complete: Display connections within the network between ISPs.

Additionally, if the results show "*", or "Request timed out", there are connectivity issues that need to be resolved.

TelegramCommunity
scroll top
Thông báo
Đóng