> For the complete documentation index, see [llms.txt](https://netsec.nerd-cafe.ir/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://netsec.nerd-cafe.ir/network-engineering/comptia-network+/n10-007/traceroute-test.md).

# Traceroute Test

Nerd Cafe

### <mark style="color:blue;">**Step 1: Understanding**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**`traceroute`**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**(Linux/macOS) &**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**`tracert`**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**(Windows)**</mark>

* **Purpose:**
  * Helps track the path a packet takes from source to destination.
  * Identifies where network delays or failures occur.
* **Commands:**
  * **Windows:** `tracert [destination IP]`
  * **Linux/macOS:** `traceroute [destination IP]`

### <mark style="color:blue;">**Step 2: Network Setup with Static Routes**</mark>

Assuming <mark style="color:red;">**static routing**</mark> is already configured, verify your routes:

<figure><img src="https://2804731566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLOszSitBb46QATDLUtW4%2Fuploads%2FmpufD1bBUHl0CiDtTwwV%2F0506-tracert-topology.png?alt=media&amp;token=deb0bd4b-f3de-47c8-a2ae-64e34ade3fa5" alt=""><figcaption><p>Topology</p></figcaption></figure>

#### **Router R1:**

```bash
R1(config)# ip route 192.168.3.0 255.255.255.0 10.0.0.2
```

* This route tells R1 that to reach <mark style="color:red;">**192.168.3.0/24**</mark>, forward packets to <mark style="color:red;">**R2 (10.0.0.2)**</mark>.

#### Router R2:

```bash
R2(config)# ip route 192.168.3.0 255.255.255.0 10.0.1.2
R2(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1
```

* **First route**: To reach **192.168.3.0/24**, forward packets to **R3 (10.0.1.2)**.
* **Second route**: To reach **192.168.1.0/24**, forward packets to **R1 (10.0.0.1)**.

#### Router R3:

```bash
R3(config)# ip route 192.168.1.0 255.255.255.0 10.0.1.1
```

* This route tells R3 that to reach **192.168.1.0/24**, forward packets to **R2 (10.0.1.1)**.

### <mark style="color:blue;">Step 3: Running</mark> <mark style="color:blue;"></mark><mark style="color:blue;">`tracert`</mark> <mark style="color:blue;"></mark><mark style="color:blue;">from PC1 to PC3</mark>

```
PC1>tracert 192.168.3.100

Tracing route to 192.168.3.100 over a maximum of 30 hops: 

  1   1 ms      0 ms      0 ms      192.168.1.1
  2   1 ms      1 ms      1 ms      10.0.0.2
  3   2 ms      22 ms     0 ms      10.0.1.2
  4   1 ms      3 ms      0 ms      192.168.3.100

Trace complete.

PC1>
```

* Each <mark style="color:red;">**hop**</mark> represents a router in the network.
* The times in <mark style="color:red;">**ms (milliseconds)**</mark> show response delays.

### <mark style="color:blue;">**Step 4: Troubleshooting with**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**`tracert`**</mark>

If `tracert` does not work or times out:

* **Verify Static Routes for R1**:

```
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, Serial0/0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
S    192.168.2.0/24 is directly connected, Serial0/0/0
S    192.168.3.0/24 is directly connected, Serial0/0/0
R1#
```

* **Verify Static Routes for R2**:

```
R2#show ip route 
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/30 is subnetted, 2 subnets
C       10.0.0.0 is directly connected, Serial0/0/0
C       10.0.1.0 is directly connected, Serial0/1/0
S    192.168.1.0/24 is directly connected, Serial0/0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
S    192.168.3.0/24 is directly connected, Serial0/1/0
R2#
```

* **Verify Static Routes for R3**:

```
R3#show ip route 
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.1.0 is directly connected, Serial0/1/0
C    192.168.3.0/24 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 is directly connected, Serial0/1/0
R3#
```

* **Check connectivity using `ping`**:

```
PC1>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time=1ms TTL=255
Reply from 192.168.1.1: bytes=32 time=1ms TTL=255
Reply from 192.168.1.1: bytes=32 time=0ms TTL=255
Reply from 192.168.1.1: bytes=32 time=0ms TTL=255

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC1>ping 192.168.2.100

Pinging 192.168.2.100 with 32 bytes of data:

Reply from 192.168.2.100: bytes=32 time=14ms TTL=126
Reply from 192.168.2.100: bytes=32 time=1ms TTL=126
Reply from 192.168.2.100: bytes=32 time=2ms TTL=126
Reply from 192.168.2.100: bytes=32 time=1ms TTL=126

Ping statistics for 192.168.2.100:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 14ms, Average = 4ms

PC1>ping 192.168.3.100

Pinging 192.168.3.100 with 32 bytes of data:

Reply from 192.168.3.100: bytes=32 time=2ms TTL=125
Reply from 192.168.3.100: bytes=32 time=2ms TTL=125
Reply from 192.168.3.100: bytes=32 time=16ms TTL=125
Reply from 192.168.3.100: bytes=32 time=2ms TTL=125

Ping statistics for 192.168.3.100:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 2ms, Maximum = 16ms, Average = 5ms

PC1>
```

### <mark style="color:blue;">Keywords</mark>

`Traceroute`, `Tracert`, `Static Routing`, `Network Troubleshooting`, `ICMP`, `Hop Count`, `Packet Path`, `Latency`, `Ping`, `Route Verification`, `Show IP Route`, `Show IP Interface Brief`, `Router Configuration`, `Network Delay`, `Packet Switching`, `Routing Table`, `Network Connectivity`, `Path Analysis`, `Command Prompt`, `Terminal`, `نتورک پلاس`
