> 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/security-engineering/practical-packet-analysis/routing-information-protocol.md).

# Routing Information Protocol

In this tutorial, we will set up and configure <mark style="color:red;">**Routing Information Protocol (RIP)**</mark> in <mark style="color:red;">**GNS3**</mark>. The objective is to establish dynamic routing between routers and a virtual private cloud (<mark style="color:red;">**VPC1**</mark>) using RIP.

### <mark style="color:blue;">**Step 1: Understanding the Network Topology**</mark>

Our network consists of:

* **Router R1** (Connected to R2 via Serial 1/0)
* **Router R2** (Connected to R1 via Serial 1/0 and to VPC1 via FastEthernet 0/0)
* **VPC1** (Simulating a client machine, connected to R2 via FastEthernet 0/0)

| Device | Interface         | Address      | Subnet Mask   |
| ------ | ----------------- | ------------ | ------------- |
| R1     | Serial 3/0        | 192.168.1.1  | 255.255.255.0 |
| R2     | Serial 3/0        | 192.168.1.2  | 255.255.255.0 |
| R2     | FastEthernet 0/0  | 172.16.1.1   | 255.255.0.0   |
| VPC1   | Virtual Interface | 172.16.1.100 | 255.255.0.0   |

<figure><img src="/files/f6JAGbqLSFEEO5NhSfqf" alt=""><figcaption><p>Toplogy</p></figcaption></figure>

### <mark style="color:blue;">Step 2: Configuring Router R1</mark>

```
R1#configure terminal
R1(config)#interface serial 3/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#network 192.168.1.0
```

### <mark style="color:blue;">Step 3: Configuring Router R2</mark>

```
R2#configure terminal
R2(config)#interface serial 3/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 172.16.1.1 255.255.0.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config-router)#network 192.168.1.0
R2(config-router)#network 172.16.0.0

```

### <mark style="color:blue;">Step 4: Configuring VPC1 (Client Machine)</mark>

```
PC1> ip 172.16.1.100/16 172.16.1.1
Checking for duplicate address...
PC1 : 172.16.1.100 255.255.0.0 gateway 172.16.1.1

PC1> show ip

NAME        : PC1[1]
IP/MASK     : 172.16.1.100/16
GATEWAY     : 172.16.1.1
DNS         :
MAC         : 00:50:79:66:68:01
LPORT       : 20010
RHOST:PORT  : 127.0.0.1:20011
MTU         : 1500

PC1>
```

### <mark style="color:blue;">Step 5: Verify connectivity with a ping test</mark>

```
PC1> ping 172.16.1.1

84 bytes from 172.16.1.1 icmp_seq=1 ttl=255 time=30.814 ms
84 bytes from 172.16.1.1 icmp_seq=2 ttl=255 time=8.786 ms
^C
PC1> ping 192.168.1.2

84 bytes from 192.168.1.2 icmp_seq=1 ttl=255 time=9.390 ms
84 bytes from 192.168.1.2 icmp_seq=2 ttl=255 time=8.624 ms
^C
PC1> ping 192.168.1.1

84 bytes from 192.168.1.1 icmp_seq=1 ttl=254 time=31.406 ms
84 bytes from 192.168.1.1 icmp_seq=2 ttl=254 time=27.448 ms
^C
PC1>
```

### <mark style="color:blue;">Step 6: Capture RIP packets using Wireshark</mark>

Apply a filter:

```
rip
```

Verify that RIP advertisements are being broadcast correctly.

<figure><img src="/files/uujcKo7nBxDJ9BB7b4YD" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">**Step 7: Understanding RIP**</mark>

Key Features of RIP:

* Distance-vector routing protocol
* Uses hop count as a metric (max 15 hops)
* Broadcasts routing table every 30 seconds
* Uses UDP port 520
* Administrative distance: 120

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

`RIP`, `Routing Information Protocol`, `GNS3`, `dynamic routing`, `router configuration`, `IP addressing`, `subnet mask`, `hop count`, `distance-vector`, `routing table`, `serial interface`, `FastEthernet`, `VPC1`, `network topology`, `debug ip rip`, `show ip route`, `routing updates`, `UDP port 520`, `administrative distance`, `RIP packets`, `وایرشارک`
